//Occupy the global variable of Chart, and create a simple base class
var Chart = function(context, config) {
-- var chart = this;
this.config = config;
// Support a jQuery'd canvas element
context = context.getContext("2d");
}
++ this.ctx = context;
this.canvas = context.canvas;
-- this.ctx = context;
++ // Figure out what the size of the chart will be.
++ // If the canvas has a specified width and height, we use those else
++ // we look to see if the canvas node has a CSS width and height.
++ // If there is still no height, fill the parent container
++ this.width = context.canvas.width || parseInt(Chart.helpers.getStyle(context.canvas, 'width')) || Chart.helpers.getMaximumWidth(context.canvas);
++ this.height = context.canvas.height || parseInt(Chart.helpers.getStyle(context.canvas, 'height')) || Chart.helpers.getMaximumHeight(context.canvas);
-- //Variables global to the chart
-- var computeDimension = function(element, dimension) {
-- if (element['offset' + dimension]) {
-- return element['offset' + dimension];
-- } else {
-- return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);
-- }
-- };
++ this.aspectRatio = this.width / this.height;
-- var width = this.width = computeDimension(context.canvas, 'Width') || context.canvas.width;
-- var height = this.height = computeDimension(context.canvas, 'Height') || context.canvas.height;
++ if (isNaN(this.aspectRatio) || isFinite(this.aspectRatio) === false) {
++ // If the canvas has no size, try and figure out what the aspect ratio will be.
++ // Some charts prefer square canvases (pie, radar, etc). If that is specified, use that
++ // else use the canvas default ratio of 2
++ this.aspectRatio = config.aspectRatio !== undefined ? config.aspectRatio : 2;
++ }
-- // Firefox requires this to work correctly
-- context.canvas.width = width;
-- context.canvas.height = height;
++ // Store the original style of the element so we can set it back
++ this.originalCanvasStyleWidth = context.canvas.style.width;
++ this.originalCanvasStyleHeight = context.canvas.style.height;
-- width = this.width = context.canvas.width;
-- height = this.height = context.canvas.height;
-- this.aspectRatio = this.width / this.height;
-- //High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
++ // High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
Chart.helpers.retinaScale(this);
++ // Always bind this so that if the responsive state changes we still work
++ var _this = this;
++ Chart.helpers.addResizeListener(context.canvas.parentNode, function() {
++ if (config.options.responsive) {
++ _this.controller.resize();
++ }
++ });
++
if (config) {
this.controller = new Chart.Controller(this);
return this.controller;
return base;
},
++ extendDeep = helpers.extendDeep = function(_base) {
++ return _extendDeep.apply(this, arguments);
++
++ function _extendDeep(dst) {
++ helpers.each(arguments, function(obj) {
++ if (obj !== dst) {
++ helpers.each(obj, function(value, key) {
++ if (dst[key] && dst[key].constructor && dst[key].constructor === Object) {
++ _extendDeep(dst[key], value);
++ } else {
++ dst[key] = value;
++ }
++ });
++ }
++ });
++ return dst;
++ }
++ },
scaleMerge = helpers.scaleMerge = function(_base, extension) {
var base = clone(_base);
} else {
// Generate a reusable function that will serve as a template
// generator (and which will be cached).
-- fn = new Function("obj",
-- "var p=[],print=function(){p.push.apply(p,arguments);};" +
++ var functionCode = "var p=[],print=function(){p.push.apply(p,arguments);};" +
// Introduce the data as local variables using with(){}
"with(obj){p.push('" +
.split("\t").join("');")
.split("%>").join("p.push('")
.split("\r").join("\\'") +
-- "');}return p.join('');"
-- );
++ "');}return p.join('');";
++ fn = new Function("obj", functionCode);
// Cache the result
templateStringCache[str] = fn;
};
})(),
//-- DOM methods
-- getRelativePosition = helpers.getRelativePosition = function(evt) {
++ getRelativePosition = helpers.getRelativePosition = function(evt, chart) {
var mouseX, mouseY;
var e = evt.originalEvent || evt,
canvas = evt.currentTarget || evt.srcElement,
boundingRect = canvas.getBoundingClientRect();
if (e.touches) {
-- mouseX = e.touches[0].clientX - boundingRect.left;
-- mouseY = e.touches[0].clientY - boundingRect.top;
++ mouseX = e.touches[0].clientX;
++ mouseY = e.touches[0].clientY;
} else {
-- mouseX = e.clientX - boundingRect.left;
-- mouseY = e.clientY - boundingRect.top;
++ mouseX = e.clientX;
++ mouseY = e.clientY;
}
++ // Scale mouse coordinates into canvas coordinates
++ // by following the pattern laid out by 'jerryj' in the comments of
++ // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
++
++ // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However
++ // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here
++ mouseX = Math.round((mouseX - boundingRect.left) / (boundingRect.right - boundingRect.left) * canvas.width / chart.currentDevicePixelRatio);
++ mouseY = Math.round((mouseY - boundingRect.top) / (boundingRect.bottom - boundingRect.top) * canvas.height / chart.currentDevicePixelRatio);
++
return {
x: mouseX,
y: mouseY
removeEvent(chartInstance.chart.canvas, eventName, handler);
});
},
++ getConstraintWidth = helpers.getConstraintWidth = function(domNode) { // returns Number or undefined if no constraint
++ var constrainedWidth;
++ var constrainedWNode = document.defaultView.getComputedStyle(domNode)['max-width'];
++ var constrainedWContainer = document.defaultView.getComputedStyle(domNode.parentNode)['max-width'];
++ var hasCWNode = constrainedWNode !== null && constrainedWNode !== "none";
++ var hasCWContainer = constrainedWContainer !== null && constrainedWContainer !== "none";
++
++ if (hasCWNode || hasCWContainer) {
++ constrainedWidth = Math.min((hasCWNode ? parseInt(constrainedWNode, 10) : Number.POSITIVE_INFINITY), (hasCWContainer ? parseInt(constrainedWContainer, 10) : Number.POSITIVE_INFINITY));
++ }
++ return constrainedWidth;
++ },
++ getConstraintHeight = helpers.getConstraintHeight = function(domNode) { // returns Number or undefined if no constraint
++
++ var constrainedHeight;
++ var constrainedHNode = document.defaultView.getComputedStyle(domNode)['max-height'];
++ var constrainedHContainer = document.defaultView.getComputedStyle(domNode.parentNode)['max-height'];
++ var hasCHNode = constrainedHNode !== null && constrainedHNode !== "none";
++ var hasCHContainer = constrainedHContainer !== null && constrainedHContainer !== "none";
++
++ if (constrainedHNode || constrainedHContainer) {
++ constrainedHeight = Math.min((hasCHNode ? parseInt(constrainedHNode, 10) : Number.POSITIVE_INFINITY), (hasCHContainer ? parseInt(constrainedHContainer, 10) : Number.POSITIVE_INFINITY));
++ }
++ return constrainedHeight;
++ },
getMaximumWidth = helpers.getMaximumWidth = function(domNode) {
-- var container = domNode.parentNode,
-- padding = parseInt(getStyle(container, 'padding-left')) + parseInt(getStyle(container, 'padding-right'));
-- // TODO = check cross browser stuff with this.
-- return container.clientWidth - padding;
++ var container = domNode.parentNode;
++ var padding = parseInt(getStyle(container, 'padding-left')) + parseInt(getStyle(container, 'padding-right'));
++
++ var w = container.clientWidth - padding;
++ var cw = getConstraintWidth(domNode);
++ if (cw !== undefined) {
++ w = Math.min(w, cw);
++ }
++
++ return w;
},
getMaximumHeight = helpers.getMaximumHeight = function(domNode) {
-- var container = domNode.parentNode,
-- padding = parseInt(getStyle(container, 'padding-bottom')) + parseInt(getStyle(container, 'padding-top'));
-- // TODO = check cross browser stuff with this.
-- return container.clientHeight - padding;
++ var container = domNode.parentNode;
++ var padding = parseInt(getStyle(container, 'padding-top')) + parseInt(getStyle(container, 'padding-bottom'));
++
++ var h = container.clientHeight - padding;
++ var ch = getConstraintHeight(domNode);
++ if (ch !== undefined) {
++ h = Math.min(h, ch);
++ }
++
++ return h;
},
getStyle = helpers.getStyle = function(el, property) {
return el.currentStyle ?
},
getMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth, // legacy support
retinaScale = helpers.retinaScale = function(chart) {
-- var ctx = chart.ctx,
-- width = chart.canvas.width,
-- height = chart.canvas.height;
++ var ctx = chart.ctx;
++ var width = chart.canvas.width;
++ var height = chart.canvas.height;
++ chart.currentDevicePixelRatio = window.devicePixelRatio || 1;
-- if (window.devicePixelRatio) {
-- ctx.canvas.style.width = width + "px";
-- ctx.canvas.style.height = height + "px";
++ if (window.devicePixelRatio !== 1) {
ctx.canvas.height = height * window.devicePixelRatio;
ctx.canvas.width = width * window.devicePixelRatio;
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
++
++ ctx.canvas.style.width = width + 'px';
++ ctx.canvas.style.height = height + 'px';
++
++ // Store the device pixel ratio so that we can go backwards in `destroy`.
++ // The devicePixelRatio changes with zoom, so there are no guarantees that it is the same
++ // when destroy is called
++ chart.originalDevicePixelRatio = chart.originalDevicePixelRatio || window.devicePixelRatio;
}
},
//-- Canvas methods
}
return window.Color(color);
},
++ addResizeListener = helpers.addResizeListener = function(node, callback) {
++ // Hide an iframe before the node
++ var hiddenIframe = document.createElement('iframe');
++ var hiddenIframeClass = 'chartjs-hidden-iframe';
++
++ if (hiddenIframe.classlist) {
++ // can use classlist
++ hiddenIframe.classlist.add(hiddenIframeClass);
++ } else {
++ hiddenIframe.setAttribute('class', hiddenIframeClass)
++ }
++
++ // Set the style
++ hiddenIframe.style.width = '100%';
++ hiddenIframe.style.display = 'block';
++ hiddenIframe.style.border = 0;
++ hiddenIframe.style.height = 0;
++ hiddenIframe.style.margin = 0;
++ hiddenIframe.style.position = 'absolute';
++ hiddenIframe.style.left = 0;
++ hiddenIframe.style.right = 0;
++ hiddenIframe.style.top = 0;
++ hiddenIframe.style.bottom = 0;
++
++ // Insert the iframe so that contentWindow is available
++ node.insertBefore(hiddenIframe, node.firstChild);
++
++ var timer = 0;
++ (hiddenIframe.contentWindow || hiddenIframe).onresize = function() {
++ if (callback) {
++ callback();
++ }
++ }
++ },
++ removeResizeListener = helpers.removeResizeListener = function(node) {
++ var hiddenIframe = node.querySelector('.chartjs-hidden-iframe');
++
++ // Remove the resize detect iframe
++ if (hiddenIframe) {
++ hiddenIframe.remove();
++ }
++ },
isArray = helpers.isArray = function(obj) {
if (!Array.isArray) {
return Object.prototype.toString.call(arg) === '[object Array]';
return this;
},
-- addDataset: function addDataset(dataset, index) {
-- if (index !== undefined) {
-- this.data.datasets.splice(index, 0, dataset);
-- } else {
-- this.data.datasets.push(dataset);
-- }
--
-- this.buildOrUpdateControllers();
-- dataset.controller.reset(); // so that animation looks ok
-- this.update();
-- },
-- removeDataset: function removeDataset(index) {
-- this.data.datasets.splice(index, 1);
-- this.buildOrUpdateControllers();
-- this.update();
-- },
--
-- // Add data to the given dataset
-- // @param data: the data to add
-- // @param {Number} datasetIndex : the index of the dataset to add to
-- // @param {Number} index : the index of the data
-- addData: function addData(data, datasetIndex, index) {
-- if (datasetIndex < this.data.datasets.length) {
-- if (index === undefined) {
-- index = this.data.datasets[datasetIndex].data.length;
-- }
--
-- var addElementArgs = [index];
-- for (var i = 3; i < arguments.length; ++i) {
-- addElementArgs.push(arguments[i]);
-- }
--
-- this.data.datasets[datasetIndex].data.splice(index, 0, data);
-- this.data.datasets[datasetIndex].controller.addElementAndReset.apply(this.data.datasets[datasetIndex].controller, addElementArgs);
-- this.update();
-- }
-- },
--
-- removeData: function removeData(datasetIndex, index) {
-- if (datasetIndex < this.data.datasets.length) {
-- this.data.datasets[datasetIndex].data.splice(index, 1);
-- this.data.datasets[datasetIndex].controller.removeElement(index);
-- this.update();
-- }
-- },
--
resize: function resize(silent) {
this.stop();
-- var canvas = this.chart.canvas,
-- newWidth = helpers.getMaximumWidth(this.chart.canvas),
-- newHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : helpers.getMaximumHeight(this.chart.canvas);
++ var canvas = this.chart.canvas;
++ var newWidth = helpers.getMaximumWidth(this.chart.canvas);
++ var newHeight = (this.options.maintainAspectRatio && isNaN(this.chart.aspectRatio) === false && isFinite(this.chart.aspectRatio) && this.chart.aspectRatio !== 0) ? newWidth / this.chart.aspectRatio : helpers.getMaximumHeight(this.chart.canvas);
canvas.width = this.chart.width = newWidth;
canvas.height = this.chart.height = newHeight;
this.scale = scale;
}
-- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
++ Chart.scaleService.update(this, this.chart.width, this.chart.height);
},
-- buildOrUpdateControllers: function() {
++ buildOrUpdateControllers: function buildOrUpdateControllers(resetNewControllers) {
++ var types = [];
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
-- var type = dataset.type || this.config.type;
++ if (!dataset.type) {
++ dataset.type = this.config.type;
++ }
++ var type = dataset.type;
++ types.push(type);
if (dataset.controller) {
dataset.controller.updateIndex(datasetIndex);
return;
}
dataset.controller = new Chart.controllers[type](this, datasetIndex);
++
++ if (resetNewControllers) {
++ dataset.controller.reset();
++ }
}, this);
++ if (types.length > 1) {
++ for (var i = 1; i < types.length; i++) {
++ if (types[i] != types[i - 1]) {
++ this.isCombo = true;
++ break;
++ }
++ }
++ }
},
resetElements: function resetElements() {
}, this);
},
--
update: function update(animationDuration, lazy) {
++ Chart.scaleService.update(this, this.chart.width, this.chart.height);
++
++ // Make sure dataset controllers are updated and new controllers are reset
++ this.buildOrUpdateControllers(true);
++
++ // Make sure all dataset controllers have correct meta data counts
++ helpers.each(this.data.datasets, function(dataset, datasetIndex) {
++ dataset.controller.buildOrUpdateElements();
++ }, this);
++
// This will loop through any data and do the appropriate element update for the type
-- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.update();
}, this);
this.tooltip.transition(easingDecimal).draw();
},
--
--
--
--
// Get the single element that was clicked on
// @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
getElementAtEvent: function(e) {
-- var eventPosition = helpers.getRelativePosition(e);
++ var eventPosition = helpers.getRelativePosition(e, this.chart);
var elementsArray = [];
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
},
getElementsAtEvent: function(e) {
-- var eventPosition = helpers.getRelativePosition(e);
++ var eventPosition = helpers.getRelativePosition(e, this.chart);
var elementsArray = [];
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
},
getDatasetAtEvent: function(e) {
-- var eventPosition = helpers.getRelativePosition(e);
++ var eventPosition = helpers.getRelativePosition(e, this.chart);
var elementsArray = [];
-- for (var datasetIndex = 0; datasetIndex < this.chart.data.datasets.length; datasetIndex++) {
-- for (elementIndex = 0; elementIndex < this.chart.data.datasets[datasetIndex].metaData.length; elementIndex++) {
-- if (this.chart.data.datasets[datasetIndex].metaData[elementIndex].inLabelRange(eventPosition.x, eventPosition.y)) {
-- helpers.each(this.chart.data.datasets, datasetIterator);
++ for (var datasetIndex = 0; datasetIndex < this.data.datasets.length; datasetIndex++) {
++ for (var elementIndex = 0; elementIndex < this.data.datasets[datasetIndex].metaData.length; elementIndex++) {
++ if (this.data.datasets[datasetIndex].metaData[elementIndex].inLabelRange(eventPosition.x, eventPosition.y)) {
++ helpers.each(this.data.datasets[datasetIndex].metaData, function(element, index) {
++ elementsArray.push(element);
++ }, this);
}
}
}
destroy: function destroy() {
this.clear();
helpers.unbindEvents(this, this.events);
-- var canvas = this.chart.canvas;
++ helpers.removeResizeListener(this.chart.canvas.parentNode);
-- // Reset canvas height/width attributes starts a fresh with the canvas context
++ // Reset canvas height/width attributes
++ var canvas = this.chart.canvas;
canvas.width = this.chart.width;
canvas.height = this.chart.height;
-- // < IE9 doesn't support removeProperty
-- if (canvas.style.removeProperty) {
-- canvas.style.removeProperty('width');
-- canvas.style.removeProperty('height');
-- } else {
-- canvas.style.removeAttribute('width');
-- canvas.style.removeAttribute('height');
++ // if we scaled the canvas in response to a devicePixelRatio !== 1, we need to undo that transform here
++ if (this.chart.originalDevicePixelRatio !== undefined) {
++ this.chart.ctx.scale(1 / this.chart.originalDevicePixelRatio, 1 / this.chart.originalDevicePixelRatio);
}
++ // Reset to the old style since it may have been changed by the device pixel ratio changes
++ canvas.style.width = this.chart.originalCanvasStyleWidth;
++ canvas.style.height = this.chart.originalCanvasStyleHeight;
++
delete Chart.instances[this.id];
},
this.data.datasets[this.lastActive[0]._datasetIndex].controller.removeHoverStyle(this.lastActive[0], this.lastActive[0]._datasetIndex, this.lastActive[0]._index);
break;
case 'label':
++ case 'dataset':
for (var i = 0; i < this.lastActive.length; i++) {
this.data.datasets[this.lastActive[i]._datasetIndex].controller.removeHoverStyle(this.lastActive[i], this.lastActive[i]._datasetIndex, this.lastActive[i]._index);
}
break;
-- case 'dataset':
-- break;
default:
// Don't change anything
}
this.data.datasets[this.active[0]._datasetIndex].controller.setHoverStyle(this.active[0]);
break;
case 'label':
++ case 'dataset':
for (var i = 0; i < this.active.length; i++) {
this.data.datasets[this.active[i]._datasetIndex].controller.setHoverStyle(this.active[i]);
}
break;
-- case 'dataset':
-- break;
default:
// Don't change anything
}
(this.lastActive.length && this.active.length && changed)) {
this.stop();
--
++
// We only need to render at this point. Updating will cause scales to be recomputed generating flicker & using more
// memory than necessary.
this.render(this.options.hover.animationDuration, true);
}).call(this);
(function() {
--
"use strict";
-- //Declare root variable - window in the browser, global on the server
var root = this,
-- previous = root.Chart,
++ Chart = root.Chart,
helpers = Chart.helpers;
++ Chart.defaults.scale = {
++ display: true,
-- // Attach global event to resize each chart instance when the browser resizes
-- helpers.addEvent(window, "resize", (function() {
-- // Basic debounce of resize function so it doesn't hurt performance when resizing browser.
-- var timeout;
-- return function() {
-- clearTimeout(timeout);
-- timeout = setTimeout(function() {
-- helpers.each(Chart.instances, function(instance) {
-- // If the responsive flag is set in the chart instance config
-- // Cascade the resize event down to the chart.
-- if (instance.options.responsive) {
-- instance.resize();
-- }
-- });
-- }, 16);
-- };
-- })());
++ // grid line settings
++ gridLines: {
++ show: true,
++ color: "rgba(0, 0, 0, 0.1)",
++ lineWidth: 1,
++ drawOnChartArea: true,
++ drawTicks: true,
++ zeroLineWidth: 1,
++ zeroLineColor: "rgba(0,0,0,0.25)",
++ offsetGridLines: false,
++ },
--}).call(this);
++ // label settings
++ ticks: {
++ show: true,
++ minRotation: 20,
++ maxRotation: 90,
++ template: "<%=value%>",
++ fontSize: 12,
++ fontStyle: "normal",
++ fontColor: "#666",
++ fontFamily: "Helvetica Neue",
++ },
++ };
--(function() {
-- "use strict";
++ Chart.Scale = Chart.Element.extend({
++
++ // These methods are ordered by lifecyle. Utilities then follow.
++ // Any function defined here is inherited by all scale types.
++ // Any function can be extended by the scale type
++
++ beforeUpdate: helpers.noop,
++ update: function(maxWidth, maxHeight, margins) {
++
++ // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
++ this.beforeUpdate();
++
++ // Absorb the master measurements
++ this.maxWidth = maxWidth;
++ this.maxHeight = maxHeight;
++ this.margins = margins;
++
++ // Dimensions
++ this.beforeSetDimensions();
++ this.setDimensions();
++ this.afterSetDimensions();
++ // Ticks
++ this.beforeBuildTicks();
++ this.buildTicks();
++ this.afterBuildTicks();
++ // Tick Rotation
++ this.beforeCalculateTickRotation();
++ this.calculateTickRotation();
++ this.afterCalculateTickRotation();
++ // Fit
++ this.beforeFit();
++ this.fit();
++ this.afterFit();
++ //
++ this.afterUpdate();
-- var root = this,
-- Chart = root.Chart,
-- helpers = Chart.helpers;
++ return this.minSize;
-- // The scale service is used to resize charts along with all of their axes. We make this as
-- // a service where scales are registered with their respective charts so that changing the
-- // scales does not require
-- Chart.scaleService = {
-- // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
-- // use the new chart options to grab the correct scale
-- constructors: {},
-- // Use a registration function so that we can move to an ES6 map when we no longer need to support
-- // old browsers
-- // Scale config defaults
-- defaults: {},
-- registerScaleType: function(type, scaleConstructor, defaults) {
-- this.constructors[type] = scaleConstructor;
-- this.defaults[type] = defaults;
-- },
-- getScaleConstructor: function(type) {
-- return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
},
-- getScaleDefaults: function(type) {
-- return this.defaults.hasOwnProperty(type) ? this.defaults[type] : {};
-- },
-- // The interesting function
-- fitScalesForChart: function(chartInstance, width, height) {
-- var xPadding = width > 30 ? 5 : 2;
-- var yPadding = height > 30 ? 5 : 2;
++ afterUpdate: helpers.noop,
-- if (chartInstance) {
-- var leftScales = helpers.where(chartInstance.scales, function(scaleInstance) {
-- return scaleInstance.options.position == "left";
-- });
-- var rightScales = helpers.where(chartInstance.scales, function(scaleInstance) {
-- return scaleInstance.options.position == "right";
-- });
-- var topScales = helpers.where(chartInstance.scales, function(scaleInstance) {
-- return scaleInstance.options.position == "top";
-- });
-- var bottomScales = helpers.where(chartInstance.scales, function(scaleInstance) {
-- return scaleInstance.options.position == "bottom";
-- });
++ //
-- // Essentially we now have any number of scales on each of the 4 sides.
-- // Our canvas looks like the following.
-- // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
-- // B1 is the bottom axis
-- // |------------------------------------------------------|
-- // | | T1 | |
-- // |----|-----|-------------------------------------|-----|
-- // | | | | |
-- // | L1 | L2 | Chart area | R1 |
-- // | | | | |
-- // | | | | |
-- // |----|-----|-------------------------------------|-----|
-- // | | B1 | |
-- // | | | |
-- // |------------------------------------------------------|
++ beforeSetDimensions: helpers.noop,
++ setDimensions: function() {
++ // Set the unconstrained dimension before label rotation
++ if (this.isHorizontal()) {
++ this.width = this.maxWidth;
++ } else {
++ this.height = this.maxHeight;
++ }
++ },
++ afterSetDimensions: helpers.noop,
-- // What we do to find the best sizing, we do the following
-- // 1. Determine the minimum size of the chart area.
-- // 2. Split the remaining width equally between each vertical axis
-- // 3. Split the remaining height equally between each horizontal axis
-- // 4. Give each scale the maximum size it can be. The scale will return it's minimum size
-- // 5. Adjust the sizes of each axis based on it's minimum reported size.
-- // 6. Refit each axis
-- // 7. Position each axis in the final location
-- // 8. Tell the chart the final location of the chart area
++ //
-- // Step 1
-- var chartWidth = width / 2; // min 50%
-- var chartHeight = height / 2; // min 50%
++ beforeBuildTicks: helpers.noop,
++ buildTicks: helpers.noop,
++ afterBuildTicks: helpers.noop,
-- chartWidth -= (2 * xPadding);
-- chartHeight -= (2 * yPadding);
++ //
++ beforeCalculateTickRotation: helpers.noop,
++ calculateTickRotation: function() {
++ //Get the width of each grid by calculating the difference
++ //between x offsets between 0 and 1.
++ var labelFont = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily);
++ this.ctx.font = labelFont;
-- // Step 2
-- var verticalScaleWidth = (width - chartWidth) / (leftScales.length + rightScales.length);
++ var firstWidth = this.ctx.measureText(this.ticks[0]).width;
++ var lastWidth = this.ctx.measureText(this.ticks[this.ticks.length - 1]).width;
++ var firstRotated;
++ var lastRotated;
-- // Step 3
-- var horizontalScaleHeight = (height - chartHeight) / (topScales.length + bottomScales.length);
++ this.paddingRight = lastWidth / 2 + 3;
++ this.paddingLeft = firstWidth / 2 + 3;
-- // Step 4;
-- var minimumScaleSizes = [];
++ this.labelRotation = 0;
-- var verticalScaleMinSizeFunction = function(scaleInstance) {
-- var minSize = scaleInstance.fit(verticalScaleWidth, chartHeight);
-- minimumScaleSizes.push({
-- horizontal: false,
-- minSize: minSize,
-- scale: scaleInstance,
-- });
-- };
++ if (this.options.display && this.isHorizontal()) {
++ var originalLabelWidth = helpers.longestText(this.ctx, labelFont, this.ticks);
++ var cosRotation;
++ var sinRotation;
++ var firstRotatedWidth;
-- var horizontalScaleMinSizeFunction = function(scaleInstance) {
-- var minSize = scaleInstance.fit(chartWidth, horizontalScaleHeight);
-- minimumScaleSizes.push({
-- horizontal: true,
-- minSize: minSize,
-- scale: scaleInstance,
-- });
-- };
++ this.labelWidth = originalLabelWidth;
-- // vertical scales
-- helpers.each(leftScales, verticalScaleMinSizeFunction);
-- helpers.each(rightScales, verticalScaleMinSizeFunction);
++ // Allow 3 pixels x2 padding either side for label readability
++ // only the index matters for a dataset scale, but we want a consistent interface between scales
-- // horizontal scales
-- helpers.each(topScales, horizontalScaleMinSizeFunction);
-- helpers.each(bottomScales, horizontalScaleMinSizeFunction);
++ var tickWidth = this.getPixelForTick(1) - this.getPixelForTick(0) - 6;
-- // Step 5
-- var maxChartHeight = height - (2 * yPadding);
-- var maxChartWidth = width - (2 * xPadding);
++ //Max label rotation can be set or default to 90 - also act as a loop counter
++ while (this.labelWidth > tickWidth && this.labelRotation <= this.options.ticks.maxRotation) {
++ cosRotation = Math.cos(helpers.toRadians(this.labelRotation));
++ sinRotation = Math.sin(helpers.toRadians(this.labelRotation));
-- helpers.each(minimumScaleSizes, function(wrapper) {
-- if (wrapper.horizontal) {
-- maxChartHeight -= wrapper.minSize.height;
-- } else {
-- maxChartWidth -= wrapper.minSize.width;
-- }
-- });
++ firstRotated = cosRotation * firstWidth;
++ lastRotated = cosRotation * lastWidth;
-- // At this point, maxChartHeight and maxChartWidth are the size the chart area could
-- // be if the axes are drawn at their minimum sizes.
++ // We're right aligning the text now.
++ if (firstRotated + this.options.ticks.fontSize / 2 > this.yLabelWidth) {
++ this.paddingLeft = firstRotated + this.options.ticks.fontSize / 2;
++ }
-- // Step 6
-- var verticalScaleFitFunction = function(scaleInstance) {
-- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
-- return wrapper.scale === scaleInstance;
-- });
++ this.paddingRight = this.options.ticks.fontSize / 2;
-- if (wrapper) {
-- scaleInstance.fit(wrapper.minSize.width, maxChartHeight);
++ if (sinRotation * originalLabelWidth > this.maxHeight) {
++ // go back one step
++ this.labelRotation--;
++ break;
}
-- };
-- var horizontalScaleFitFunction = function(scaleInstance) {
-- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
-- return wrapper.scale === scaleInstance;
-- });
++ this.labelRotation++;
++ this.labelWidth = cosRotation * originalLabelWidth;
-- var scaleMargin = {
-- left: totalLeftWidth,
-- right: totalRightWidth,
-- top: 0,
-- bottom: 0,
-- };
++ }
++ } else {
++ this.labelWidth = 0;
++ this.paddingRight = 0;
++ this.paddingLeft = 0;
++ }
++
++ if (this.margins) {
++ this.paddingLeft -= this.margins.left;
++ this.paddingRight -= this.margins.right;
++
++ this.paddingLeft = Math.max(this.paddingLeft, 0);
++ this.paddingRight = Math.max(this.paddingRight, 0);
++ }
++ },
++ afterCalculateTickRotation: helpers.noop,
++
++ //
++
++ beforeFit: helpers.noop,
++ fit: function() {
++
++ this.minSize = {
++ width: 0,
++ height: 0,
++ };
++
++ // Width
++ if (this.isHorizontal()) {
++ this.minSize.width = this.maxWidth; // fill all the width
++ } else {
++ this.minSize.width = this.options.gridLines.show && this.options.display ? 10 : 0;
++ }
++
++ // height
++ if (this.isHorizontal()) {
++ this.minSize.height = this.options.gridLines.show && this.options.display ? 10 : 0;
++ } else {
++ this.minSize.height = this.maxHeight; // fill all the height
++ }
++
++ this.paddingLeft = 0;
++ this.paddingRight = 0;
++ this.paddingTop = 0;
++ this.paddingBottom = 0;
++
++ if (this.options.ticks.show && this.options.display) {
++ // Don't bother fitting the ticks if we are not showing them
++ var labelFont = helpers.fontString(this.options.ticks.fontSize,
++ this.options.ticks.fontStyle, this.options.ticks.fontFamily);
++
++ if (this.isHorizontal()) {
++ // A horizontal axis is more constrained by the height.
++ var maxLabelHeight = this.maxHeight - this.minSize.height;
++ var labelHeight = 1.5 * this.options.ticks.fontSize;
++ this.minSize.height = Math.min(this.maxHeight, this.minSize.height + labelHeight);
++
++ labelFont = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily);
++ this.ctx.font = labelFont;
++
++ var firstLabelWidth = this.ctx.measureText(this.ticks[0]).width;
++ var lastLabelWidth = this.ctx.measureText(this.ticks[this.ticks.length - 1]).width;
++
++ // Ensure that our ticks are always inside the canvas
++ this.paddingLeft = firstLabelWidth / 2;
++ this.paddingRight = lastLabelWidth / 2;
++ } else {
++ // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
++ var maxLabelWidth = this.maxWidth - this.minSize.width;
++ var largestTextWidth = helpers.longestText(this.ctx, labelFont, this.ticks);
++
++ if (largestTextWidth < maxLabelWidth) {
++ // We don't need all the room
++ this.minSize.width += largestTextWidth;
++ } else {
++ // Expand to max size
++ this.minSize.width = this.maxWidth;
++ }
++
++ this.paddingTop = this.options.ticks.fontSize / 2;
++ this.paddingBottom = this.options.ticks.fontSize / 2;
++ }
++ }
++
++ if (this.margins) {
++ this.paddingLeft -= this.margins.left;
++ this.paddingTop -= this.margins.top;
++ this.paddingRight -= this.margins.right;
++ this.paddingBottom -= this.margins.bottom;
++
++ this.paddingLeft = Math.max(this.paddingLeft, 0);
++ this.paddingTop = Math.max(this.paddingTop, 0);
++ this.paddingRight = Math.max(this.paddingRight, 0);
++ this.paddingBottom = Math.max(this.paddingBottom, 0);
++ }
++
++ this.width = this.minSize.width;
++ this.height = this.minSize.height;
++
++ },
++ afterFit: helpers.noop,
++
++
++
++
++
++
++ // Shared Methods
++ isHorizontal: function() {
++ return this.options.position == "top" || this.options.position == "bottom";
++ },
++
++ // Used to get data value locations. Value can either be an index or a numerical value
++ getPixelForValue: helpers.noop,
++
++ // Used for tick location, should
++ getPixelForTick: function(index, includeOffset) {
++ if (this.isHorizontal()) {
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ var tickWidth = innerWidth / Math.max((this.ticks.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
++ var pixel = (tickWidth * index) + this.paddingLeft;
++
++ if (includeOffset) {
++ pixel += tickWidth / 2;
++ }
++ return this.left + Math.round(pixel);
++ } else {
++ var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
++ return this.top + (index * (innerHeight / (this.ticks.length - 1)));
++ }
++ },
++
++ // Utility for getting the pixel location of a percentage of scale
++ getPixelForDecimal: function(decimal, includeOffset) {
++ if (this.isHorizontal()) {
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ var valueOffset = (innerWidth * decimal) + this.paddingLeft;
++
++ return this.left + Math.round(valueOffset);
++ } else {
++ return this.top + (decimal * (this.height / this.ticks.length));
++ }
++ },
++
++ // Actualy draw the scale on the canvas
++ // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
++ draw: function(chartArea) {
++ if (this.options.display) {
++
++ var setContextLineSettings;
++ var isRotated;
++ var skipRatio;
++ var scaleLabelX;
++ var scaleLabelY;
++
++ // Make sure we draw text in the correct color
++ this.ctx.fillStyle = this.options.ticks.fontColor;
++
++ if (this.isHorizontal()) {
++ setContextLineSettings = true;
++ var yTickStart = this.options.position == "bottom" ? this.top : this.bottom - 10;
++ var yTickEnd = this.options.position == "bottom" ? this.top + 10 : this.bottom;
++ isRotated = this.labelRotation !== 0;
++ skipRatio = false;
++
++ if ((this.options.ticks.fontSize + 4) * this.ticks.length > (this.width - (this.paddingLeft + this.paddingRight))) {
++ skipRatio = 1 + Math.floor(((this.options.ticks.fontSize + 4) * this.ticks.length) / (this.width - (this.paddingLeft + this.paddingRight)));
++ }
++
++ helpers.each(this.ticks, function(label, index) {
++ // Blank ticks
++ if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
++ return;
++ }
++ var xLineValue = this.getPixelForTick(index); // xvalues for grid lines
++ var xLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
++
++ if (this.options.gridLines.show) {
++ if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
++ // Draw the first index specially
++ this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
++ this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
++ setContextLineSettings = true; // reset next time
++ } else if (setContextLineSettings) {
++ this.ctx.lineWidth = this.options.gridLines.lineWidth;
++ this.ctx.strokeStyle = this.options.gridLines.color;
++ setContextLineSettings = false;
++ }
++
++ xLineValue += helpers.aliasPixel(this.ctx.lineWidth);
++
++ // Draw the label area
++ this.ctx.beginPath();
++
++ if (this.options.gridLines.drawTicks) {
++ this.ctx.moveTo(xLineValue, yTickStart);
++ this.ctx.lineTo(xLineValue, yTickEnd);
++ }
++
++ // Draw the chart area
++ if (this.options.gridLines.drawOnChartArea) {
++ this.ctx.moveTo(xLineValue, chartArea.top);
++ this.ctx.lineTo(xLineValue, chartArea.bottom);
++ }
++
++ // Need to stroke in the loop because we are potentially changing line widths & colours
++ this.ctx.stroke();
++ }
++
++ if (this.options.ticks.show) {
++ this.ctx.save();
++ this.ctx.translate(xLabelValue, (isRotated) ? this.top + 12 : this.top + 8);
++ this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
++ this.ctx.font = this.font;
++ this.ctx.textAlign = (isRotated) ? "right" : "center";
++ this.ctx.textBaseline = (isRotated) ? "middle" : "top";
++ this.ctx.fillText(label, 0, 0);
++ this.ctx.restore();
++ }
++ }, this);
++
++ if (this.options.scaleLabel.show) {
++ // Draw the scale label
++ this.ctx.textAlign = "center";
++ this.ctx.textBaseline = 'middle';
++ this.ctx.font = helpers.fontString(this.options.scaleLabel.fontSize, this.options.scaleLabel.fontStyle, this.options.scaleLabel.fontFamily);
++
++ scaleLabelX = this.left + ((this.right - this.left) / 2); // midpoint of the width
++ scaleLabelY = this.options.position == 'bottom' ? this.bottom - (this.options.scaleLabel.fontSize / 2) : this.top + (this.options.scaleLabel.fontSize / 2);
++
++ this.ctx.fillText(this.options.scaleLabel.labelString, scaleLabelX, scaleLabelY);
++ }
++
++ } else {
++ setContextLineSettings = true;
++ var xTickStart = this.options.position == "left" ? this.right : this.left - 10;
++ var xTickEnd = this.options.position == "left" ? this.right + 10 : this.left;
++ isRotated = this.labelRotation !== 0;
++ //skipRatio = false;
++
++ // if ((this.options.ticks.fontSize + 4) * this.ticks.length > (this.width - (this.paddingLeft + this.paddingRight))) {
++ // skipRatio = 1 + Math.floor(((this.options.ticks.fontSize + 4) * this.ticks.length) / (this.width - (this.paddingLeft + this.paddingRight)));
++ // }
++
++ helpers.each(this.ticks, function(label, index) {
++ // Blank ticks
++ // if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
++ // return;
++ // }
++ var yLineValue = this.getPixelForTick(index); // xvalues for grid lines
++ var yLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
++ var xLabelValue = this.left + (this.width / 2);
++
++ if (this.options.gridLines.show) {
++ if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
++ // Draw the first index specially
++ this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
++ this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
++ setContextLineSettings = true; // reset next time
++ } else if (setContextLineSettings) {
++ this.ctx.lineWidth = this.options.gridLines.lineWidth;
++ this.ctx.strokeStyle = this.options.gridLines.color;
++ setContextLineSettings = false;
++ }
++
++ yLineValue += helpers.aliasPixel(this.ctx.lineWidth);
++
++ // Draw the label area
++ this.ctx.beginPath();
++
++ if (this.options.gridLines.drawTicks) {
++ this.ctx.moveTo(xTickStart, yLineValue);
++ this.ctx.lineTo(xTickEnd, yLineValue);
++ }
++
++ // Draw the chart area
++ if (this.options.gridLines.drawOnChartArea) {
++ this.ctx.moveTo(chartArea.left, yLineValue);
++ this.ctx.lineTo(chartArea.right, yLineValue);
++ }
++
++ // Need to stroke in the loop because we are potentially changing line widths & colours
++ this.ctx.stroke();
++ }
++
++ if (this.options.ticks.show) {
++ this.ctx.save();
++ this.ctx.translate(xLabelValue, yLabelValue);
++ this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
++ this.ctx.font = this.font;
++ this.ctx.textAlign = 'center';
++ this.ctx.textBaseline = "middle";
++ this.ctx.fillText(label, 0, 0);
++ this.ctx.restore();
++ }
++ }, this);
++
++ if (this.options.scaleLabel.show) {
++ // Draw the scale label
++ scaleLabelX = this.options.position == 'left' ? this.left + (this.options.scaleLabel.fontSize / 2) : this.right - (this.options.scaleLabel.fontSize / 2);
++ scaleLabelY = this.top + ((this.bottom - this.top) / 2);
++ var rotation = this.options.position == 'left' ? -0.5 * Math.PI : 0.5 * Math.PI;
++
++ this.ctx.save();
++ this.ctx.translate(scaleLabelX, scaleLabelY);
++ this.ctx.rotate(rotation);
++ this.ctx.textAlign = "center";
++ this.ctx.font = helpers.fontString(this.options.scaleLabel.fontSize, this.options.scaleLabel.fontStyle, this.options.scaleLabel.fontFamily);
++ this.ctx.textBaseline = 'middle';
++ this.ctx.fillText(this.options.scaleLabel.labelString, 0, 0);
++ this.ctx.restore();
++ }
++ }
++ }
++ }
++ });
++
++}).call(this);
++
++(function() {
++ "use strict";
++
++ var root = this,
++ Chart = root.Chart,
++ helpers = Chart.helpers;
++
++ // The scale service is used to resize charts along with all of their axes. We make this as
++ // a service where scales are registered with their respective charts so that changing the
++ // scales does not require
++ Chart.scaleService = {
++ // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
++ // use the new chart options to grab the correct scale
++ constructors: {},
++ // Use a registration function so that we can move to an ES6 map when we no longer need to support
++ // old browsers
++
++ // Scale config defaults
++ defaults: {},
++ registerScaleType: function(type, scaleConstructor, defaults) {
++ this.constructors[type] = scaleConstructor;
++ this.defaults[type] = helpers.extendDeep({}, Chart.defaults.scale, defaults);
++ },
++ getScaleConstructor: function(type) {
++ return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
++ },
++ getScaleDefaults: function(type) {
++ return this.defaults.hasOwnProperty(type) ? this.defaults[type] : {};
++ },
++ // The interesting function
++ update: function(chartInstance, width, height) {
++ var xPadding = width > 30 ? 5 : 2;
++ var yPadding = height > 30 ? 5 : 2;
++
++ if (chartInstance) {
++ var leftScales = helpers.where(chartInstance.scales, function(scaleInstance) {
++ return scaleInstance.options.position == "left";
++ });
++ var rightScales = helpers.where(chartInstance.scales, function(scaleInstance) {
++ return scaleInstance.options.position == "right";
++ });
++ var topScales = helpers.where(chartInstance.scales, function(scaleInstance) {
++ return scaleInstance.options.position == "top";
++ });
++ var bottomScales = helpers.where(chartInstance.scales, function(scaleInstance) {
++ return scaleInstance.options.position == "bottom";
++ });
++
++ // Essentially we now have any number of scales on each of the 4 sides.
++ // Our canvas looks like the following.
++ // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
++ // B1 is the bottom axis
++ // |------------------------------------------------------|
++ // | | T1 | |
++ // |----|-----|-------------------------------------|-----|
++ // | | | | |
++ // | L1 | L2 | Chart area | R1 |
++ // | | | | |
++ // | | | | |
++ // |----|-----|-------------------------------------|-----|
++ // | | B1 | |
++ // | | | |
++ // |------------------------------------------------------|
++
++ // What we do to find the best sizing, we do the following
++ // 1. Determine the minimum size of the chart area.
++ // 2. Split the remaining width equally between each vertical axis
++ // 3. Split the remaining height equally between each horizontal axis
++ // 4. Give each scale the maximum size it can be. The scale will return it's minimum size
++ // 5. Adjust the sizes of each axis based on it's minimum reported size.
++ // 6. Refit each axis
++ // 7. Position each axis in the final location
++ // 8. Tell the chart the final location of the chart area
++
++ // Step 1
++ var chartWidth = width / 2; // min 50%
++ var chartHeight = height / 2; // min 50%
++
++ chartWidth -= (2 * xPadding);
++ chartHeight -= (2 * yPadding);
++
++ // Step 2
++ var verticalScaleWidth = (width - chartWidth) / (leftScales.length + rightScales.length);
++
++ // Step 3
++ var horizontalScaleHeight = (height - chartHeight) / (topScales.length + bottomScales.length);
++
++ // Step 4;
++ var minimumScaleSizes = [];
++
++ var verticalScaleMinSizeFunction = function(scaleInstance) {
++ var minSize = scaleInstance.update(verticalScaleWidth, chartHeight);
++ minimumScaleSizes.push({
++ horizontal: false,
++ minSize: minSize,
++ scale: scaleInstance,
++ });
++ };
++
++ var horizontalScaleMinSizeFunction = function(scaleInstance) {
++ var minSize = scaleInstance.update(chartWidth, horizontalScaleHeight);
++ minimumScaleSizes.push({
++ horizontal: true,
++ minSize: minSize,
++ scale: scaleInstance,
++ });
++ };
++
++ // vertical scales
++ helpers.each(leftScales, verticalScaleMinSizeFunction);
++ helpers.each(rightScales, verticalScaleMinSizeFunction);
++
++ // horizontal scales
++ helpers.each(topScales, horizontalScaleMinSizeFunction);
++ helpers.each(bottomScales, horizontalScaleMinSizeFunction);
++
++ // Step 5
++ var maxChartHeight = height - (2 * yPadding);
++ var maxChartWidth = width - (2 * xPadding);
++
++ helpers.each(minimumScaleSizes, function(wrapper) {
++ if (wrapper.horizontal) {
++ maxChartHeight -= wrapper.minSize.height;
++ } else {
++ maxChartWidth -= wrapper.minSize.width;
++ }
++ });
++
++ // At this point, maxChartHeight and maxChartWidth are the size the chart area could
++ // be if the axes are drawn at their minimum sizes.
++
++ // Step 6
++ var verticalScaleFitFunction = function(scaleInstance) {
++ var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
++ return wrapper.scale === scaleInstance;
++ });
++
++ if (wrapper) {
++ scaleInstance.update(wrapper.minSize.width, maxChartHeight);
++ }
++ };
++
++ var horizontalScaleFitFunction = function(scaleInstance) {
++ var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
++ return wrapper.scale === scaleInstance;
++ });
++
++ var scaleMargin = {
++ left: totalLeftWidth,
++ right: totalRightWidth,
++ top: 0,
++ bottom: 0,
++ };
if (wrapper) {
-- scaleInstance.fit(maxChartWidth, wrapper.minSize.height, scaleMargin);
++ scaleInstance.update(maxChartWidth, wrapper.minSize.height, scaleMargin);
}
};
};
if (wrapper) {
-- scaleInstance.fit(wrapper.minSize.width, maxChartHeight, scaleMargin);
++ scaleInstance.update(wrapper.minSize.width, maxChartHeight, scaleMargin);
}
});
};
if (wrapper) {
-- scaleInstance.fit(wrapper.minSize.width, maxChartHeight, scaleMargin);
++ scaleInstance.update(wrapper.minSize.width, maxChartHeight, scaleMargin);
}
});
++ // Recalculate because the size of each scale might have changed slightly due to the margins (label rotation for instance)
++ totalLeftWidth = xPadding;
++ totalRightWidth = xPadding;
++ totalTopHeight = yPadding;
++ totalBottomHeight = yPadding;
++
++ helpers.each(leftScales, function(scaleInstance) {
++ totalLeftWidth += scaleInstance.width;
++ });
++
++ helpers.each(rightScales, function(scaleInstance) {
++ totalRightWidth += scaleInstance.width;
++ });
++
++ helpers.each(topScales, function(scaleInstance) {
++ totalTopHeight += scaleInstance.height;
++ });
++ helpers.each(bottomScales, function(scaleInstance) {
++ totalBottomHeight += scaleInstance.height;
++ });
++
++ // Figure out if our chart area changed. This would occur if the dataset scale label rotation
++ // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
++ // without calling `fit` again
++ var newMaxChartHeight = height - totalTopHeight - totalBottomHeight;
++ var newMaxChartWidth = width - totalLeftWidth - totalRightWidth;
++
++ if (newMaxChartWidth !== maxChartWidth || newMaxChartHeight !== maxChartHeight) {
++ helpers.each(leftScales, function(scale) {
++ scale.height = newMaxChartHeight;
++ });
++
++ helpers.each(rightScales, function(scale) {
++ scale.height = newMaxChartHeight;
++ });
++
++ helpers.each(topScales, function(scale) {
++ scale.width = newMaxChartWidth;
++ });
++
++ helpers.each(bottomScales, function(scale) {
++ scale.width = newMaxChartWidth;
++ });
++
++ maxChartHeight = newMaxChartHeight;
++ maxChartWidth = newMaxChartWidth;
++ }
++
// Step 7
// Position the scales
var left = xPadding;
}
}
};
++
++
}).call(this);
(function() {
x: medianPosition.x,
y: medianPosition.y,
labels: labels,
-- title: this._data.labels && this._data.labels.length ? this._data.labels[this._active[0]._index] : '',
++ title: (function() {
++ return this._data.timeLabels ? this._data.timeLabels[this._active[0]._index] :
++ (this._data.labels && this._data.labels.length) ? this._data.labels[this._active[0]._index] :
++ '';
++ }).call(this),
legendColors: colors,
legendBackgroundColor: this._options.tooltips.multiKeyBackground,
});
scales: {
xAxes: [{
type: "category",
-- categorySpacing: 10,
-- spacing: 1,
++
++ // Specific to Bar Controller
++ categoryPercentage: 0.8,
++ barPercentage: 0.9,
// grid line settings
gridLines: {
return this.chart.data.datasets[this.index];
},
-- getScaleForId: function(scaleID) {
++ getScaleForID: function(scaleID) {
return this.chart.scales[scaleID];
},
this.updateElement(rectangle, index, true, numBars);
this.getDataset().metaData.splice(index, 0, rectangle);
},
++
removeElement: function(index) {
this.getDataset().metaData.splice(index, 1);
},
this.update(true);
},
-- update: function(reset) {
-- var numBars = this.getBarCount();
--
++ buildOrUpdateElements: function buildOrUpdateElements() {
var numData = this.getDataset().data.length;
var numRectangles = this.getDataset().metaData.length;
// Make sure that we handle number of datapoints changing
if (numData < numRectangles) {
// Remove excess bars for data points that have been removed
-- this.getDataset().metaData.splice(numData, numRectangles - numData)
++ this.getDataset().metaData.splice(numData, numRectangles - numData);
} else if (numData > numRectangles) {
// Add new elements
for (var index = numRectangles; index < numData; ++index) {
this.addElementAndReset(index);
}
}
++ },
++
++ update: function update(reset) {
++ var numBars = this.getBarCount();
helpers.each(this.getDataset().metaData, function(rectangle, index) {
this.updateElement(rectangle, index, reset, numBars);
},
updateElement: function updateElement(rectangle, index, reset, numBars) {
-- var xScale = this.getScaleForId(this.getDataset().xAxisID);
-- var yScale = this.getScaleForId(this.getDataset().yAxisID);
++
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++ var yScale = this.getScaleForID(this.getDataset().yAxisID);
++
var yScalePoint;
if (yScale.min < 0 && yScale.max < 0) {
// Desired view properties
_model: {
-- x: xScale.calculateBarX(numBars, this.index, index),
-- y: reset ? yScalePoint : yScale.calculateBarY(this.index, index),
++ x: this.calculateBarX(index, this.index),
++ y: reset ? yScalePoint : this.calculateBarY(index, this.index),
// Tooltip
label: this.chart.data.labels[index],
datasetLabel: this.getDataset().label,
// Appearance
-- base: yScale.calculateBarBase(this.index, index),
-- width: xScale.calculateBarWidth(numBars),
++ base: this.calculateBarBase(this.index, index),
++ width: this.calculateBarWidth(numBars),
backgroundColor: rectangle.custom && rectangle.custom.backgroundColor ? rectangle.custom.backgroundColor : helpers.getValueAtIndexOrDefault(this.getDataset().backgroundColor, index, this.chart.options.elements.rectangle.backgroundColor),
borderColor: rectangle.custom && rectangle.custom.borderColor ? rectangle.custom.borderColor : helpers.getValueAtIndexOrDefault(this.getDataset().borderColor, index, this.chart.options.elements.rectangle.borderColor),
borderWidth: rectangle.custom && rectangle.custom.borderWidth ? rectangle.custom.borderWidth : helpers.getValueAtIndexOrDefault(this.getDataset().borderWidth, index, this.chart.options.elements.rectangle.borderWidth),
rectangle.pivot();
},
++ calculateBarBase: function(datasetIndex, index) {
++
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++ var yScale = this.getScaleForID(this.getDataset().yAxisID);
++
++ var base = 0;
++
++ if (yScale.options.stacked) {
++
++ var value = this.chart.data.datasets[datasetIndex].data[index];
++
++ if (value < 0) {
++ for (var i = 0; i < datasetIndex; i++) {
++ if (this.chart.data.datasets[i].yAxisID === yScale.id) {
++ base += this.chart.data.datasets[i].data[index] < 0 ? this.chart.data.datasets[i].data[index] : 0;
++ }
++ }
++ } else {
++ for (var j = 0; j < datasetIndex; j++) {
++ if (this.chart.data.datasets[j].yAxisID === yScale.id) {
++ base += this.chart.data.datasets[j].data[index] > 0 ? this.chart.data.datasets[j].data[index] : 0;
++ }
++ }
++ }
++
++ return yScale.getPixelForValue(base);
++ }
++
++ base = yScale.getPixelForValue(yScale.min);
++
++ if (yScale.beginAtZero || ((yScale.min <= 0 && yScale.max >= 0) || (yScale.min >= 0 && yScale.max <= 0))) {
++ base = yScale.getPixelForValue(0, 0);
++ //base += yScale.options.gridLines.lineWidth;
++ } else if (yScale.min < 0 && yScale.max < 0) {
++ // All values are negative. Use the top as the base
++ base = yScale.getPixelForValue(yScale.max);
++ }
++
++ return base;
++
++ },
++
++ getRuler: function() {
++
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++ var yScale = this.getScaleForID(this.getDataset().yAxisID);
++
++ var datasetCount = !this.chart.isCombo ? this.chart.data.datasets.length : helpers.where(this.chart.data.datasets, function(ds) {
++ return ds.type == 'bar';
++ }).length;
++ var tickWidth = (function() {
++ var min = xScale.getPixelForValue(null, 1) - xScale.getPixelForValue(null, 0);
++ for (var i = 2; i < this.getDataset().data.length; i++) {
++ min = Math.min(xScale.getPixelForValue(null, i) - xScale.getPixelForValue(null, i - 1), min);
++ }
++ return min;
++ }).call(this);
++ var categoryWidth = tickWidth * xScale.options.categoryPercentage;
++ var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2;
++ var fullBarWidth = categoryWidth / datasetCount;
++ var barWidth = fullBarWidth * xScale.options.barPercentage;
++ var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage);
++
++ return {
++ datasetCount: datasetCount,
++ tickWidth: tickWidth,
++ categoryWidth: categoryWidth,
++ categorySpacing: categorySpacing,
++ fullBarWidth: fullBarWidth,
++ barWidth: barWidth,
++ barSpacing: barSpacing,
++ };
++ },
++
++ calculateBarWidth: function() {
++
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++ var ruler = this.getRuler();
++
++ if (xScale.options.stacked) {
++ return ruler.categoryWidth;
++ }
++
++ return ruler.barWidth;
++
++ },
++
++
++ calculateBarX: function(index, datasetIndex) {
++
++ var yScale = this.getScaleForID(this.getDataset().yAxisID);
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++
++ var ruler = this.getRuler();
++ var leftTick = xScale.getPixelForValue(null, index, datasetIndex);
++ leftTick -= this.chart.isCombo ? (ruler.tickWidth / 2) : 0;
++
++ if (yScale.options.stacked) {
++ return leftTick + (ruler.categoryWidth / 2) + ruler.categorySpacing;
++ }
++
++ return leftTick +
++ (ruler.barWidth / 2) +
++ ruler.categorySpacing +
++ (ruler.barWidth * datasetIndex) +
++ (ruler.barSpacing / 2) +
++ (ruler.barSpacing * datasetIndex);
++ },
++
++ calculateBarY: function(index, datasetIndex) {
++
++ var xScale = this.getScaleForID(this.getDataset().xAxisID);
++ var yScale = this.getScaleForID(this.getDataset().yAxisID);
++
++ var value = this.getDataset().data[index];
++
++ if (yScale.options.stacked) {
++
++ var sumPos = 0,
++ sumNeg = 0;
++
++ for (var i = 0; i < datasetIndex; i++) {
++ if (this.chart.data.datasets[i].data[index] < 0) {
++ sumNeg += this.chart.data.datasets[i].data[index] || 0;
++ } else {
++ sumPos += this.chart.data.datasets[i].data[index] || 0;
++ }
++ }
++
++ if (value < 0) {
++ return yScale.getPixelForValue(sumNeg + value);
++ } else {
++ return yScale.getPixelForValue(sumPos + value);
++ }
++
++ return yScale.getPixelForValue(value);
++ }
++
++ return yScale.getPixelForValue(value);
++ },
++
draw: function(ease) {
var easingDecimal = ease || 1;
helpers.each(this.getDataset().metaData, function(rectangle, index) {
this.update(true);
},
-- update: function(reset) {
--
-- this.chart.outerRadius = (helpers.min([this.chart.chart.width, this.chart.chart.height]) / 2) - this.chart.options.elements.arc.borderWidth / 2;
-- this.chart.innerRadius = this.chart.options.cutoutPercentage ? (this.chart.outerRadius / 100) * (this.chart.options.cutoutPercentage) : 1;
-- this.chart.radiusLength = (this.chart.outerRadius - this.chart.innerRadius) / this.chart.data.datasets.length;
--
-- this.getDataset().total = 0;
-- helpers.each(this.getDataset().data, function(value) {
-- this.getDataset().total += Math.abs(value);
-- }, this);
--
-- this.outerRadius = this.chart.outerRadius - (this.chart.radiusLength * this.index);
-- this.innerRadius = this.outerRadius - this.chart.radiusLength;
--
++ buildOrUpdateElements: function buildOrUpdateElements() {
// Make sure we have metaData for each data point
var numData = this.getDataset().data.length;
var numArcs = this.getDataset().metaData.length;
this.addElementAndReset(index);
}
}
++ },
++
++ update: function update(reset) {
++
++ this.chart.outerRadius = Math.max((helpers.min([this.chart.chart.width, this.chart.chart.height]) / 2) - this.chart.options.elements.arc.borderWidth / 2, 0);
++ this.chart.innerRadius = Math.max(this.chart.options.cutoutPercentage ? (this.chart.outerRadius / 100) * (this.chart.options.cutoutPercentage) : 1, 0);
++ this.chart.radiusLength = (this.chart.outerRadius - this.chart.innerRadius) / this.chart.data.datasets.length;
++
++ this.getDataset().total = 0;
++ helpers.each(this.getDataset().data, function(value) {
++ this.getDataset().total += Math.abs(value);
++ }, this);
++
++ this.outerRadius = this.chart.outerRadius - (this.chart.radiusLength * this.index);
++ this.innerRadius = this.outerRadius - this.chart.radiusLength;
helpers.each(this.getDataset().metaData, function(arc, index) {
this.updateElement(arc, index, reset);
this.update(true);
},
-- update: function(reset) {
-- var line = this.getDataset().metaDataset;
-- var points = this.getDataset().metaData;
--
-- var yScale = this.getScaleForId(this.getDataset().yAxisID);
-- var xScale = this.getScaleForId(this.getDataset().xAxisID);
-- var scaleBase;
--
++ buildOrUpdateElements: function buildOrUpdateElements() {
// Handle the number of data points changing
var numData = this.getDataset().data.length;
var numPoints = this.getDataset().metaData.length;
// Make sure that we handle number of datapoints changing
if (numData < numPoints) {
// Remove excess bars for data points that have been removed
-- this.getDataset().metaData.splice(numData, numPoints - numData)
++ this.getDataset().metaData.splice(numData, numPoints - numData);
} else if (numData > numPoints) {
// Add new elements
for (var index = numPoints; index < numData; ++index) {
this.addElementAndReset(index);
}
}
++ },
++
++ update: function update(reset) {
++ var line = this.getDataset().metaDataset;
++ var points = this.getDataset().metaData;
++
++ var yScale = this.getScaleForId(this.getDataset().yAxisID);
++ var xScale = this.getScaleForId(this.getDataset().xAxisID);
++ var scaleBase;
if (yScale.min < 0 && yScale.max < 0) {
scaleBase = yScale.getPixelForValue(yScale.max);
// Desired view properties
_model: {
-- x: xScale.getPointPixelForValue(this.getDataset().data[index], index, this.index),
-- y: reset ? scaleBase : yScale.getPointPixelForValue(this.getDataset().data[index], index, this.index),
++ x: xScale.getPixelForValue(this.getDataset().data[index], index, this.index, this.chart.isCombo),
++ y: reset ? scaleBase : yScale.getPixelForValue(this.getDataset().data[index], index, this.index),
// Appearance
tension: point.custom && point.custom.tension ? point.custom.tension : (this.getDataset().tension || this.chart.options.elements.line.tension),
radius: point.custom && point.custom.radius ? point.custom.radius : helpers.getValueAtIndexOrDefault(this.getDataset().radius, index, this.chart.options.elements.point.radius),
this.update(true);
},
-- update: function(reset) {
++ buildOrUpdateElements: function buildOrUpdateElements() {
++ // Handle the number of data points changing
++ var numData = this.getDataset().data.length;
++ var numPoints = this.getDataset().metaData.length;
++
++ // Make sure that we handle number of datapoints changing
++ if (numData < numPoints) {
++ // Remove excess bars for data points that have been removed
++ this.getDataset().metaData.splice(numData, numPoints - numData)
++ } else if (numData > numPoints) {
++ // Add new elements
++ for (var index = numPoints; index < numData; ++index) {
++ this.addElementAndReset(index);
++ }
++ }
++ },
++
++ update: function update(reset) {
-- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
++ Chart.scaleService.update(this, this.chart.width, this.chart.height);
//this.chart.scale.setScaleSize();
this.chart.scale.calculateRange();
this.chart.scale.generateTicks();
this.chart.scale.buildYLabels();
-- this.chart.outerRadius = (helpers.min([this.chart.chart.width, this.chart.chart.height]) - this.chart.options.elements.arc.borderWidth / 2) / 2;
-- this.chart.innerRadius = this.chart.options.cutoutPercentage ? (this.chart.outerRadius / 100) * (this.chart.options.cutoutPercentage) : 1;
++ this.chart.outerRadius = Math.max((helpers.min([this.chart.chart.width, this.chart.chart.height]) - this.chart.options.elements.arc.borderWidth / 2) / 2, 0);
++ this.chart.innerRadius = Math.max(this.chart.options.cutoutPercentage ? (this.chart.outerRadius / 100) * (this.chart.options.cutoutPercentage) : 1, 0);
this.chart.radiusLength = (this.chart.outerRadius - this.chart.innerRadius) / this.chart.data.datasets.length;
this.getDataset().total = 0;
this.update(true);
},
-- update: function(reset) {
++ buildOrUpdateElements: function buildOrUpdateElements() {
++ // Handle the number of data points changing
++ var numData = this.getDataset().data.length;
++ var numPoints = this.getDataset().metaData.length;
++
++ // Make sure that we handle number of datapoints changing
++ if (numData < numPoints) {
++ // Remove excess bars for data points that have been removed
++ this.getDataset().metaData.splice(numData, numPoints - numData)
++ } else if (numData > numPoints) {
++ // Add new elements
++ for (var index = numPoints; index < numData; ++index) {
++ this.addElementAndReset(index);
++ }
++ }
++ },
++
++ update: function update(reset) {
var line = this.getDataset().metaDataset;
var points = this.getDataset().metaData;
(function() {
"use strict";
-- var root = this,
-- Chart = root.Chart,
-- helpers = Chart.helpers;
--
-- // Default config for a category scale
-- var defaultConfig = {
-- display: true,
-- position: "bottom",
--
-- // grid line settings
-- gridLines: {
-- show: true,
-- color: "rgba(0, 0, 0, 0.1)",
-- lineWidth: 1,
-- drawOnChartArea: true,
-- drawTicks: true,
-- zeroLineWidth: 1,
-- zeroLineColor: "rgba(0,0,0,0.25)",
-- offsetGridLines: false,
-- },
--
-- // label settings
-- labels: {
-- show: true,
-- maxRotation: 90,
-- template: "<%=value%>",
-- fontSize: 12,
-- fontStyle: "normal",
-- fontColor: "#666",
-- fontFamily: "Helvetica Neue",
-- },
-- };
--
-- var DatasetScale = Chart.Element.extend({
-- isHorizontal: function() {
-- return this.options.position == "top" || this.options.position == "bottom";
-- },
-- buildLabels: function(index) {
-- this.labels = [];
--
-- if (this.options.labels.userCallback) {
-- this.data.labels.forEach(function(labelString, index) {
-- this.labels.push(this.options.labels.userCallback(labelString, index));
-- }, this);
-- } else {
-- this.labels = this.data.labels;
-- }
-- },
-- getPixelForValue: function(value, index, datasetIndex, includeOffset) {
-- // This must be called after fit has been run so that
-- // this.left, this.top, this.right, and this.bottom have been defined
-- if (this.isHorizontal()) {
-- var isRotated = (this.labelRotation > 0);
-- var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
-- var valueWidth = innerWidth / Math.max((this.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
-- var valueOffset = (valueWidth * index) + this.paddingLeft;
--
-- if (this.options.gridLines.offsetGridLines && includeOffset) {
-- valueOffset += (valueWidth / 2);
-- }
--
-- return this.left + Math.round(valueOffset);
-- } else {
-- return this.top + (index * (this.height / this.labels.length));
-- }
-- },
-- getPointPixelForValue: function(value, index, datasetIndex) {
-- return this.getPixelForValue(value, index, datasetIndex, true);
-- },
--
-- // Functions needed for bar charts
-- calculateBaseWidth: function() {
-- return (this.getPixelForValue(null, 1, 0, true) - this.getPixelForValue(null, 0, 0, true)) - (2 * this.options.categorySpacing);
-- },
-- calculateBarWidth: function(barDatasetCount) {
-- //The padding between datasets is to the right of each bar, providing that there are more than 1 dataset
-- var baseWidth = this.calculateBaseWidth() - ((barDatasetCount - 1) * this.options.spacing);
--
-- if (this.options.stacked) {
-- return baseWidth;
-- }
-- return (baseWidth / barDatasetCount);
-- },
-- calculateBarX: function(barDatasetCount, datasetIndex, elementIndex) {
-- var xWidth = this.calculateBaseWidth(),
-- xAbsolute = this.getPixelForValue(null, elementIndex, datasetIndex, true) - (xWidth / 2),
-- barWidth = this.calculateBarWidth(barDatasetCount);
--
-- if (this.options.stacked) {
-- return xAbsolute + barWidth / 2;
-- }
--
-- return xAbsolute + (barWidth * datasetIndex) + (datasetIndex * this.options.spacing) + barWidth / 2;
-- },
--
-- calculateLabelRotation: function(maxHeight, margins) {
-- //Get the width of each grid by calculating the difference
-- //between x offsets between 0 and 1.
-- var labelFont = helpers.fontString(this.options.labels.fontSize, this.options.labels.fontStyle, this.options.labels.fontFamily);
-- this.ctx.font = labelFont;
--
-- var firstWidth = this.ctx.measureText(this.labels[0]).width;
-- var lastWidth = this.ctx.measureText(this.labels[this.labels.length - 1]).width;
-- var firstRotated;
-- var lastRotated;
--
-- this.paddingRight = lastWidth / 2 + 3;
-- this.paddingLeft = firstWidth / 2 + 3;
--
-- this.labelRotation = 0;
--
-- if (this.options.display) {
-- var originalLabelWidth = helpers.longestText(this.ctx, labelFont, this.labels);
-- var cosRotation;
-- var sinRotation;
-- var firstRotatedWidth;
--
-- this.labelWidth = originalLabelWidth;
--
-- //Allow 3 pixels x2 padding either side for label readability
-- // only the index matters for a dataset scale, but we want a consistent interface between scales
--
-- var datasetWidth = Math.floor(this.getPixelForValue(0, 1) - this.getPixelForValue(0, 0)) - 6;
--
-- //Max label rotation can be set or default to 90 - also act as a loop counter
-- while (this.labelWidth > datasetWidth && this.labelRotation <= this.options.labels.maxRotation) {
-- cosRotation = Math.cos(helpers.toRadians(this.labelRotation));
-- sinRotation = Math.sin(helpers.toRadians(this.labelRotation));
--
-- firstRotated = cosRotation * firstWidth;
-- lastRotated = cosRotation * lastWidth;
--
-- // We're right aligning the text now.
-- if (firstRotated + this.options.labels.fontSize / 2 > this.yLabelWidth) {
-- this.paddingLeft = firstRotated + this.options.labels.fontSize / 2;
-- }
--
-- this.paddingRight = this.options.labels.fontSize / 2;
--
-- if (sinRotation * originalLabelWidth > maxHeight) {
-- // go back one step
-- this.labelRotation--;
-- break;
-- }
--
-- this.labelRotation++;
-- this.labelWidth = cosRotation * originalLabelWidth;
--
-- }
-- } else {
-- this.labelWidth = 0;
-- this.paddingRight = 0;
-- this.paddingLeft = 0;
-- }
--
-- if (margins) {
-- this.paddingLeft -= margins.left;
-- this.paddingRight -= margins.right;
++ var root = this,
++ Chart = root.Chart,
++ helpers = Chart.helpers;
-- this.paddingLeft = Math.max(this.paddingLeft, 0);
-- this.paddingRight = Math.max(this.paddingRight, 0);
-- }
++ // Default config for a category scale
++ var defaultConfig = {
++ position: "bottom",
++ };
++ var DatasetScale = Chart.Scale.extend({
++ buildTicks: function(index) {
++ this.ticks = this.data.labels;
},
-- // Fit this axis to the given size
-- // @param {number} maxWidth : the max width the axis can be
-- // @param {number} maxHeight: the max height the axis can be
-- // @return {object} minSize : the minimum size needed to draw the axis
-- fit: function(maxWidth, maxHeight, margins) {
-- // Set the unconstrained dimension before label rotation
-- if (this.isHorizontal()) {
-- this.width = maxWidth;
-- } else {
-- this.height = maxHeight;
-- }
--
-- this.buildLabels();
-- this.calculateLabelRotation(maxHeight, margins);
-- var minSize = {
-- width: 0,
-- height: 0,
-- };
--
-- var labelFont = helpers.fontString(this.options.labels.fontSize, this.options.labels.fontStyle, this.options.labels.fontFamily);
-- var longestLabelWidth = helpers.longestText(this.ctx, labelFont, this.labels);
++ // Used to get data value locations. Value can either be an index or a numerical value
++ getPixelForValue: function(value, index, datasetIndex, includeOffset) {
-- // Width
if (this.isHorizontal()) {
-- minSize.width = maxWidth;
-- } else if (this.options.display) {
-- var labelWidth = this.options.labels.show ? longestLabelWidth + 6 : 0;
-- minSize.width = Math.min(labelWidth, maxWidth);
-- }
--
-- // Height
-- if (this.isHorizontal() && this.options.display) {
-- var labelHeight = (Math.sin(helpers.toRadians(this.labelRotation)) * longestLabelWidth) + 1.5 * this.options.labels.fontSize;
-- minSize.height = Math.min(this.options.labels.show ? labelHeight : 0, maxHeight);
-- } else if (this.options.display) {
-- minSize.height = maxHeight;
-- }
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ var valueWidth = innerWidth / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
++ var valueOffset = (valueWidth * index) + this.paddingLeft;
-- this.width = minSize.width;
-- this.height = minSize.height;
-- return minSize;
-- },
-- // Actualy draw the scale on the canvas
-- // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
-- draw: function(chartArea) {
-- if (this.options.display) {
--
-- var setContextLineSettings;
--
-- // Make sure we draw text in the correct color
-- this.ctx.fillStyle = this.options.labels.fontColor;
--
-- if (this.isHorizontal()) {
-- setContextLineSettings = true;
-- var yTickStart = this.options.position == "bottom" ? this.top : this.bottom - 10;
-- var yTickEnd = this.options.position == "bottom" ? this.top + 10 : this.bottom;
-- var isRotated = this.labelRotation !== 0;
-- var skipRatio = false;
--
-- if ((this.options.labels.fontSize + 4) * this.labels.length > (this.width - (this.paddingLeft + this.paddingRight))) {
-- skipRatio = 1 + Math.floor(((this.options.labels.fontSize + 4) * this.labels.length) / (this.width - (this.paddingLeft + this.paddingRight)));
-- }
--
-- helpers.each(this.labels, function(label, index) {
-- // Blank labels
-- if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
-- return;
-- }
-- var xLineValue = this.getPixelForValue(label, index, null, false); // xvalues for grid lines
-- var xLabelValue = this.getPixelForValue(label, index, null, true); // x values for labels (need to consider offsetLabel option)
--
-- if (this.options.gridLines.show) {
-- if (index === 0) {
-- // Draw the first index specially
-- this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
-- setContextLineSettings = true; // reset next time
-- } else if (setContextLineSettings) {
-- this.ctx.lineWidth = this.options.gridLines.lineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.color;
-- setContextLineSettings = false;
-- }
--
-- xLineValue += helpers.aliasPixel(this.ctx.lineWidth);
--
-- // Draw the label area
-- this.ctx.beginPath();
--
-- if (this.options.gridLines.drawTicks) {
-- this.ctx.moveTo(xLineValue, yTickStart);
-- this.ctx.lineTo(xLineValue, yTickEnd);
-- }
--
-- // Draw the chart area
-- if (this.options.gridLines.drawOnChartArea) {
-- this.ctx.moveTo(xLineValue, chartArea.top);
-- this.ctx.lineTo(xLineValue, chartArea.bottom);
-- }
--
-- // Need to stroke in the loop because we are potentially changing line widths & colours
-- this.ctx.stroke();
-- }
--
-- if (this.options.labels.show) {
-- this.ctx.save();
-- this.ctx.translate(xLabelValue, (isRotated) ? this.top + 12 : this.top + 8);
-- this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
-- this.ctx.font = this.font;
-- this.ctx.textAlign = (isRotated) ? "right" : "center";
-- this.ctx.textBaseline = (isRotated) ? "middle" : "top";
-- this.ctx.fillText(label, 0, 0);
-- this.ctx.restore();
-- }
-- }, this);
-- } else {
-- // Vertical
-- if (this.options.gridLines.show) {}
--
-- if (this.options.labels.show) {
-- // Draw the labels
-- }
++ if (this.options.gridLines.offsetGridLines && includeOffset) {
++ valueOffset += (valueWidth / 2);
}
++
++ return this.left + Math.round(valueOffset);
++ } else {
++ return this.top + (index * (this.height / this.labels.length));
}
-- }
++ },
});
++
Chart.scaleService.registerScaleType("category", DatasetScale, defaultConfig);
++
}).call(this);
(function() {
helpers = Chart.helpers;
var defaultConfig = {
-- display: true,
position: "left",
--
-- // grid line settings
-- gridLines: {
-- show: true,
-- color: "rgba(0, 0, 0, 0.1)",
-- lineWidth: 1,
-- drawOnChartArea: true,
-- drawTicks: true, // draw ticks extending towards the label
-- zeroLineWidth: 1,
-- zeroLineColor: "rgba(0,0,0,0.25)",
-- },
--
-- // scale numbers
-- reverse: false,
-- beginAtZero: false,
-- override: null,
--
-- // label settings
-- labels: {
-- show: true,
-- mirror: false,
-- padding: 10,
-- template: "<%=value.toLocaleString()%>",
-- fontSize: 12,
-- fontStyle: "normal",
-- fontColor: "#666",
-- fontFamily: "Helvetica Neue"
-- }
};
-- var LinearScale = Chart.Element.extend({
-- isHorizontal: function() {
-- return this.options.position == "top" || this.options.position == "bottom";
-- },
-- generateTicks: function(width, height) {
-- // We need to decide how many ticks we are going to have. Each tick draws a grid line.
-- // There are two possibilities. The first is that the user has manually overridden the scale
-- // calculations in which case the job is easy. The other case is that we have to do it ourselves
-- //
-- // We assume at this point that the scale object has been updated with the following values
-- // by the chart.
-- // min: this is the minimum value of the scale
-- // max: this is the maximum value of the scale
-- // options: contains the options for the scale. This is referenced from the user settings
-- // rather than being cloned. This ensures that updates always propogate to a redraw
--
-- // Reset the ticks array. Later on, we will draw a grid line at these positions
-- // The array simply contains the numerical value of the spots where ticks will be
-- this.ticks = [];
--
-- if (this.options.override) {
-- // The user has specified the manual override. We use <= instead of < so that
-- // we get the final line
-- for (var i = 0; i <= this.options.override.steps; ++i) {
-- var value = this.options.override.start + (i * this.options.override.stepWidth);
-- this.ticks.push(value);
-- }
-- } else {
-- // Figure out what the max number of ticks we can support it is based on the size of
-- // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
-- // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
-- // the graph
--
-- var maxTicks;
--
-- if (this.isHorizontal()) {
-- maxTicks = Math.min(11, Math.ceil(width / 50));
-- } else {
-- // The factor of 2 used to scale the font size has been experimentally determined.
-- maxTicks = Math.min(11, Math.ceil(height / (2 * this.options.labels.fontSize)));
-- }
--
-- // Make sure we always have at least 2 ticks
-- maxTicks = Math.max(2, maxTicks);
--
-- // To get a "nice" value for the tick spacing, we will use the appropriately named
-- // "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
-- // for details.
--
-- // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
-- // do nothing since that would make the chart weird. If the user really wants a weird chart
-- // axis, they can manually override it
-- if (this.options.beginAtZero) {
-- var minSign = helpers.sign(this.min);
-- var maxSign = helpers.sign(this.max);
--
-- if (minSign < 0 && maxSign < 0) {
-- // move the top up to 0
-- this.max = 0;
-- } else if (minSign > 0 && maxSign > 0) {
-- // move the botttom down to 0
-- this.min = 0;
-- }
-- }
--
-- var niceRange = helpers.niceNum(this.max - this.min, false);
-- var spacing = helpers.niceNum(niceRange / (maxTicks - 1), true);
-- var niceMin = Math.floor(this.min / spacing) * spacing;
-- var niceMax = Math.ceil(this.max / spacing) * spacing;
--
-- // Put the values into the ticks array
-- for (var j = niceMin; j <= niceMax; j += spacing) {
-- this.ticks.push(j);
-- }
-- }
--
-- if (this.options.position == "left" || this.options.position == "right") {
-- // We are in a vertical orientation. The top value is the highest. So reverse the array
-- this.ticks.reverse();
-- }
--
-- // At this point, we need to update our max and min given the tick values since we have expanded the
-- // range of the scale
-- this.max = helpers.max(this.ticks);
-- this.min = helpers.min(this.ticks);
--
-- if (this.options.reverse) {
-- this.ticks.reverse();
--
-- this.start = this.max;
-- this.end = this.min;
-- } else {
-- this.start = this.min;
-- this.end = this.max;
-- }
-- },
-- buildLabels: function() {
-- // We assume that this has been run after ticks have been generated. We try to figure out
-- // a label for each tick.
-- this.labels = [];
--
-- helpers.each(this.ticks, function(tick, index, ticks) {
-- var label;
--
-- if (this.options.labels.userCallback) {
-- // If the user provided a callback for label generation, use that as first priority
-- label = this.options.labels.userCallback(tick, index, ticks);
-- } else if (this.options.labels.template) {
-- // else fall back to the template string
-- label = helpers.template(this.options.labels.template, {
-- value: tick
-- });
-- }
--
-- this.labels.push(label ? label : ""); // empty string will not render so we're good
-- }, this);
-- },
-- // Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not
-- getRightValue: function(rawValue) {
-- return (typeof (rawValue) === "object" && rawValue !== null) ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;
-- },
-- getPixelForValue: function(value) {
-- // This must be called after fit has been run so that
-- // this.left, this.top, this.right, and this.bottom have been defined
-- var pixel;
-- var range = this.end - this.start;
--
-- if (this.isHorizontal()) {
-- var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
-- pixel = this.left + (innerWidth / range * (value - this.start));
-- pixel += this.paddingLeft;
-- } else {
-- // Bottom - top since pixels increase downard on a screen
-- var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
-- pixel = (this.bottom - this.paddingBottom) - (innerHeight / range * (value - this.start));
-- }
--
-- return pixel;
-- },
++ var LinearScale = Chart.Scale.extend({
++ buildTicks: function() {
-- // Functions needed for line charts
-- calculateRange: function() {
++ // First Calculate the range
this.min = null;
this.max = null;
this.min--;
this.max++;
}
-- },
-- getPointPixelForValue: function(rawValue, index, datasetIndex) {
-- var value = this.getRightValue(rawValue);
-- if (this.options.stacked) {
-- var offsetPos = 0;
-- var offsetNeg = 0;
++ // Then calulate the ticks
++ this.ticks = [];
-- for (var i = this.data.datasets.length - 1; i > datasetIndex; --i) {
-- if (this.data.datasets[i].data[index] < 0) {
-- offsetNeg += this.data.datasets[i].data[index];
-- } else {
-- offsetPos += this.data.datasets[i].data[index];
-- }
-- }
++ // Figure out what the max number of ticks we can support it is based on the size of
++ // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
++ // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
++ // the graph
-- if (value < 0) {
-- return this.getPixelForValue(offsetNeg + value);
-- } else {
-- return this.getPixelForValue(offsetPos + value);
-- }
++ var maxTicks;
++
++ if (this.isHorizontal()) {
++ maxTicks = Math.min(11, Math.ceil(this.width / 50));
} else {
-- return this.getPixelForValue(value);
++ // The factor of 2 used to scale the font size has been experimentally determined.
++ maxTicks = Math.min(11, Math.ceil(this.height / (2 * this.options.ticks.fontSize)));
}
-- },
--
-- // Functions needed for bar charts
-- calculateBarBase: function(datasetIndex, index) {
-- var base = 0;
--
-- if (this.options.stacked) {
-- var value = this.data.datasets[datasetIndex].data[index];
--
-- if (value < 0) {
-- for (var i = 0; i < datasetIndex; i++) {
-- if (this.data.datasets[i].yAxisID === this.id) {
-- base += this.data.datasets[i].data[index] < 0 ? this.data.datasets[i].data[index] : 0;
-- }
-- }
-- } else {
-- for (var j = 0; j < datasetIndex; j++) {
-- if (this.data.datasets[j].yAxisID === this.id) {
-- base += this.data.datasets[j].data[index] > 0 ? this.data.datasets[j].data[index] : 0;
-- }
-- }
++ // Make sure we always have at least 2 ticks
++ maxTicks = Math.max(2, maxTicks);
++
++ // To get a "nice" value for the tick spacing, we will use the appropriately named
++ // "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
++ // for details.
++
++ // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
++ // do nothing since that would make the chart weird. If the user really wants a weird chart
++ // axis, they can manually override it
++ if (this.options.beginAtZero) {
++ var minSign = helpers.sign(this.min);
++ var maxSign = helpers.sign(this.max);
++
++ if (minSign < 0 && maxSign < 0) {
++ // move the top up to 0
++ this.max = 0;
++ } else if (minSign > 0 && maxSign > 0) {
++ // move the botttom down to 0
++ this.min = 0;
}
--
-- return this.getPixelForValue(base);
}
-- base = this.getPixelForValue(this.min);
++ var niceRange = helpers.niceNum(this.max - this.min, false);
++ var spacing = helpers.niceNum(niceRange / (maxTicks - 1), true);
++ var niceMin = Math.floor(this.min / spacing) * spacing;
++ var niceMax = Math.ceil(this.max / spacing) * spacing;
-- if (this.beginAtZero || ((this.min <= 0 && this.max >= 0) || (this.min >= 0 && this.max <= 0))) {
-- base = this.getPixelForValue(0);
-- base += this.options.gridLines.lineWidth;
-- } else if (this.min < 0 && this.max < 0) {
-- // All values are negative. Use the top as the base
-- base = this.getPixelForValue(this.max);
++ // Put the values into the ticks array
++ for (var j = niceMin; j <= niceMax; j += spacing) {
++ this.ticks.push(j);
}
-- return base;
--
-- },
-- calculateBarY: function(datasetIndex, index) {
-- var value = this.data.datasets[datasetIndex].data[index];
--
-- if (this.options.stacked) {
--
-- var sumPos = 0,
-- sumNeg = 0;
++ if (this.options.position == "left" || this.options.position == "right") {
++ // We are in a vertical orientation. The top value is the highest. So reverse the array
++ this.ticks.reverse();
++ }
-- for (var i = 0; i < datasetIndex; i++) {
-- if (this.data.datasets[i].data[index] < 0) {
-- sumNeg += this.data.datasets[i].data[index] || 0;
-- } else {
-- sumPos += this.data.datasets[i].data[index] || 0;
-- }
-- }
++ // At this point, we need to update our max and min given the tick values since we have expanded the
++ // range of the scale
++ this.max = helpers.max(this.ticks);
++ this.min = helpers.min(this.ticks);
-- if (value < 0) {
-- return this.getPixelForValue(sumNeg + value);
-- } else {
-- return this.getPixelForValue(sumPos + value);
-- }
++ if (this.options.reverse) {
++ this.ticks.reverse();
-- return this.getPixelForValue(value);
++ this.start = this.max;
++ this.end = this.min;
++ } else {
++ this.start = this.max;
++ this.end = this.min;
}
-- return this.getPixelForValue(value);
++ this.zeroLineIndex = this.ticks.indexOf(0);
},
-- // Fit this axis to the given size
-- // @param {number} maxWidth : the max width the axis can be
-- // @param {number} maxHeight: the max height the axis can be
-- // @return {object} minSize : the minimum size needed to draw the axis
-- fit: function(maxWidth, maxHeight, margins) {
-- this.calculateRange();
-- this.generateTicks(maxWidth, maxHeight);
-- this.buildLabels();
-- var minSize = {
-- width: 0,
-- height: 0,
-- };
-- // In a horizontal axis, we need some room for the scale to be drawn
-- //
-- // -----------------------------------------------------
-- // | | | | |
-- //
-- // In a vertical axis, we need some room for the scale to be drawn.
-- // The actual grid lines will be drawn on the chart area, however, we need to show
-- // ticks where the axis actually is.
-- // We will allocate 25px for this width
-- // |
-- // -|
-- // |
-- // |
-- // -|
-- // |
-- // |
-- // -|
++ // Utils
++ getPixelForValue: function(value, index, datasetIndex, includeOffset) {
++ // This must be called after fit has been run so that
++ // this.left, this.top, this.right, and this.bottom have been defined
++ var pixel;
++ var range = this.end - this.start;
-- // Width
if (this.isHorizontal()) {
-- minSize.width = maxWidth; // fill all the width
-- } else {
-- minSize.width = this.options.gridLines.show && this.options.display ? 10 : 0;
-- }
-- // height
-- if (this.isHorizontal()) {
-- minSize.height = this.options.gridLines.show && this.options.display ? 10 : 0;
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ pixel = this.left + (innerWidth / range * (this.getRightValue(value) - this.start));
++ return Math.round(pixel + this.paddingLeft);
} else {
-- minSize.height = maxHeight; // fill all the height
++ var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
++ pixel = this.top + (innerHeight / range * (this.getRightValue(value) - this.start));
++ return Math.round(pixel + this.paddingTop);
}
++ },
-- this.paddingLeft = 0;
-- this.paddingRight = 0;
-- this.paddingTop = 0;
-- this.paddingBottom = 0;
++ // Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not
++ getRightValue: function(rawValue) {
++ return (typeof(rawValue) === "object" && rawValue !== null) ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;
++ },
++ });
++ Chart.scaleService.registerScaleType("linear", LinearScale, defaultConfig);
-- if (this.options.labels.show && this.options.display) {
-- // Don't bother fitting the labels if we are not showing them
-- var labelFont = helpers.fontString(this.options.labels.fontSize,
-- this.options.labels.fontStyle, this.options.labels.fontFamily);
++}).call(this);
-- if (this.isHorizontal()) {
-- // A horizontal axis is more constrained by the height.
-- var maxLabelHeight = maxHeight - minSize.height;
-- var labelHeight = 1.5 * this.options.labels.fontSize;
-- minSize.height = Math.min(maxHeight, minSize.height + labelHeight);
++(function() {
++ "use strict";
-- var labelFont = helpers.fontString(this.options.labels.fontSize, this.options.labels.fontStyle, this.options.labels.fontFamily);
-- this.ctx.font = labelFont;
++ var root = this,
++ Chart = root.Chart,
++ helpers = Chart.helpers;
-- var firstLabelWidth = this.ctx.measureText(this.labels[0]).width;
-- var lastLabelWidth = this.ctx.measureText(this.labels[this.labels.length - 1]).width;
++ var defaultConfig = {
++ position: "left",
-- // Ensure that our labels are always inside the canvas
-- this.paddingLeft = firstLabelWidth / 2;
-- this.paddingRight = lastLabelWidth / 2;
-- } else {
-- // A vertical axis is more constrained by the width. Labels are the dominant factor
-- // here, so get that length first
-- var maxLabelWidth = maxWidth - minSize.width;
-- var largestTextWidth = helpers.longestText(this.ctx, labelFont, this.labels);
++ // scale label
++ scaleLabel: {
++ // actual label
++ labelString: '',
++ // display property
++ show: false,
++ },
-- if (largestTextWidth < maxLabelWidth) {
-- // We don't need all the room
-- minSize.width += largestTextWidth;
-- minSize.width += 3; // extra padding
-- } else {
-- // Expand to max size
-- minSize.width = maxWidth;
-- }
++ // label settings
++ labels: {
++ template: "<%var remain = value / (Math.pow(10, Math.floor(Chart.helpers.log10(value))));if (remain === 1 || remain === 2 || remain === 5) {%><%=value.toExponential()%><%} else {%><%= null %><%}%>",
++ }
++ };
-- this.paddingTop = this.options.labels.fontSize / 2;
-- this.paddingBottom = this.options.labels.fontSize / 2;
-- }
-- }
++ var LogarithmicScale = Chart.Scale.extend({
++ buildTicks: function() {
-- if (margins) {
-- this.paddingLeft -= margins.left;
-- this.paddingTop -= margins.top;
-- this.paddingRight -= margins.right;
-- this.paddingBottom -= margins.bottom;
++ // Calculate Range (we may break this out into it's own lifecycle function)
-- this.paddingLeft = Math.max(this.paddingLeft, 0);
-- this.paddingTop = Math.max(this.paddingTop, 0);
-- this.paddingRight = Math.max(this.paddingRight, 0);
-- this.paddingBottom = Math.max(this.paddingBottom, 0);
-- }
++ this.min = null;
++ this.max = null;
-- this.width = minSize.width;
-- this.height = minSize.height;
-- return minSize;
-- },
-- // Actualy draw the scale on the canvas
-- // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
-- draw: function(chartArea) {
-- if (this.options.display) {
++ var values = [];
-- var setContextLineSettings;
-- var hasZero;
++ if (this.options.stacked) {
++ helpers.each(this.data.datasets, function(dataset) {
++ if (this.isHorizontal() ? dataset.xAxisID === this.id : dataset.yAxisID === this.id) {
++ helpers.each(dataset.data, function(rawValue, index) {
-- // Make sure we draw text in the correct color
-- this.ctx.fillStyle = this.options.labels.fontColor;
++ var value = this.getRightValue(rawValue);
-- if (this.isHorizontal()) {
-- if (this.options.gridLines.show) {
-- // Draw the horizontal line
-- setContextLineSettings = true;
-- hasZero = helpers.findNextWhere(this.ticks, function(tick) {
-- return tick === 0;
-- }) !== undefined;
-- var yTickStart = this.options.position == "bottom" ? this.top : this.bottom - 5;
-- var yTickEnd = this.options.position == "bottom" ? this.top + 5 : this.bottom;
--
-- helpers.each(this.ticks, function(tick, index) {
-- // Grid lines are vertical
-- var xValue = this.getPixelForValue(tick);
--
-- if (tick === 0 || (!hasZero && index === 0)) {
-- // Draw the 0 point specially or the left if there is no 0
-- this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
-- setContextLineSettings = true; // reset next time
-- } else if (setContextLineSettings) {
-- this.ctx.lineWidth = this.options.gridLines.lineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.color;
-- setContextLineSettings = false;
++ values[index] = values[index] || 0;
++
++ if (this.options.relativePoints) {
++ values[index] = 100;
++ } else {
++ // Don't need to split positive and negative since the log scale can't handle a 0 crossing
++ values[index] += value;
}
++ }, this);
++ }
++ }, this);
-- xValue += helpers.aliasPixel(this.ctx.lineWidth);
++ this.min = helpers.min(values);
++ this.max = helpers.max(values);
-- // Draw the label area
-- this.ctx.beginPath();
++ } else {
++ helpers.each(this.data.datasets, function(dataset) {
++ if (this.isHorizontal() ? dataset.xAxisID === this.id : dataset.yAxisID === this.id) {
++ helpers.each(dataset.data, function(rawValue, index) {
++ var value = this.getRightValue(rawValue);
-- if (this.options.gridLines.drawTicks) {
-- this.ctx.moveTo(xValue, yTickStart);
-- this.ctx.lineTo(xValue, yTickEnd);
++ if (this.min === null) {
++ this.min = value;
++ } else if (value < this.min) {
++ this.min = value;
}
-- // Draw the chart area
-- if (this.options.gridLines.drawOnChartArea) {
-- this.ctx.moveTo(xValue, chartArea.top);
-- this.ctx.lineTo(xValue, chartArea.bottom);
++ if (this.max === null) {
++ this.max = value;
++ } else if (value > this.max) {
++ this.max = value;
}
--
-- // Need to stroke in the loop because we are potentially changing line widths & colours
-- this.ctx.stroke();
}, this);
}
++ }, this);
++ }
-- if (this.options.labels.show) {
-- // Draw the labels
++ if (this.min === this.max) {
++ if (this.min !== 0 && this.min !== null) {
++ this.min = Math.pow(10, Math.floor(helpers.log10(this.min)) - 1);
++ this.max = Math.pow(10, Math.floor(helpers.log10(this.max)) + 1);
++ } else {
++ this.min = 1;
++ this.max = 10;
++ }
++ }
-- var labelStartY;
-- if (this.options.position == "top") {
-- labelStartY = this.bottom - 10;
-- this.ctx.textBaseline = "bottom";
-- } else {
-- // bottom side
-- labelStartY = this.top + 10;
-- this.ctx.textBaseline = "top";
-- }
++ // Reset the ticks array. Later on, we will draw a grid line at these positions
++ // The array simply contains the numerical value of the spots where ticks will be
++ this.tickValues = [];
-- this.ctx.textAlign = "center";
-- this.ctx.font = helpers.fontString(this.options.labels.fontSize, this.options.labels.fontStyle, this.options.labels.fontFamily);
++ // Figure out what the max number of ticks we can support it is based on the size of
++ // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
++ // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
++ // the graph
-- helpers.each(this.labels, function(label, index) {
-- var xValue = this.getPixelForValue(this.ticks[index]);
-- this.ctx.fillText(label, xValue, labelStartY);
-- }, this);
-- }
-- } else {
-- // Vertical
-- if (this.options.gridLines.show) {
--
-- // Draw the vertical line
-- setContextLineSettings = true;
-- hasZero = helpers.findNextWhere(this.ticks, function(tick) {
-- return tick === 0;
-- }) !== undefined;
-- var xTickStart = this.options.position == "right" ? this.left : this.right - 5;
-- var xTickEnd = this.options.position == "right" ? this.left + 5 : this.right;
--
-- helpers.each(this.ticks, function(tick, index) {
-- // Grid lines are horizontal
-- var yValue = this.getPixelForValue(tick);
--
-- if (tick === 0 || (!hasZero && index === 0)) {
-- // Draw the 0 point specially or the bottom if there is no 0
-- this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
-- setContextLineSettings = true; // reset next time
-- } else if (setContextLineSettings) {
-- this.ctx.lineWidth = this.options.gridLines.lineWidth;
-- this.ctx.strokeStyle = this.options.gridLines.color;
-- setContextLineSettings = false; // use boolean to indicate that we only want to do this once
-- }
++ var minExponent = Math.floor(helpers.log10(this.min));
++ var maxExponent = Math.ceil(helpers.log10(this.max));
-- yValue += helpers.aliasPixel(this.ctx.lineWidth);
++ for (var exponent = minExponent; exponent < maxExponent; ++exponent) {
++ for (var i = 1; i < 10; ++i) {
++ this.tickValues.push(i * Math.pow(10, exponent));
++ }
++ }
-- // Draw the label area
-- this.ctx.beginPath();
++ this.tickValues.push(1.0 * Math.pow(10, maxExponent));
-- if (this.options.gridLines.drawTicks) {
-- this.ctx.moveTo(xTickStart, yValue);
-- this.ctx.lineTo(xTickEnd, yValue);
-- }
++ if (this.options.position == "left" || this.options.position == "right") {
++ // We are in a vertical orientation. The top value is the highest. So reverse the array
++ this.tickValues.reverse();
++ }
-- // Draw the chart area
-- if (this.options.gridLines.drawOnChartArea) {
-- this.ctx.moveTo(chartArea.left, yValue);
-- this.ctx.lineTo(chartArea.right, yValue);
-- }
++ // At this point, we need to update our max and min given the tick values since we have expanded the
++ // range of the scale
++ this.max = helpers.max(this.tickValues);
++ this.min = helpers.min(this.tickValues);
-- this.ctx.stroke();
-- }, this);
-- }
++ if (this.options.reverse) {
++ this.tickValues.reverse();
++
++ this.start = this.max;
++ this.end = this.min;
++ } else {
++ this.start = this.min;
++ this.end = this.max;
++ }
-- if (this.options.labels.show) {
-- // Draw the labels
++ this.ticks = [];
-- var labelStartX;
++ helpers.each(this.tickValues, function(tick, index, ticks) {
++ var label;
-- if (this.options.position == "left") {
-- if (this.options.labels.mirror) {
-- labelStartX = this.right + this.options.labels.padding;
-- this.ctx.textAlign = "left";
-- } else {
-- labelStartX = this.right - this.options.labels.padding;
-- this.ctx.textAlign = "right";
-- }
-- } else {
-- // right side
-- if (this.options.labels.mirror) {
-- labelStartX = this.left - this.options.labels.padding;
-- this.ctx.textAlign = "right";
-- } else {
-- labelStartX = this.left + this.options.labels.padding;
-- this.ctx.textAlign = "left";
-- }
-- }
++ if (this.options.labels.userCallback) {
++ // If the user provided a callback for label generation, use that as first priority
++ label = this.options.labels.userCallback(tick, index, ticks);
++ } else if (this.options.labels.template) {
++ // else fall back to the template string
++ label = helpers.template(this.options.labels.template, {
++ value: tick
++ });
++ }
++
++ this.ticks.push(label); // empty string will not render so we're good
++ }, this);
++ },
++ // Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not
++ getRightValue: function(rawValue) {
++ return typeof rawValue === "object" ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;
++ },
++ getPixelForTick: function(index, includeOffset) {
++ return this.getPixelForValue(this.tickValues[index], null, null, includeOffset);
++ },
++ getPixelForValue: function(value, index, datasetIndex, includeOffset) {
++ var pixel;
-- this.ctx.textBaseline = "middle";
-- this.ctx.font = helpers.fontString(this.options.labels.fontSize, this.options.labels.fontStyle, this.options.labels.fontFamily);
++ var newVal = this.getRightValue(value);
++ var range = helpers.log10(this.end) - helpers.log10(this.start);
-- helpers.each(this.labels, function(label, index) {
-- var yValue = this.getPixelForValue(this.ticks[index]);
-- this.ctx.fillText(label, labelStartX, yValue);
-- }, this);
-- }
++ if (this.isHorizontal()) {
++
++ if (newVal === 0) {
++ pixel = this.left + this.paddingLeft;
++ } else {
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ pixel = this.left + (innerWidth / range * (helpers.log10(newVal) - helpers.log10(this.start)));
++ return pixel + this.paddingLeft;
++ }
++ } else {
++ // Bottom - top since pixels increase downard on a screen
++ if (newVal === 0) {
++ pixel = this.top + this.paddingTop;
++ } else {
++ var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
++ return (this.bottom - this.paddingBottom) - (innerHeight / range * (helpers.log10(newVal) - helpers.log10(this.start)));
}
}
-- }
++
++ },
++
});
-- Chart.scaleService.registerScaleType("linear", LinearScale, defaultConfig);
++ Chart.scaleService.registerScaleType("logarithmic", LogarithmicScale, defaultConfig);
}).call(this);
},
// scale numbers
++ reverse: false,
beginAtZero: true,
// label settings
helpers.each(this.data.datasets, function(dataset) {
helpers.each(dataset.data, function(value, index) {
++ if (value === null) return;
++
if (this.min === null) {
this.min = value;
} else if (value < this.min) {
return index * angleMultiplier - (Math.PI / 2);
},
getDistanceFromCenterForValue: function(value) {
++ if (value === null) return 0; // null always in center
// Take into account half font size + the yPadding of the top value
var scalingFactor = this.drawingArea / (this.max - this.min);
-- return (value - this.min) * scalingFactor;
++ if (this.options.reverse) {
++ return (this.max - value) * scalingFactor;
++ } else {
++ return (value - this.min) * scalingFactor;
++ }
},
getPointPosition: function(index, distanceFromCenter) {
var thisAngle = this.getIndexAngle(index);
if (this.options.display) {
var ctx = this.ctx;
helpers.each(this.yLabels, function(label, index) {
-- // Don't draw a centre value
-- if (index > 0) {
++ // Don't draw a centre value (if it is minimum)
++ if (index > 0 || this.options.reverse) {
var yCenterOffset = this.getDistanceFromCenterForValue(this.ticks[index]);
var yHeight = this.yCenter - yCenterOffset;
for (var i = this.getValueCount() - 1; i >= 0; i--) {
if (this.options.angleLines.show) {
-- var outerPosition = this.getPointPosition(i, this.getDistanceFromCenterForValue(this.max));
++ var outerPosition = this.getPointPosition(i, this.getDistanceFromCenterForValue(this.options.reverse ? this.min : this.max));
ctx.beginPath();
ctx.moveTo(this.xCenter, this.yCenter);
ctx.lineTo(outerPosition.x, outerPosition.y);
ctx.closePath();
}
// Extra 3px out for some label spacing
-- var pointLabelPosition = this.getPointPosition(i, this.getDistanceFromCenterForValue(this.max) + 5);
++ var pointLabelPosition = this.getPointPosition(i, this.getDistanceFromCenterForValue(this.options.reverse ? this.min : this.max) + 5);
ctx.font = helpers.fontString(this.options.pointLabels.fontSize, this.options.pointLabels.fontStyle, this.options.pointLabels.fontFamily);
ctx.fillStyle = this.options.pointLabels.fontColor;
}).call(this);
++(function() {
++ "use strict";
++
++ var root = this,
++ Chart = root.Chart,
++ helpers = Chart.helpers;
++
++ var time = {
++ units: [
++ 'millisecond',
++ 'second',
++ 'minute',
++ 'hour',
++ 'day',
++ 'week',
++ 'month',
++ 'quarter',
++ 'year',
++ ],
++ unit: {
++ 'millisecond': {
++ display: 'SSS [ms]', // 002 ms
++ maxStep: 1000,
++ },
++ 'second': {
++ display: 'h:mm:ss a', // 11:20:01 AM
++ maxStep: 60,
++ },
++ 'minute': {
++ display: 'h:mm:ss a', // 11:20:01 AM
++ maxStep: 60,
++ },
++ 'hour': {
++ display: 'MMM D, hA', // Sept 4, 5PM
++ maxStep: 24,
++ },
++ 'day': {
++ display: 'll', // Sep 4 2015
++ maxStep: 7,
++ },
++ 'week': {
++ display: 'll', // Week 46, or maybe "[W]WW - YYYY" ?
++ maxStep: 4.3333,
++ },
++ 'month': {
++ display: 'MMM YYYY', // Sept 2015
++ maxStep: 12,
++ },
++ 'quarter': {
++ display: '[Q]Q - YYYY', // Q3
++ maxStep: 4,
++ },
++ 'year': {
++ display: 'YYYY', // 2015
++ maxStep: false,
++ },
++ }
++ };
++
++ var defaultConfig = {
++ position: "bottom",
++
++ time: {
++ format: false, // false == date objects or use pattern string from http://momentjs.com/docs/#/parsing/string-format/
++ unit: false, // false == automatic or override with week, month, year, etc.
++ round: false, // none, or override with week, month, year, etc.
++ displayFormat: false, // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/
++ },
++ };
++
++ var TimeScale = Chart.Scale.extend({
++ buildTicks: function(index) {
++
++ this.ticks = [];
++ this.labelMoments = [];
++
++ // Parse each label into a moment
++ this.data.labels.forEach(function(label, index) {
++ var labelMoment = this.parseTime(label);
++ if (this.options.time.round) {
++ labelMoment.startOf(this.options.time.round);
++ }
++ this.labelMoments.push(labelMoment);
++ }, this);
++
++ // Find the first and last moments, and range
++ this.firstTick = moment.min.call(this, this.labelMoments).clone();
++ this.lastTick = moment.max.call(this, this.labelMoments).clone();
++
++ // Set unit override if applicable
++ if (this.options.time.unit) {
++ this.tickUnit = this.options.time.unit || 'day';
++ this.displayFormat = time.unit.day.display;
++ this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, this.tickUnit, true));
++ } else {
++ // Determine the smallest needed unit of the time
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ var labelCapacity = innerWidth / this.options.ticks.fontSize + 4;
++ var buffer = this.options.time.round ? 0 : 2;
++
++ this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, true) + buffer);
++ var done;
++
++ helpers.each(time.units, function(format) {
++ if (this.tickRange <= labelCapacity) {
++ return;
++ }
++ this.tickUnit = format;
++ this.tickRange = Math.ceil(this.lastTick.diff(this.firstTick, this.tickUnit) + buffer);
++ this.displayFormat = time.unit[format].display;
++
++ }, this);
++ }
++
++ this.firstTick.startOf(this.tickUnit);
++ this.lastTick.endOf(this.tickUnit);
++ this.smallestLabelSeparation = this.width;
++
++ var i = 0;
++
++ for (i = 1; i < this.labelMoments.length; i++) {
++ this.smallestLabelSeparation = Math.min(this.smallestLabelSeparation, this.labelMoments[i].diff(this.labelMoments[i - 1], this.tickUnit, true));
++ }
++
++
++ // Tick displayFormat override
++ if (this.options.time.displayFormat) {
++ this.displayFormat = this.options.time.displayFormat;
++ }
++
++ // For every unit in between the first and last moment, create a moment and add it to the ticks tick
++ if (this.options.ticks.userCallback) {
++ for (i = 0; i <= this.tickRange; i++) {
++ this.ticks.push(
++ this.options.ticks.userCallback(this.firstTick.clone()
++ .add(i, this.tickUnit)
++ .format(this.options.time.displayFormat ? this.options.time.displayFormat : time.unit[this.tickUnit].display)
++ )
++ );
++ }
++ } else {
++ for (i = 0; i <= this.tickRange; i++) {
++ this.ticks.push(this.firstTick.clone()
++ .add(i, this.tickUnit)
++ .format(this.options.time.displayFormat ? this.options.time.displayFormat : time.unit[this.tickUnit].display)
++ );
++ }
++ }
++ },
++ getPixelForValue: function(value, index, datasetIndex, includeOffset) {
++
++ var offset = this.labelMoments[index].diff(this.firstTick, this.tickUnit, true);
++
++ var decimal = offset / this.tickRange;
++
++ if (this.isHorizontal()) {
++ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
++ var valueWidth = innerWidth / Math.max(this.ticks.length - 1, 1);
++ var valueOffset = (innerWidth * decimal) + this.paddingLeft;
++
++ return this.left + Math.round(valueOffset);
++ } else {
++ return this.top + (decimal * (this.height / this.ticks.length));
++ }
++ },
++ parseTime: function(label) {
++ // Date objects
++ if (typeof label.getMonth === 'function' || typeof label == 'number') {
++ return moment(label);
++ }
++ // Moment support
++ if (label.isValid && label.isValid()) {
++ return label;
++ }
++ // Custom parsing (return an instance of moment)
++ if (typeof this.options.time.format !== 'string' && this.options.time.format.call) {
++ return this.options.time.format(label);
++ }
++ // Moment format parsing
++ return moment(label, this.options.time.format);
++ },
++ });
++ Chart.scaleService.registerScaleType("time", TimeScale, defaultConfig);
++
++}).call(this);
++
/*!
* Chart.js
* http://chartjs.org/
} else {
inRange = (mouseX >= vm.x - vm.width / 2 && mouseX <= vm.x + vm.width / 2) && (mouseY >= vm.base && mouseY <= vm.y);
}
-- }
++ }
return inRange;
},
config.type = 'bar';
return new Chart(context, config);
-- }
--
++ };
++
}).call(this);
(function() {
var helpers = Chart.helpers;
var defaultConfig = {
++ aspectRatio: 1,
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style=\"background-color:<%=data.datasets[0].backgroundColor[i]%>\"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>",
};
var helpers = Chart.helpers;
var defaultConfig = {
++ aspectRatio: 1,
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style=\"background-color:<%=data.datasets[0].backgroundColor[i]%>\"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>",
};
var Chart = root.Chart;
var helpers = Chart.helpers;
++ var defaultConfig = {
++ aspectRatio: 1,
++ };
++
Chart.Radar = function(context, config) {
++ config.options = helpers.configMerge(defaultConfig, config.options);
config.type = 'radar';
return new Chart(context, config);
}
}).call(this);
--!function e(r,t,n){function a(i,u){if(!t[i]){if(!r[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(s)return s(i,!0);var h=new Error("Cannot find module '"+i+"'");throw h.code="MODULE_NOT_FOUND",h}var o=t[i]={exports:{}};r[i][0].call(o.exports,function(e){var t=r[i][1][e];return a(t?t:e)},o,o.exports,e,r,t,n)}return t[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,r,t){!function(){var t=e("color-convert"),n=e("color-string"),a=function(e){if(e instanceof a)return e;if(!(this instanceof a))return new a(e);if(this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},"string"==typeof e){var r=n.getRgba(e);if(r)this.setValues("rgb",r);else if(r=n.getHsla(e))this.setValues("hsl",r);else{if(!(r=n.getHwb(e)))throw new Error('Unable to parse color from string "'+e+'"');this.setValues("hwb",r)}}else if("object"==typeof e){var r=e;if(void 0!==r.r||void 0!==r.red)this.setValues("rgb",r);else if(void 0!==r.l||void 0!==r.lightness)this.setValues("hsl",r);else if(void 0!==r.v||void 0!==r.value)this.setValues("hsv",r);else if(void 0!==r.w||void 0!==r.whiteness)this.setValues("hwb",r);else{if(void 0===r.c&&void 0===r.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(e));this.setValues("cmyk",r)}}};a.prototype={rgb:function(e){return this.setSpace("rgb",arguments)},hsl:function(e){return this.setSpace("hsl",arguments)},hsv:function(e){return this.setSpace("hsv",arguments)},hwb:function(e){return this.setSpace("hwb",arguments)},cmyk:function(e){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return 1!==this.values.alpha?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values.rgb;return e.concat([this.values.alpha])},hslaArray:function(){var e=this.values.hsl;return e.concat([this.values.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return n.hexString(this.values.rgb)},rgbString:function(){return n.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return n.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return n.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return n.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return n.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return n.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return n.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var e=this.values.rgb,r=[],t=0;t<e.length;t++){var n=e[t]/255;r[t]=.03928>=n?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7.1?"AAA":r>=4.5?"AA":""},dark:function(){var e=this.values.rgb,r=(299*e[0]+587*e[1]+114*e[2])/1e3;return 128>r},light:function(){return!this.dark()},negate:function(){for(var e=[],r=0;3>r;r++)e[r]=255-this.values.rgb[r];return this.setValues("rgb",e),this},lighten:function(e){return this.values.hsl[2]+=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},darken:function(e){return this.values.hsl[2]-=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},saturate:function(e){return this.values.hsl[1]+=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},desaturate:function(e){return this.values.hsl[1]-=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},whiten:function(e){return this.values.hwb[1]+=this.values.hwb[1]*e,this.setValues("hwb",this.values.hwb),this},blacken:function(e){return this.values.hwb[2]+=this.values.hwb[2]*e,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var e=this.values.rgb,r=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[r,r,r]),this},clearer:function(e){return this.setValues("alpha",this.values.alpha-this.values.alpha*e),this},opaquer:function(e){return this.setValues("alpha",this.values.alpha+this.values.alpha*e),this},rotate:function(e){var r=this.values.hsl[0];return r=(r+e)%360,r=0>r?360+r:r,this.values.hsl[0]=r,this.setValues("hsl",this.values.hsl),this},mix:function(e,r){r=1-(null==r?.5:r);for(var t=2*r-1,n=this.alpha()-e.alpha(),a=((t*n==-1?t:(t+n)/(1+t*n))+1)/2,s=1-a,i=this.rgbArray(),u=e.rgbArray(),l=0;l<i.length;l++)i[l]=i[l]*a+u[l]*s;this.setValues("rgb",i);var h=this.alpha()*r+e.alpha()*(1-r);return this.setValues("alpha",h),this},toJSON:function(){return this.rgb()},clone:function(){return new a(this.rgb())}},a.prototype.getValues=function(e){for(var r={},t=0;t<e.length;t++)r[e.charAt(t)]=this.values[e][t];return 1!=this.values.alpha&&(r.a=this.values.alpha),r},a.prototype.setValues=function(e,r){var n={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},a={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},s=1;if("alpha"==e)s=r;else if(r.length)this.values[e]=r.slice(0,e.length),s=r[e.length];else if(void 0!==r[e.charAt(0)]){for(var i=0;i<e.length;i++)this.values[e][i]=r[e.charAt(i)];s=r.a}else if(void 0!==r[n[e][0]]){for(var u=n[e],i=0;i<e.length;i++)this.values[e][i]=r[u[i]];s=r.alpha}if(this.values.alpha=Math.max(0,Math.min(1,void 0!==s?s:this.values.alpha)),"alpha"!=e){for(var i=0;i<e.length;i++){var l=Math.max(0,Math.min(a[e][i],this.values[e][i]));this.values[e][i]=Math.round(l)}for(var h in n){h!=e&&(this.values[h]=t[e][h](this.values[e]));for(var i=0;i<h.length;i++){var l=Math.max(0,Math.min(a[h][i],this.values[h][i]));this.values[h][i]=Math.round(l)}}return!0}},a.prototype.setSpace=function(e,r){var t=r[0];return void 0===t?this.getValues(e):("number"==typeof t&&(t=Array.prototype.slice.call(r)),this.setValues(e,t),this)},a.prototype.setChannel=function(e,r,t){return void 0===t?this.values[e][r]:(this.values[e][r]=t,this.setValues(e,this.values[e]),this)},window.Color=r.exports=a}()},{"color-convert":3,"color-string":4}],2:[function(e,t,n){function a(e){var r,t,n,a=e[0]/255,s=e[1]/255,i=e[2]/255,u=Math.min(a,s,i),l=Math.max(a,s,i),h=l-u;return l==u?r=0:a==l?r=(s-i)/h:s==l?r=2+(i-a)/h:i==l&&(r=4+(a-s)/h),r=Math.min(60*r,360),0>r&&(r+=360),n=(u+l)/2,t=l==u?0:.5>=n?h/(l+u):h/(2-l-u),[r,100*t,100*n]}function s(e){var r,t,n,a=e[0],s=e[1],i=e[2],u=Math.min(a,s,i),l=Math.max(a,s,i),h=l-u;return t=0==l?0:h/l*1e3/10,l==u?r=0:a==l?r=(s-i)/h:s==l?r=2+(i-a)/h:i==l&&(r=4+(a-s)/h),r=Math.min(60*r,360),0>r&&(r+=360),n=l/255*1e3/10,[r,t,n]}function i(e){var r=e[0],t=e[1],n=e[2],s=a(e)[0],i=1/255*Math.min(r,Math.min(t,n)),n=1-1/255*Math.max(r,Math.max(t,n));return[s,100*i,100*n]}function u(e){var r,t,n,a,s=e[0]/255,i=e[1]/255,u=e[2]/255;return a=Math.min(1-s,1-i,1-u),r=(1-s-a)/(1-a)||0,t=(1-i-a)/(1-a)||0,n=(1-u-a)/(1-a)||0,[100*r,100*t,100*n,100*a]}function l(e){return X[JSON.stringify(e)]}function h(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var a=.4124*r+.3576*t+.1805*n,s=.2126*r+.7152*t+.0722*n,i=.0193*r+.1192*t+.9505*n;return[100*a,100*s,100*i]}function o(e){var r,t,n,a=h(e),s=a[0],i=a[1],u=a[2];return s/=95.047,i/=100,u/=108.883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,r=116*i-16,t=500*(s-i),n=200*(i-u),[r,t,n]}function c(e){return J(o(e))}function v(e){var r,t,n,a,s,i=e[0]/360,u=e[1]/100,l=e[2]/100;if(0==u)return s=255*l,[s,s,s];t=.5>l?l*(1+u):l+u-l*u,r=2*l-t,a=[0,0,0];for(var h=0;3>h;h++)n=i+1/3*-(h-1),0>n&&n++,n>1&&n--,s=1>6*n?r+6*(t-r)*n:1>2*n?t:2>3*n?r+(t-r)*(2/3-n)*6:r,a[h]=255*s;return a}function f(e){var r,t,n=e[0],a=e[1]/100,s=e[2]/100;return s*=2,a*=1>=s?s:2-s,t=(s+a)/2,r=2*a/(s+a),[n,100*r,100*t]}function d(e){return i(v(e))}function p(e){return u(v(e))}function m(e){return l(v(e))}function y(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,a=Math.floor(r)%6,s=r-Math.floor(r),i=255*n*(1-t),u=255*n*(1-t*s),l=255*n*(1-t*(1-s)),n=255*n;switch(a){case 0:return[n,l,i];case 1:return[u,n,i];case 2:return[i,n,l];case 3:return[i,u,n];case 4:return[l,i,n];case 5:return[n,i,u]}}function w(e){var r,t,n=e[0],a=e[1]/100,s=e[2]/100;return t=(2-a)*s,r=a*s,r/=1>=t?t:2-t,r=r||0,t/=2,[n,100*r,100*t]}function k(e){return i(y(e))}function M(e){return u(y(e))}function S(e){return l(y(e))}function x(e){var t,n,a,s,i=e[0]/360,u=e[1]/100,l=e[2]/100,h=u+l;switch(h>1&&(u/=h,l/=h),t=Math.floor(6*i),n=1-l,a=6*i-t,0!=(1&t)&&(a=1-a),s=u+a*(n-u),t){default:case 6:case 0:r=n,g=s,b=u;break;case 1:r=s,g=n,b=u;break;case 2:r=u,g=n,b=s;break;case 3:r=u,g=s,b=n;break;case 4:r=s,g=u,b=n;break;case 5:r=n,g=u,b=s}return[255*r,255*g,255*b]}function V(e){return a(x(e))}function q(e){return s(x(e))}function A(e){return u(x(e))}function C(e){return l(x(e))}function F(e){var r,t,n,a=e[0]/100,s=e[1]/100,i=e[2]/100,u=e[3]/100;return r=1-Math.min(1,a*(1-u)+u),t=1-Math.min(1,s*(1-u)+u),n=1-Math.min(1,i*(1-u)+u),[255*r,255*t,255*n]}function N(e){return a(F(e))}function z(e){return s(F(e))}function I(e){return i(F(e))}function O(e){return l(F(e))}function E(e){var r,t,n,a=e[0]/100,s=e[1]/100,i=e[2]/100;return r=3.2406*a+-1.5372*s+i*-.4986,t=a*-.9689+1.8758*s+.0415*i,n=.0557*a+s*-.204+1.057*i,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=12.92*r,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:t=12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n=12.92*n,r=Math.min(Math.max(0,r),1),t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),[255*r,255*t,255*n]}function H(e){var r,t,n,a=e[0],s=e[1],i=e[2];return a/=95.047,s/=100,i/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=116*s-16,t=500*(a-s),n=200*(s-i),[r,t,n]}function U(e){return J(H(e))}function j(e){var r,t,n,a,s=e[0],i=e[1],u=e[2];return 8>=s?(t=100*s/903.3,a=7.787*(t/100)+16/116):(t=100*Math.pow((s+16)/116,3),a=Math.pow(t/100,1/3)),r=.008856>=r/95.047?r=95.047*(i/500+a-16/116)/7.787:95.047*Math.pow(i/500+a,3),n=.008859>=n/108.883?n=108.883*(a-u/200-16/116)/7.787:108.883*Math.pow(a-u/200,3),[r,t,n]}function J(e){var r,t,n,a=e[0],s=e[1],i=e[2];return r=Math.atan2(i,s),t=360*r/2/Math.PI,0>t&&(t+=360),n=Math.sqrt(s*s+i*i),[a,n,t]}function R(e){return E(j(e))}function $(e){var r,t,n,a=e[0],s=e[1],i=e[2];return n=i/360*2*Math.PI,r=s*Math.cos(n),t=s*Math.sin(n),[a,r,t]}function D(e){return j($(e))}function P(e){return R($(e))}function _(e){return W[e]}function L(e){return a(_(e))}function T(e){return s(_(e))}function B(e){return i(_(e))}function G(e){return u(_(e))}function K(e){return o(_(e))}function Q(e){return h(_(e))}t.exports={rgb2hsl:a,rgb2hsv:s,rgb2hwb:i,rgb2cmyk:u,rgb2keyword:l,rgb2xyz:h,rgb2lab:o,rgb2lch:c,hsl2rgb:v,hsl2hsv:f,hsl2hwb:d,hsl2cmyk:p,hsl2keyword:m,hsv2rgb:y,hsv2hsl:w,hsv2hwb:k,hsv2cmyk:M,hsv2keyword:S,hwb2rgb:x,hwb2hsl:V,hwb2hsv:q,hwb2cmyk:A,hwb2keyword:C,cmyk2rgb:F,cmyk2hsl:N,cmyk2hsv:z,cmyk2hwb:I,cmyk2keyword:O,keyword2rgb:_,keyword2hsl:L,keyword2hsv:T,keyword2hwb:B,keyword2cmyk:G,keyword2lab:K,keyword2xyz:Q,xyz2rgb:E,xyz2lab:H,xyz2lch:U,lab2xyz:j,lab2rgb:R,lab2lch:J,lch2lab:$,lch2xyz:D,lch2rgb:P};var W={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},X={};for(var Y in W)X[JSON.stringify(W[Y])]=Y},{}],3:[function(e,r,t){var n=e("./conversions"),a=function(){return new h};for(var s in n){a[s+"Raw"]=function(e){return function(r){return"number"==typeof r&&(r=Array.prototype.slice.call(arguments)),n[e](r)}}(s);var i=/(\w+)2(\w+)/.exec(s),u=i[1],l=i[2];a[u]=a[u]||{},a[u][l]=a[s]=function(e){return function(r){"number"==typeof r&&(r=Array.prototype.slice.call(arguments));var t=n[e](r);if("string"==typeof t||void 0===t)return t;for(var a=0;a<t.length;a++)t[a]=Math.round(t[a]);return t}}(s)}var h=function(){this.convs={}};h.prototype.routeSpace=function(e,r){var t=r[0];return void 0===t?this.getValues(e):("number"==typeof t&&(t=Array.prototype.slice.call(r)),this.setValues(e,t))},h.prototype.setValues=function(e,r){return this.space=e,this.convs={},this.convs[e]=r,this},h.prototype.getValues=function(e){var r=this.convs[e];if(!r){var t=this.space,n=this.convs[t];r=a[t][e](n),this.convs[e]=r}return r},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(e){h.prototype[e]=function(r){return this.routeSpace(e,arguments)}}),r.exports=a},{"./conversions":2}],4:[function(e,r,t){function n(e){if(e){var r=/^#([a-fA-F0-9]{3})$/,t=/^#([a-fA-F0-9]{6})$/,n=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,s=/(\w+)/,i=[0,0,0],u=1,l=e.match(r);if(l){l=l[1];for(var h=0;h<i.length;h++)i[h]=parseInt(l[h]+l[h],16)}else if(l=e.match(t)){l=l[1];for(var h=0;h<i.length;h++)i[h]=parseInt(l.slice(2*h,2*h+2),16)}else if(l=e.match(n)){for(var h=0;h<i.length;h++)i[h]=parseInt(l[h+1]);u=parseFloat(l[4])}else if(l=e.match(a)){for(var h=0;h<i.length;h++)i[h]=Math.round(2.55*parseFloat(l[h+1]));u=parseFloat(l[4])}else if(l=e.match(s)){if("transparent"==l[1])return[0,0,0,0];if(i=w[l[1]],!i)return}for(var h=0;h<i.length;h++)i[h]=m(i[h],0,255);return u=u||0==u?m(u,0,1):1,i[3]=u,i}}function a(e){if(e){var r=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,t=e.match(r);if(t){var n=parseFloat(t[4]),a=m(parseInt(t[1]),0,360),s=m(parseFloat(t[2]),0,100),i=m(parseFloat(t[3]),0,100),u=m(isNaN(n)?1:n,0,1);return[a,s,i,u]}}}function s(e){if(e){var r=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,t=e.match(r);if(t){var n=parseFloat(t[4]),a=m(parseInt(t[1]),0,360),s=m(parseFloat(t[2]),0,100),i=m(parseFloat(t[3]),0,100),u=m(isNaN(n)?1:n,0,1);return[a,s,i,u]}}}function i(e){var r=n(e);return r&&r.slice(0,3)}function u(e){var r=a(e);return r&&r.slice(0,3)}function l(e){var r=n(e);return r?r[3]:(r=a(e))?r[3]:(r=s(e))?r[3]:void 0}function h(e){return"#"+y(e[0])+y(e[1])+y(e[2])}function o(e,r){return 1>r||e[3]&&e[3]<1?c(e,r):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function c(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+r+")"}function g(e,r){if(1>r||e[3]&&e[3]<1)return v(e,r);var t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgb("+t+"%, "+n+"%, "+a+"%)"}function v(e,r){var t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgba("+t+"%, "+n+"%, "+a+"%, "+(r||e[3]||1)+")"}function f(e,r){return 1>r||e[3]&&e[3]<1?d(e,r):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function d(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+r+")"}function b(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==r&&1!==r?", "+r:"")+")"}function p(e){return k[e.slice(0,3)]}function m(e,r,t){return Math.min(Math.max(r,e),t)}function y(e){var r=e.toString(16).toUpperCase();return r.length<2?"0"+r:r}var w=e("color-name");r.exports={getRgba:n,getHsla:a,getRgb:i,getHsl:u,getHwb:s,getAlpha:l,hexString:h,rgbString:o,rgbaString:c,percentString:g,percentaString:v,hslString:f,hslaString:d,hwbString:b,keyword:p};var k={};for(var M in w)k[w[M]]=M},{"color-name":5}],5:[function(e,r,t){r.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}]},{},[1]);
++!function e(r,t,n){function a(i,u){if(!t[i]){if(!r[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(s)return s(i,!0);var h=new Error("Cannot find module '"+i+"'");throw h.code="MODULE_NOT_FOUND",h}var o=t[i]={exports:{}};r[i][0].call(o.exports,function(e){var t=r[i][1][e];return a(t?t:e)},o,o.exports,e,r,t,n)}return t[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,r,t){!function(){var t=e("color-convert"),n=e("color-string"),a=function(e){if(e instanceof a)return e;if(!(this instanceof a))return new a(e);if(this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},"string"==typeof e){var r=n.getRgba(e);if(r)this.setValues("rgb",r);else if(r=n.getHsla(e))this.setValues("hsl",r);else{if(!(r=n.getHwb(e)))throw new Error('Unable to parse color from string "'+e+'"');this.setValues("hwb",r)}}else if("object"==typeof e){var r=e;if(void 0!==r.r||void 0!==r.red)this.setValues("rgb",r);else if(void 0!==r.l||void 0!==r.lightness)this.setValues("hsl",r);else if(void 0!==r.v||void 0!==r.value)this.setValues("hsv",r);else if(void 0!==r.w||void 0!==r.whiteness)this.setValues("hwb",r);else{if(void 0===r.c&&void 0===r.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(e));this.setValues("cmyk",r)}}};a.prototype={rgb:function(e){return this.setSpace("rgb",arguments)},hsl:function(e){return this.setSpace("hsl",arguments)},hsv:function(e){return this.setSpace("hsv",arguments)},hwb:function(e){return this.setSpace("hwb",arguments)},cmyk:function(e){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return 1!==this.values.alpha?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values.rgb;return e.concat([this.values.alpha])},hslaArray:function(){var e=this.values.hsl;return e.concat([this.values.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return n.hexString(this.values.rgb)},rgbString:function(){return n.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return n.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return n.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return n.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return n.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return n.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return n.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var e=this.values.rgb,r=[],t=0;t<e.length;t++){var n=e[t]/255;r[t]=.03928>=n?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7.1?"AAA":r>=4.5?"AA":""},dark:function(){var e=this.values.rgb,r=(299*e[0]+587*e[1]+114*e[2])/1e3;return 128>r},light:function(){return!this.dark()},negate:function(){for(var e=[],r=0;3>r;r++)e[r]=255-this.values.rgb[r];return this.setValues("rgb",e),this},lighten:function(e){return this.values.hsl[2]+=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},darken:function(e){return this.values.hsl[2]-=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},saturate:function(e){return this.values.hsl[1]+=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},desaturate:function(e){return this.values.hsl[1]-=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},whiten:function(e){return this.values.hwb[1]+=this.values.hwb[1]*e,this.setValues("hwb",this.values.hwb),this},blacken:function(e){return this.values.hwb[2]+=this.values.hwb[2]*e,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var e=this.values.rgb,r=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[r,r,r]),this},clearer:function(e){return this.setValues("alpha",this.values.alpha-this.values.alpha*e),this},opaquer:function(e){return this.setValues("alpha",this.values.alpha+this.values.alpha*e),this},rotate:function(e){var r=this.values.hsl[0];return r=(r+e)%360,r=0>r?360+r:r,this.values.hsl[0]=r,this.setValues("hsl",this.values.hsl),this},mix:function(e,r){r=1-(null==r?.5:r);for(var t=2*r-1,n=this.alpha()-e.alpha(),a=((t*n==-1?t:(t+n)/(1+t*n))+1)/2,s=1-a,i=this.rgbArray(),u=e.rgbArray(),l=0;l<i.length;l++)i[l]=i[l]*a+u[l]*s;this.setValues("rgb",i);var h=this.alpha()*r+e.alpha()*(1-r);return this.setValues("alpha",h),this},toJSON:function(){return this.rgb()},clone:function(){return new a(this.rgb())}},a.prototype.getValues=function(e){for(var r={},t=0;t<e.length;t++)r[e.charAt(t)]=this.values[e][t];return 1!=this.values.alpha&&(r.a=this.values.alpha),r},a.prototype.setValues=function(e,r){var n={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},a={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},s=1;if("alpha"==e)s=r;else if(r.length)this.values[e]=r.slice(0,e.length),s=r[e.length];else if(void 0!==r[e.charAt(0)]){for(var i=0;i<e.length;i++)this.values[e][i]=r[e.charAt(i)];s=r.a}else if(void 0!==r[n[e][0]]){for(var u=n[e],i=0;i<e.length;i++)this.values[e][i]=r[u[i]];s=r.alpha}if(this.values.alpha=Math.max(0,Math.min(1,void 0!==s?s:this.values.alpha)),"alpha"!=e){for(var i=0;i<e.length;i++){var l=Math.max(0,Math.min(a[e][i],this.values[e][i]));this.values[e][i]=Math.round(l)}for(var h in n){h!=e&&(this.values[h]=t[e][h](this.values[e]));for(var i=0;i<h.length;i++){var l=Math.max(0,Math.min(a[h][i],this.values[h][i]));this.values[h][i]=Math.round(l)}}return!0}},a.prototype.setSpace=function(e,r){var t=r[0];return void 0===t?this.getValues(e):("number"==typeof t&&(t=Array.prototype.slice.call(r)),this.setValues(e,t),this)},a.prototype.setChannel=function(e,r,t){return void 0===t?this.values[e][r]:(this.values[e][r]=t,this.setValues(e,this.values[e]),this)},window.Color=r.exports=a}()},{"color-convert":3,"color-string":4}],2:[function(e,t,n){function a(e){var r,t,n,a=e[0]/255,s=e[1]/255,i=e[2]/255,u=Math.min(a,s,i),l=Math.max(a,s,i),h=l-u;return l==u?r=0:a==l?r=(s-i)/h:s==l?r=2+(i-a)/h:i==l&&(r=4+(a-s)/h),r=Math.min(60*r,360),0>r&&(r+=360),n=(u+l)/2,t=l==u?0:.5>=n?h/(l+u):h/(2-l-u),[r,100*t,100*n]}function s(e){var r,t,n,a=e[0],s=e[1],i=e[2],u=Math.min(a,s,i),l=Math.max(a,s,i),h=l-u;return t=0==l?0:h/l*1e3/10,l==u?r=0:a==l?r=(s-i)/h:s==l?r=2+(i-a)/h:i==l&&(r=4+(a-s)/h),r=Math.min(60*r,360),0>r&&(r+=360),n=l/255*1e3/10,[r,t,n]}function i(e){var r=e[0],t=e[1],n=e[2],s=a(e)[0],i=1/255*Math.min(r,Math.min(t,n)),n=1-1/255*Math.max(r,Math.max(t,n));return[s,100*i,100*n]}function u(e){var r,t,n,a,s=e[0]/255,i=e[1]/255,u=e[2]/255;return a=Math.min(1-s,1-i,1-u),r=(1-s-a)/(1-a)||0,t=(1-i-a)/(1-a)||0,n=(1-u-a)/(1-a)||0,[100*r,100*t,100*n,100*a]}function l(e){return X[JSON.stringify(e)]}function h(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var a=.4124*r+.3576*t+.1805*n,s=.2126*r+.7152*t+.0722*n,i=.0193*r+.1192*t+.9505*n;return[100*a,100*s,100*i]}function o(e){var r,t,n,a=h(e),s=a[0],i=a[1],u=a[2];return s/=95.047,i/=100,u/=108.883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,r=116*i-16,t=500*(s-i),n=200*(i-u),[r,t,n]}function c(e){return J(o(e))}function v(e){var r,t,n,a,s,i=e[0]/360,u=e[1]/100,l=e[2]/100;if(0==u)return s=255*l,[s,s,s];t=.5>l?l*(1+u):l+u-l*u,r=2*l-t,a=[0,0,0];for(var h=0;3>h;h++)n=i+1/3*-(h-1),0>n&&n++,n>1&&n--,s=1>6*n?r+6*(t-r)*n:1>2*n?t:2>3*n?r+(t-r)*(2/3-n)*6:r,a[h]=255*s;return a}function f(e){var r,t,n=e[0],a=e[1]/100,s=e[2]/100;return s*=2,a*=1>=s?s:2-s,t=(s+a)/2,r=2*a/(s+a),[n,100*r,100*t]}function d(e){return i(v(e))}function p(e){return u(v(e))}function m(e){return l(v(e))}function y(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,a=Math.floor(r)%6,s=r-Math.floor(r),i=255*n*(1-t),u=255*n*(1-t*s),l=255*n*(1-t*(1-s)),n=255*n;switch(a){case 0:return[n,l,i];case 1:return[u,n,i];case 2:return[i,n,l];case 3:return[i,u,n];case 4:return[l,i,n];case 5:return[n,i,u]}}function w(e){var r,t,n=e[0],a=e[1]/100,s=e[2]/100;return t=(2-a)*s,r=a*s,r/=1>=t?t:2-t,r=r||0,t/=2,[n,100*r,100*t]}function k(e){return i(y(e))}function M(e){return u(y(e))}function S(e){return l(y(e))}function x(e){var t,n,a,s,i=e[0]/360,u=e[1]/100,l=e[2]/100,h=u+l;switch(h>1&&(u/=h,l/=h),t=Math.floor(6*i),n=1-l,a=6*i-t,0!=(1&t)&&(a=1-a),s=u+a*(n-u),t){default:case 6:case 0:r=n,g=s,b=u;break;case 1:r=s,g=n,b=u;break;case 2:r=u,g=n,b=s;break;case 3:r=u,g=s,b=n;break;case 4:r=s,g=u,b=n;break;case 5:r=n,g=u,b=s}return[255*r,255*g,255*b]}function V(e){return a(x(e))}function q(e){return s(x(e))}function A(e){return u(x(e))}function C(e){return l(x(e))}function F(e){var r,t,n,a=e[0]/100,s=e[1]/100,i=e[2]/100,u=e[3]/100;return r=1-Math.min(1,a*(1-u)+u),t=1-Math.min(1,s*(1-u)+u),n=1-Math.min(1,i*(1-u)+u),[255*r,255*t,255*n]}function N(e){return a(F(e))}function z(e){return s(F(e))}function I(e){return i(F(e))}function O(e){return l(F(e))}function E(e){var r,t,n,a=e[0]/100,s=e[1]/100,i=e[2]/100;return r=3.2406*a+-1.5372*s+i*-.4986,t=a*-.9689+1.8758*s+.0415*i,n=.0557*a+s*-.204+1.057*i,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=12.92*r,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:t=12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n=12.92*n,r=Math.min(Math.max(0,r),1),t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),[255*r,255*t,255*n]}function H(e){var r,t,n,a=e[0],s=e[1],i=e[2];return a/=95.047,s/=100,i/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=116*s-16,t=500*(a-s),n=200*(s-i),[r,t,n]}function U(e){return J(H(e))}function j(e){var r,t,n,a,s=e[0],i=e[1],u=e[2];return 8>=s?(t=100*s/903.3,a=7.787*(t/100)+16/116):(t=100*Math.pow((s+16)/116,3),a=Math.pow(t/100,1/3)),r=.008856>=r/95.047?r=95.047*(i/500+a-16/116)/7.787:95.047*Math.pow(i/500+a,3),n=.008859>=n/108.883?n=108.883*(a-u/200-16/116)/7.787:108.883*Math.pow(a-u/200,3),[r,t,n]}function J(e){var r,t,n,a=e[0],s=e[1],i=e[2];return r=Math.atan2(i,s),t=360*r/2/Math.PI,0>t&&(t+=360),n=Math.sqrt(s*s+i*i),[a,n,t]}function R(e){return E(j(e))}function $(e){var r,t,n,a=e[0],s=e[1],i=e[2];return n=i/360*2*Math.PI,r=s*Math.cos(n),t=s*Math.sin(n),[a,r,t]}function D(e){return j($(e))}function P(e){return R($(e))}function _(e){return W[e]}function L(e){return a(_(e))}function T(e){return s(_(e))}function B(e){return i(_(e))}function G(e){return u(_(e))}function K(e){return o(_(e))}function Q(e){return h(_(e))}t.exports={rgb2hsl:a,rgb2hsv:s,rgb2hwb:i,rgb2cmyk:u,rgb2keyword:l,rgb2xyz:h,rgb2lab:o,rgb2lch:c,hsl2rgb:v,hsl2hsv:f,hsl2hwb:d,hsl2cmyk:p,hsl2keyword:m,hsv2rgb:y,hsv2hsl:w,hsv2hwb:k,hsv2cmyk:M,hsv2keyword:S,hwb2rgb:x,hwb2hsl:V,hwb2hsv:q,hwb2cmyk:A,hwb2keyword:C,cmyk2rgb:F,cmyk2hsl:N,cmyk2hsv:z,cmyk2hwb:I,cmyk2keyword:O,keyword2rgb:_,keyword2hsl:L,keyword2hsv:T,keyword2hwb:B,keyword2cmyk:G,keyword2lab:K,keyword2xyz:Q,xyz2rgb:E,xyz2lab:H,xyz2lch:U,lab2xyz:j,lab2rgb:R,lab2lch:J,lch2lab:$,lch2xyz:D,lch2rgb:P};var W={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},X={};for(var Y in W)X[JSON.stringify(W[Y])]=Y},{}],3:[function(e,r,t){var n=e("./conversions"),a=function(){return new h};for(var s in n){a[s+"Raw"]=function(e){return function(r){return"number"==typeof r&&(r=Array.prototype.slice.call(arguments)),n[e](r)}}(s);var i=/(\w+)2(\w+)/.exec(s),u=i[1],l=i[2];a[u]=a[u]||{},a[u][l]=a[s]=function(e){return function(r){"number"==typeof r&&(r=Array.prototype.slice.call(arguments));var t=n[e](r);if("string"==typeof t||void 0===t)return t;for(var a=0;a<t.length;a++)t[a]=Math.round(t[a]);return t}}(s)}var h=function(){this.convs={}};h.prototype.routeSpace=function(e,r){var t=r[0];return void 0===t?this.getValues(e):("number"==typeof t&&(t=Array.prototype.slice.call(r)),this.setValues(e,t))},h.prototype.setValues=function(e,r){return this.space=e,this.convs={},this.convs[e]=r,this},h.prototype.getValues=function(e){var r=this.convs[e];if(!r){var t=this.space,n=this.convs[t];r=a[t][e](n),this.convs[e]=r}return r},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(e){h.prototype[e]=function(r){return this.routeSpace(e,arguments)}}),r.exports=a},{"./conversions":2}],4:[function(e,r,t){function n(e){if(e){var r=/^#([a-fA-F0-9]{3})$/,t=/^#([a-fA-F0-9]{6})$/,n=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,s=/(\w+)/,i=[0,0,0],u=1,l=e.match(r);if(l){l=l[1];for(var h=0;h<i.length;h++)i[h]=parseInt(l[h]+l[h],16)}else if(l=e.match(t)){l=l[1];for(var h=0;h<i.length;h++)i[h]=parseInt(l.slice(2*h,2*h+2),16)}else if(l=e.match(n)){for(var h=0;h<i.length;h++)i[h]=parseInt(l[h+1]);u=parseFloat(l[4])}else if(l=e.match(a)){for(var h=0;h<i.length;h++)i[h]=Math.round(2.55*parseFloat(l[h+1]));u=parseFloat(l[4])}else if(l=e.match(s)){if("transparent"==l[1])return[0,0,0,0];if(i=w[l[1]],!i)return}for(var h=0;h<i.length;h++)i[h]=m(i[h],0,255);return u=u||0==u?m(u,0,1):1,i[3]=u,i}}function a(e){if(e){var r=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,t=e.match(r);if(t){var n=parseFloat(t[4]),a=m(parseInt(t[1]),0,360),s=m(parseFloat(t[2]),0,100),i=m(parseFloat(t[3]),0,100),u=m(isNaN(n)?1:n,0,1);return[a,s,i,u]}}}function s(e){if(e){var r=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,t=e.match(r);if(t){var n=parseFloat(t[4]),a=m(parseInt(t[1]),0,360),s=m(parseFloat(t[2]),0,100),i=m(parseFloat(t[3]),0,100),u=m(isNaN(n)?1:n,0,1);return[a,s,i,u]}}}function i(e){var r=n(e);return r&&r.slice(0,3)}function u(e){var r=a(e);return r&&r.slice(0,3)}function l(e){var r=n(e);return r?r[3]:(r=a(e))?r[3]:(r=s(e))?r[3]:void 0}function h(e){return"#"+y(e[0])+y(e[1])+y(e[2])}function o(e,r){return 1>r||e[3]&&e[3]<1?c(e,r):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function c(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+r+")"}function g(e,r){if(1>r||e[3]&&e[3]<1)return v(e,r);var t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgb("+t+"%, "+n+"%, "+a+"%)"}function v(e,r){var t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgba("+t+"%, "+n+"%, "+a+"%, "+(r||e[3]||1)+")"}function f(e,r){return 1>r||e[3]&&e[3]<1?d(e,r):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function d(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+r+")"}function b(e,r){return void 0===r&&(r=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==r&&1!==r?", "+r:"")+")"}function p(e){return k[e.slice(0,3)]}function m(e,r,t){return Math.min(Math.max(r,e),t)}function y(e){var r=e.toString(16).toUpperCase();return r.length<2?"0"+r:r}var w=e("color-name");r.exports={getRgba:n,getHsla:a,getRgb:i,getHsl:u,getHwb:s,getAlpha:l,hexString:h,rgbString:o,rgbaString:c,percentString:g,percentaString:v,hslString:f,hslaString:d,hwbString:b,keyword:p};var k={};for(var M in w)k[w[M]]=M},{"color-name":5}],5:[function(e,r,t){r.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}]},{},[1]);
++//! moment.js
++//! version : 2.10.6
++//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
++//! license : MIT
++//! momentjs.com
++!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Hc.apply(null,arguments)}function b(a){Hc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ca(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!(isNaN(a._d.getTime())||!(b.overflow<0)||b.empty||b.invalidMonth||b.invalidWeekday||b.nullInput||b.invalidFormat||b.userInvalidated),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=j(b)),"undefined"!=typeof b._locale&&(a._locale=b._locale),Jc.length>0)for(c in Jc)d=Jc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Kc===!1&&(Kc=!0,a.updateOffset(this),Kc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f<a.length;){for(e=t(a[f]).split("-"),b=e.length,c=t(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Lc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ic._abbr,require("./locale/"+a),w(b)}catch(c){}return Lc[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Ic=c)),Ic._abbr}function x(a,b){return null!==b?(b.abbr=a,Lc[a]=Lc[a]||new s,Lc[a].set(b),w(a),Lc[a]):(delete Lc[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ic;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Mc[c]=Mc[c+"s"]=Mc[b]=a}function A(a){return"string"==typeof a?Mc[a]||Mc[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Qc[a]=e),b&&(Qc[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Qc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Nc);for(b=0,c=d.length;c>b;b++)Qc[d[b]]?d[b]=Qc[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Pc[b]=Pc[b]||J(b),Pc[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Oc.lastIndex=0;d>=0&&Oc.test(a);)a=a.replace(Oc,c),Oc.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){dd[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(dd,a)?dd[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;c<a.length;c++)ed[a[c]]=d}function R(a,b){Q(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function S(a,b,c){null!=b&&f(ed,a)&&ed[a](b,c._a,c,a)}function T(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function U(a){return this._months[a.month()]}function V(a){return this._monthsShort[a.month()]}function W(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[gd]<0||c[gd]>11?gd:c[hd]<1||c[hd]>T(c[fd],c[gd])?hd:c[id]<0||c[id]>24||24===c[id]&&(0!==c[jd]||0!==c[kd]||0!==c[ld])?id:c[jd]<0||c[jd]>59?jd:c[kd]<0||c[kd]>59?kd:c[ld]<0||c[ld]>999?ld:-1,j(a)._overflowDayOfYear&&(fd>b||b>hd)&&(b=hd),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){od[a]||(_(b),od[a]=!0)}function ca(a){var b,c,d=a._i,e=pd.exec(d);if(e){for(j(a).iso=!0,b=0,c=qd.length;c>b;b++)if(qd[b][1].exec(d)){a._f=qd[b][0];break}for(b=0,c=rd.length;c>b;b++)if(rd[b][1].exec(d)){a._f+=(e[6]||" ")+rd[b][0];break}d.match(ad)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=sd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[hd]&&null==a._a[gd]&&ua(a),a._dayOfYear&&(e=ra(a._a[fd],d[fd]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[gd]=c.getUTCMonth(),a._a[hd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[id]&&0===a._a[jd]&&0===a._a[kd]&&0===a._a[ld]&&(a._nextDay=!0,a._a[id]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[id]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[fd],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[fd],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[fd]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Nc)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(O(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Qc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[id]<=12&&b._a[id]>0&&(j(b).bigHour=void 0),b._a[id]=wa(b._locale,b._a[id],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=m({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],va(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function Fa(){var a=[].slice.call(arguments,0);return Ea("isBefore",a)}function Ga(){var a=[].slice.call(arguments,0);return Ea("isAfter",a)}function Ha(a){var b=B(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=y(),this._bubble()}function Ia(a){return a instanceof Ha}function Ja(a,b){H(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(ad)||[],c=b[b.length-1]||[],d=(c+"").match(xd)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=yd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[hd])*c,h:q(h[id])*c,m:q(h[jd])*c,s:q(h[kd])*c,ms:q(h[ld])*c}):(h=zd.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)<c)}function gb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function hb(a,b){var c;return b=A(b||"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this===+a):(c=+Da(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))}function ib(a,b,c){var d,e,f=La(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=A(b),"year"===b||"month"===b||"quarter"===b?(e=jb(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:p(e)}function jb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():K(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):K(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function mb(b){var c=K(this,b||a.defaultFormat);return this.localeData().postformat(c)}function nb(a,b){return this.isValid()?Ya({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ob(a){return this.from(Da(),a)}function pb(a,b){return this.isValid()?Ya({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function qb(a){return this.to(Da(),a)}function rb(a){var b;return void 0===a?this._locale._abbr:(b=y(a),null!=b&&(this._locale=b),this)}function sb(){return this._locale}function tb(a){switch(a=A(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function ub(a){return a=A(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function vb(){return+this._d-6e4*(this._offset||0)}function wb(){return Math.floor(+this/1e3)}function xb(){return this._offset?new Date(+this):this._d}function yb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function zb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Ab(){return k(this)}function Bb(){return g({},j(this))}function Cb(){return j(this).overflow}function Db(a,b){H(0,[a,a.length],0,b)}function Eb(a,b,c){return ja(Da([a,11,31+b-c]),b,c).week}function Fb(a){var b=ja(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")}function Gb(a){var b=ja(this,1,4).year;return null==a?b:this.add(a-b,"y")}function Hb(){return Eb(this.year(),1,4)}function Ib(){var a=this.localeData()._week;return Eb(this.year(),a.dow,a.doy)}function Jb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Kb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Lb(a){return this._weekdays[a.day()]}function Mb(a){return this._weekdaysShort[a.day()]}function Nb(a){return this._weekdaysMin[a.day()]}function Ob(a){var b,c,d;for(this._weekdaysParse=this._weekdaysParse||[],b=0;7>b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[ld]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=Wd(this._milliseconds),this._days=Wd(this._days),this._months=Wd(this._months),a.milliseconds=Wd(a.milliseconds),a.seconds=Wd(a.seconds),a.minutes=Wd(a.minutes),a.hours=Wd(a.hours),a.months=Wd(a.months),a.years=Wd(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=ke(d.as("s")),f=ke(d.as("m")),g=ke(d.as("h")),h=ke(d.as("d")),i=ke(d.as("M")),j=ke(d.as("y")),k=e<le.s&&["s",e]||1===f&&["m"]||f<le.m&&["mm",f]||1===g&&["h"]||g<le.h&&["hh",g]||1===h&&["d"]||h<le.d&&["dd",h]||1===i&&["M"]||i<le.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===le[a]?!1:void 0===b?le[a]:(le[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=me(this._milliseconds)/1e3,e=me(this._days),f=me(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Hc,Ic,Jc=a.momentProperties=[],Kc=!1,Lc={},Mc={},Nc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pc={},Qc={},Rc=/\d/,Sc=/\d\d/,Tc=/\d{3}/,Uc=/\d{4}/,Vc=/[+-]?\d{6}/,Wc=/\d\d?/,Xc=/\d{1,3}/,Yc=/\d{1,4}/,Zc=/[+-]?\d{1,6}/,$c=/\d+/,_c=/[+-]?\d+/,ad=/Z|[+-]\d\d:?\d\d/gi,bd=/[+-]?\d+(\.\d{1,3})?/,cd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dd={},ed={},fd=0,gd=1,hd=2,id=3,jd=4,kd=5,ld=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",Wc),N("MM",Wc,Sc),N("MMM",cd),N("MMMM",cd),Q(["M","MM"],function(a,b){b[gd]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[gd]=e:j(c).invalidMonth=a});var md="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),nd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),od={};a.suppressDeprecationWarnings=!1;var pd=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],rd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",_c),N("YY",Wc,Sc),N("YYYY",Yc,Uc),N("YYYYY",Zc,Vc),N("YYYYYY",Zc,Vc),Q(["YYYYY","YYYYYY"],fd),Q("YYYY",function(b,c){c[fd]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[fd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var td=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",Wc),N("ww",Wc,Sc),N("W",Wc),N("WW",Wc,Sc),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ud={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",Xc),N("DDDD",Tc),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var vd=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),wd=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",ad),N("ZZ",ad),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var xd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var yd=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,zd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Ad=ab(1,"add"),Bd=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cd=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",_c),N("g",_c),N("GG",Wc,Sc),N("gg",Wc,Sc),N("GGGG",Yc,Uc),N("gggg",Yc,Uc),N("GGGGG",Zc,Vc),N("ggggg",Zc,Vc),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Rc),Q("Q",function(a,b){b[gd]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",Wc),N("DD",Wc,Sc),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],hd),Q("Do",function(a,b){b[hd]=q(a.match(Wc)[0],10)});var Dd=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",Wc),N("e",Wc),N("E",Wc),N("dd",cd),N("ddd",cd),N("dddd",cd),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Ed="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",Wc),N("h",Wc),N("HH",Wc,Sc),N("hh",Wc,Sc),Q(["H","HH"],id),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[id]=q(a),j(c).bigHour=!0});var Hd=/[ap]\.?m?\.?/i,Id=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",Wc),N("mm",Wc,Sc),Q(["m","mm"],jd);var Jd=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",Wc),N("ss",Wc,Sc),Q(["s","ss"],kd);var Kd=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",Xc,Rc),N("SS",Xc,Sc),N("SSS",Xc,Tc);var Ld;for(Ld="SSSS";Ld.length<=9;Ld+="S")N(Ld,$c);for(Ld="S";Ld.length<=9;Ld+="S")Q(Ld,Wb);var Md=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Nd=n.prototype;Nd.add=Ad,Nd.calendar=cb,Nd.clone=db,Nd.diff=ib,Nd.endOf=ub,Nd.format=mb,Nd.from=nb,Nd.fromNow=ob,Nd.to=pb,Nd.toNow=qb,Nd.get=F,Nd.invalidAt=Cb,Nd.isAfter=eb,Nd.isBefore=fb,Nd.isBetween=gb,Nd.isSame=hb,Nd.isValid=Ab,Nd.lang=Cd,Nd.locale=rb,Nd.localeData=sb,Nd.max=wd,Nd.min=vd,Nd.parsingFlags=Bb,Nd.set=F,Nd.startOf=tb,Nd.subtract=Bd,Nd.toArray=yb,Nd.toObject=zb,Nd.toDate=xb,Nd.toISOString=lb,Nd.toJSON=lb,Nd.toString=kb,Nd.unix=wb,Nd.valueOf=vb,Nd.year=td,Nd.isLeapYear=ia,Nd.weekYear=Fb,Nd.isoWeekYear=Gb,Nd.quarter=Nd.quarters=Jb,Nd.month=Y,Nd.daysInMonth=Z,Nd.week=Nd.weeks=na,Nd.isoWeek=Nd.isoWeeks=oa,Nd.weeksInYear=Ib,Nd.isoWeeksInYear=Hb,Nd.date=Dd,Nd.day=Nd.days=Pb,Nd.weekday=Qb,Nd.isoWeekday=Rb,Nd.dayOfYear=qa,Nd.hour=Nd.hours=Id,Nd.minute=Nd.minutes=Jd,Nd.second=Nd.seconds=Kd,
++Nd.millisecond=Nd.milliseconds=Md,Nd.utcOffset=Na,Nd.utc=Pa,Nd.local=Qa,Nd.parseZone=Ra,Nd.hasAlignedHourOffset=Sa,Nd.isDST=Ta,Nd.isDSTShifted=Ua,Nd.isLocal=Va,Nd.isUtcOffset=Wa,Nd.isUtc=Xa,Nd.isUTC=Xa,Nd.zoneAbbr=Xb,Nd.zoneName=Yb,Nd.dates=aa("dates accessor is deprecated. Use date instead.",Dd),Nd.months=aa("months accessor is deprecated. Use month instead",Y),Nd.years=aa("years accessor is deprecated. Use year instead",td),Nd.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Od=Nd,Pd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Qd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Rd="Invalid date",Sd="%d",Td=/\d{1,2}/,Ud={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"},Vd=s.prototype;Vd._calendar=Pd,Vd.calendar=_b,Vd._longDateFormat=Qd,Vd.longDateFormat=ac,Vd._invalidDate=Rd,Vd.invalidDate=bc,Vd._ordinal=Sd,Vd.ordinal=cc,Vd._ordinalParse=Td,Vd.preparse=dc,Vd.postformat=dc,Vd._relativeTime=Ud,Vd.relativeTime=ec,Vd.pastFuture=fc,Vd.set=gc,Vd.months=U,Vd._months=md,Vd.monthsShort=V,Vd._monthsShort=nd,Vd.monthsParse=W,Vd.week=ka,Vd._week=ud,Vd.firstDayOfYear=ma,Vd.firstDayOfWeek=la,Vd.weekdays=Lb,Vd._weekdays=Ed,Vd.weekdaysMin=Nb,Vd._weekdaysMin=Gd,Vd.weekdaysShort=Mb,Vd._weekdaysShort=Fd,Vd.weekdaysParse=Ob,Vd.isPM=Ub,Vd._meridiemParse=Hd,Vd.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var Wd=Math.abs,Xd=yc("ms"),Yd=yc("s"),Zd=yc("m"),$d=yc("h"),_d=yc("d"),ae=yc("w"),be=yc("M"),ce=yc("y"),de=Ac("milliseconds"),ee=Ac("seconds"),fe=Ac("minutes"),ge=Ac("hours"),he=Ac("days"),ie=Ac("months"),je=Ac("years"),ke=Math.round,le={s:45,m:45,h:22,d:26,M:11},me=Math.abs,ne=Ha.prototype;ne.abs=oc,ne.add=qc,ne.subtract=rc,ne.as=wc,ne.asMilliseconds=Xd,ne.asSeconds=Yd,ne.asMinutes=Zd,ne.asHours=$d,ne.asDays=_d,ne.asWeeks=ae,ne.asMonths=be,ne.asYears=ce,ne.valueOf=xc,ne._bubble=tc,ne.get=zc,ne.milliseconds=de,ne.seconds=ee,ne.minutes=fe,ne.hours=ge,ne.days=he,ne.weeks=Bc,ne.months=ie,ne.years=je,ne.humanize=Fc,ne.toISOString=Gc,ne.toString=Gc,ne.toJSON=Gc,ne.locale=rb,ne.localeData=sb,ne.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),ne.lang=Cd,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",_c),N("X",bd),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),a.version="2.10.6",b(Da),a.fn=Od,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var oe=a;return oe});
* Released under the MIT license
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/
--(function(){"use strict";var t=this,e=t.Chart,i=function(t,e){this.config=e,t.length&&t[0].getContext&&(t=t[0]),t.getContext&&(t=t.getContext("2d")),this.canvas=t.canvas,this.ctx=t;var a=function(t,e){return t["offset"+e]?t["offset"+e]:document.defaultView.getComputedStyle(t).getPropertyValue(e)},s=this.width=a(t.canvas,"Width")||t.canvas.width,o=this.height=a(t.canvas,"Height")||t.canvas.height;return t.canvas.width=s,t.canvas.height=o,s=this.width=t.canvas.width,o=this.height=t.canvas.height,this.aspectRatio=this.width/this.height,i.helpers.retinaScale(this),e?(this.controller=new i.Controller(this),this.controller):this};i.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove","touchend"],hover:{onHover:null,mode:"single",animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",elements:{},legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets.length; i++){%><li><span style="background-color:<%=data.datasets[i].backgroundColor%>"><%if(data.datasets[i].label){%><%=data.datasets[i].label%><%}%></span></li><%}%></ul>'}},"undefined"!=typeof amd?define(function(){return i}):"object"==typeof module&&module.exports&&(module.exports=i),t.Chart=i,i.noConflict=function(){return t.Chart=e,i}}).call(this),function(){"use strict";{var t=this,e=(t.Chart,Chart.helpers={}),i=e.each=function(t,e,i,a){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var o;if(a)for(o=t.length-1;o>=0;o--)e.apply(i,[t[o],o].concat(s));else for(o=0;o<t.length;o++)e.apply(i,[t[o],o].concat(s))}else for(var n in t)e.apply(i,[t[n],n].concat(s))},a=e.clone=function(t){var s={};return i(t,function(i,o){t.hasOwnProperty(o)&&(s[o]=e.isArray(i)?i.slice(0):"object"==typeof i&&null!==i?a(i):i)}),s},s=e.extend=function(t){return i(Array.prototype.slice.call(arguments,1),function(e){i(e,function(i,a){e.hasOwnProperty(a)&&(t[a]=i)})}),t},o=(e.configMerge=function(t){var i=a(t);return e.each(Array.prototype.slice.call(arguments,1),function(t){e.each(t,function(a,s){if(t.hasOwnProperty(s))if("scales"===s)i[s]=e.scaleMerge(i.hasOwnProperty(s)?i[s]:{},a);else if("scale"===s)i[s]=e.configMerge(i.hasOwnProperty(s)?i[s]:{},Chart.scaleService.getScaleDefaults(a.type),a);else if(i.hasOwnProperty(s)&&e.isArray(i[s])&&e.isArray(a)){var o=i[s];e.each(a,function(t,i){i<o.length?o[i]="object"==typeof o[i]&&null!==o[i]&&"object"==typeof t&&null!==t?e.configMerge(o[i],t):t:o.push(t)})}else i[s]=i.hasOwnProperty(s)&&"object"==typeof i[s]&&null!==i[s]&&"object"==typeof a?e.configMerge(i[s],a):a})}),i},e.scaleMerge=function(t,i){var s=a(t);return e.each(i,function(t,a){i.hasOwnProperty(a)&&("xAxes"===a||"yAxes"===a?s.hasOwnProperty(a)?e.each(t,function(t,i){i>=s[a].length||!s[a][i].type?s[a].push(e.configMerge(t.type?Chart.scaleService.getScaleDefaults(t.type):{},t)):s[a][i]=t.type!==s[a][i].type?e.configMerge(s[a][i],t.type?Chart.scaleService.getScaleDefaults(t.type):{},t):e.configMerge(s[a][i],t)}):(s[a]=[],e.each(t,function(t){s[a].push(e.configMerge(t.type?Chart.scaleService.getScaleDefaults(t.type):{},t))})):s[a]=s.hasOwnProperty(a)&&"object"==typeof s[a]&&null!==s[a]&&"object"==typeof t?e.configMerge(s[a],t):t)}),s},e.getValueAtIndexOrDefault=function(t,i,a){return void 0===t||null===t?a:e.isArray(t)?i<t.length?t[i]:a:t},e.indexOf=function(t,e){if(Array.prototype.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},e.where=function(t,i){var a=[];return e.each(t,function(t){i(t)&&a.push(t)}),a},e.findNextWhere=function(t,e,i){(void 0===i||null===i)&&(i=-1);for(var a=i+1;a<t.length;a++){var s=t[a];if(e(s))return s}},e.findPreviousWhere=function(t,e,i){(void 0===i||null===i)&&(i=t.length);for(var a=i-1;a>=0;a--){var s=t[a];if(e(s))return s}},e.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=i};return a.prototype=e.prototype,i.prototype=new a,i.extend=o,t&&s(i.prototype,t),i.__super__=e.prototype,i}),n=e.noop=function(){},r=(e.uid=function(){var t=0;return function(){return"chart-"+t++}}(),e.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},e.amd="function"==typeof define&&define.amd,e.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)}),h=(e.max=function(t){return Math.max.apply(Math,t)},e.min=function(t){return Math.min.apply(Math,t)},e.sign=function(t){return Math.sign?Math.sign(t):(t=+t,0===t||isNaN(t)?t:t>0?1:-1)},e.log10=function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10},e.getDecimalPlaces=function(t){if(t%1!==0&&r(t)){var e=t.toString();if(e.indexOf("e-")<0)return e.split(".")[1].length;if(e.indexOf(".")<0)return parseInt(e.split("e-")[1]);var i=e.split(".")[1].split("e-");return i[0].length+parseInt(i[1])}return 0},e.toRadians=function(t){return t*(Math.PI/180)},e.toDegrees=function(t){return t*(180/Math.PI)},e.getAngleFromPoint=function(t,e){var i=e.x-t.x,a=e.y-t.y,s=Math.sqrt(i*i+a*a),o=Math.atan2(a,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:s}},e.aliasPixel=function(t){return t%2===0?0:.5},e.splineCurve=function(t,e,i,a){var s=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),o=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2)),n=a*s/(s+o),r=a*o/(s+o);return{previous:{x:e.x-n*(i.x-t.x),y:e.y-n*(i.y-t.y)},next:{x:e.x+r*(i.x-t.x),y:e.y+r*(i.y-t.y)}}},e.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},e.previousItem=function(t,e,i){return i?0>=e?t[t.length-1]:t[e-1]:0>=e?t[0]:t[e-1]},e.niceNum=function(t,i){var a,s=Math.floor(e.log10(t)),o=t/Math.pow(10,s);return a=i?1.5>o?1:3>o?2:7>o?5:10:1>=o?1:2>=o?2:5>=o?5:10,a*Math.pow(10,s)},{}),l=(e.template=function(t,e){function i(t,e){var i;return h.hasOwnProperty(t)?i=h[t]:(i=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"),h[t]=i),e?i(e):i}return t instanceof Function?t(e):i(t,e)},e.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),-(a*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i)))},easeOutElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin(2*(1*t-e)*Math.PI/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.3*1.5),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),1>t?-.5*a*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i):a*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*t*t*(((e*=1.525)+1)*t-e):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-l.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*l.easeInBounce(2*t):.5*l.easeOutBounce(2*t-1)+.5}}),c=(e.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),e.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),e.getRelativePosition=function(t){var e,i,a=t.originalEvent||t,s=t.currentTarget||t.srcElement,o=s.getBoundingClientRect();return a.touches?(e=a.touches[0].clientX-o.left,i=a.touches[0].clientY-o.top):(e=a.clientX-o.left,i=a.clientY-o.top),{x:e,y:i}},e.addEvent=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}),u=e.removeEvent=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=n},d=(e.bindEvents=function(t,e,a){t.events||(t.events={}),i(e,function(e){t.events[e]=function(){a.apply(t,arguments)},c(t.chart.canvas,e,t.events[e])})},e.unbindEvents=function(t,e){i(e,function(e,i){u(t.chart.canvas,i,e)})},e.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(d(e,"padding-left"))+parseInt(d(e,"padding-right"));return e.clientWidth-i},e.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(d(e,"padding-bottom"))+parseInt(d(e,"padding-top"));return e.clientHeight-i},e.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)});e.getMaximumSize=e.getMaximumWidth,e.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,a=t.canvas.height;window.devicePixelRatio&&(e.canvas.style.width=i+"px",e.canvas.style.height=a+"px",e.canvas.height=a*window.devicePixelRatio,e.canvas.width=i*window.devicePixelRatio,e.scale(window.devicePixelRatio,window.devicePixelRatio))},e.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},e.fontString=function(t,e,i){return e+" "+t+"px "+i},e.longestText=function(t,e,a){t.font=e;var s=0;return i(a,function(e){var i=t.measureText(e).width;s=i>s?i:s}),s},e.drawRoundedRectangle=function(t,e,i,a,s,o){t.beginPath(),t.moveTo(e+o,i),t.lineTo(e+a-o,i),t.quadraticCurveTo(e+a,i,e+a,i+o),t.lineTo(e+a,i+s-o),t.quadraticCurveTo(e+a,i+s,e+a-o,i+s),t.lineTo(e+o,i+s),t.quadraticCurveTo(e,i+s,e,i+s-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath()},e.color=function(t){return window.Color?window.Color(t):(console.log("Color.js not found!"),t)},e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(arg)}}}.call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers);Chart.elements={},Chart.Element=function(t){e.extend(this,t),this.initialize.apply(this,arguments)},e.extend(Chart.Element.prototype,{initialize:function(){},pivot:function(){return this._view||(this._view=e.clone(this._model)),this._start=e.clone(this._view),this},transition:function(t){return this._view||(this._view=e.clone(this._model)),this._start||this.pivot(),e.each(this._model,function(i,a){if("_"!==a[0]&&this._model.hasOwnProperty(a))if(this._view[a])if(this._model[a]===this._view[a]);else if("string"==typeof i)try{var s=e.color(this._start[a]).mix(e.color(this._model[a]),t);this._view[a]=s.rgbString()}catch(o){this._view[a]=i}else if("number"==typeof i){var n=void 0!==this._start[a]?this._start[a]:0;this._view[a]=(this._model[a]-n)*t+n}else this._view[a]=i;else this._view[a]="number"==typeof i?i*t:i||null;else;},this),1===t&&delete this._start,this},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return e.isNumber(this._model.x)&&e.isNumber(this._model.y)}}),Chart.Element.extend=e.inherits}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:function(){},onComplete:function(){}},e.Animation=e.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),e.animationService={frameDuration:17,animations:[],dropFrames:0,addAnimation:function(t,e,a,s){s||(t.animating=!0);for(var o=0;o<this.animations.length;++o)if(this.animations[o].chartInstance===t)return void(this.animations[o].animationObject=e);this.animations.push({chartInstance:t,animationObject:e}),1==this.animations.length&&i.requestAnimFrame.call(window,this.digestWrapper)},cancelAnimation:function(t){var e=i.findNextWhere(this.animations,function(e){return e.chartInstance===t});e&&(this.animations.splice(e,1),t.animating=!1)},digestWrapper:function(){e.animationService.startDigest.call(e.animationService)},startDigest:function(){var t=Date.now(),e=0;this.dropFrames>1&&(e=Math.floor(this.dropFrames),this.dropFrames=this.dropFrames%1);for(var a=0;a<this.animations.length;a++)null===this.animations[a].animationObject.currentStep&&(this.animations[a].animationObject.currentStep=0),this.animations[a].animationObject.currentStep+=1+e,this.animations[a].animationObject.currentStep>this.animations[a].animationObject.numSteps&&(this.animations[a].animationObject.currentStep=this.animations[a].animationObject.numSteps),this.animations[a].animationObject.render(this.animations[a].chartInstance,this.animations[a].animationObject),this.animations[a].animationObject.currentStep==this.animations[a].animationObject.numSteps&&(this.animations[a].chartInstance.animating=!1,this.animations.splice(a,1),a--);var s=Date.now(),o=(s-t)/this.frameDuration;this.dropFrames+=o,this.animations.length>0&&i.requestAnimFrame.call(window,this.digestWrapper)}}}.call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers);Chart.types={},Chart.instances={},Chart.controllers={},Chart.Controller=function(t){return this.chart=t,this.config=t.config,this.data=this.config.data,this.options=this.config.options=e.configMerge(Chart.defaults.global,Chart.defaults[this.config.type],this.config.options||{}),this.id=e.uid(),Chart.instances[this.id]=this,this.options.responsive&&this.resize(!0),this.initialize.call(this),this},e.extend(Chart.Controller.prototype,{initialize:function(){return this.bindEvents(),this.ensureScalesHaveIDs(),this.buildOrUpdateControllers(),this.buildScales(),this.resetElements(),this.initToolTip(),this.update(),this},clear:function(){return e.clear(this.chart),this},stop:function(){return Chart.animationService.cancelAnimation(this),this},addDataset:function(t,e){void 0!==e?this.data.datasets.splice(e,0,t):this.data.datasets.push(t),this.buildOrUpdateControllers(),t.controller.reset(),this.update()},removeDataset:function(t){this.data.datasets.splice(t,1),this.buildOrUpdateControllers(),this.update()},addData:function(t,e,i){if(e<this.data.datasets.length){void 0===i&&(i=this.data.datasets[e].data.length);for(var a=[i],s=3;s<arguments.length;++s)a.push(arguments[s]);this.data.datasets[e].data.splice(i,0,t),this.data.datasets[e].controller.addElementAndReset.apply(this.data.datasets[e].controller,a),this.update()}},removeData:function(t,e){t<this.data.datasets.length&&(this.data.datasets[t].data.splice(e,1),this.data.datasets[t].controller.removeElement(e),this.update())},resize:function(t){this.stop();var i=this.chart.canvas,a=e.getMaximumWidth(this.chart.canvas),s=this.options.maintainAspectRatio?a/this.chart.aspectRatio:e.getMaximumHeight(this.chart.canvas);return i.width=this.chart.width=a,i.height=this.chart.height=s,e.retinaScale(this.chart),t||this.update(this.options.responsiveAnimationDuration),this},ensureScalesHaveIDs:function(){var t="x-axis-",i="y-axis-";this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(e,i){e.id=e.id||t+i},this),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(t,e){t.id=t.id||i+e},this))},buildScales:function(){if(this.scales={},this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(t){var e=Chart.scaleService.getScaleConstructor(t.type),i=new e({ctx:this.chart.ctx,options:t,data:this.data,id:t.id});this.scales[i.id]=i},this),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(t){var e=Chart.scaleService.getScaleConstructor(t.type),i=new e({ctx:this.chart.ctx,options:t,data:this.data,id:t.id});this.scales[i.id]=i},this)),this.options.scale){var t=Chart.scaleService.getScaleConstructor(this.options.scale.type),i=new t({ctx:this.chart.ctx,options:this.options.scale,data:this.data,chart:this.chart});this.scale=i}Chart.scaleService.fitScalesForChart(this,this.chart.width,this.chart.height)},buildOrUpdateControllers:function(){e.each(this.data.datasets,function(t,e){var i=t.type||this.config.type;return t.controller?void t.controller.updateIndex(e):void(t.controller=new Chart.controllers[i](this,e))},this)},resetElements:function(){e.each(this.data.datasets,function(t){t.controller.reset()},this)},update:function(t,i){Chart.scaleService.fitScalesForChart(this,this.chart.width,this.chart.height),e.each(this.data.datasets,function(t){t.controller.update()},this),this.render(t,i)},render:function(t,i){if("undefined"!=typeof t&&0!==t||"undefined"==typeof t&&0!==this.options.animation.duration){var a=new Chart.Animation;a.numSteps=(t||this.options.animation.duration)/16.66,a.easing=this.options.animation.easing,a.render=function(t,i){var a=e.easingEffects[i.easing],s=i.currentStep/i.numSteps,o=a(s);t.draw(o,s,i.currentStep)},a.onAnimationProgress=this.options.onAnimationProgress,a.onAnimationComplete=this.options.onAnimationComplete,Chart.animationService.addAnimation(this,a,t,i)}else this.draw(),this.options.onAnimationComplete&&this.options.onAnimationComplete.call&&this.options.onAnimationComplete.call(this);return this},draw:function(t){var i=t||1;this.clear(),e.each(this.scales,function(t){t.draw(this.chartArea)},this),this.scale&&this.scale.draw(),e.each(this.data.datasets,function(e){e.controller.draw(t)},this),this.tooltip.transition(i).draw()},getElementAtEvent:function(t){var i=e.getRelativePosition(t),a=[];return e.each(this.data.datasets,function(t){e.each(t.metaData,function(t){return t.inRange(i.x,i.y)?(a.push(t),a):void 0},this)},this),a},getElementsAtEvent:function(t){var i=e.getRelativePosition(t),a=[];return e.each(this.data.datasets,function(t){e.each(t.metaData,function(t){t.inLabelRange(i.x,i.y)&&a.push(t)},this)},this),a},getDatasetAtEvent:function(t){for(var i=e.getRelativePosition(t),a=[],s=0;s<this.chart.data.datasets.length;s++)for(elementIndex=0;elementIndex<this.chart.data.datasets[s].metaData.length;elementIndex++)this.chart.data.datasets[s].metaData[elementIndex].inLabelRange(i.x,i.y)&&e.each(this.chart.data.datasets,datasetIterator);return a.length?a:[]},generateLegend:function(){return e.template(this.options.legendTemplate,this)},destroy:function(){this.clear(),e.unbindEvents(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete Chart.instances[this.id]},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)},initToolTip:function(){this.tooltip=new Chart.Tooltip({_chart:this.chart,_data:this.data,_options:this.options},this)},bindEvents:function(){e.bindEvents(this,this.options.events,function(t){this.eventHandler(t)})},eventHandler:function(t){this.lastActive=this.lastActive||[],this.active="mouseout"==t.type?[]:function(){switch(this.options.hover.mode){case"single":return this.getElementAtEvent(t);case"label":return this.getElementsAtEvent(t);case"dataset":return this.getDatasetAtEvent(t);default:return t}}.call(this),this.options.hover.onHover&&this.options.hover.onHover.call(this,this.active),("mouseup"==t.type||"click"==t.type)&&this.options.onClick&&this.options.onClick.call(this,t,this.active);if(this.lastActive.length)switch(this.options.hover.mode){case"single":this.data.datasets[this.lastActive[0]._datasetIndex].controller.removeHoverStyle(this.lastActive[0],this.lastActive[0]._datasetIndex,this.lastActive[0]._index);break;case"label":for(var i=0;i<this.lastActive.length;i++)this.data.datasets[this.lastActive[i]._datasetIndex].controller.removeHoverStyle(this.lastActive[i],this.lastActive[i]._datasetIndex,this.lastActive[i]._index);break;case"dataset":}if(this.active.length&&this.options.hover.mode)switch(this.options.hover.mode){case"single":this.data.datasets[this.active[0]._datasetIndex].controller.setHoverStyle(this.active[0]);break;case"label":for(var i=0;i<this.active.length;i++)this.data.datasets[this.active[i]._datasetIndex].controller.setHoverStyle(this.active[i]);break;case"dataset":}if((this.options.tooltips.enabled||this.options.tooltips.custom)&&(this.tooltip.initialize(),this.active.length?(this.tooltip._model.opacity=1,e.extend(this.tooltip,{_active:this.active}),this.tooltip.update()):this.tooltip._model.opacity=0),this.tooltip.pivot(),!this.animating){var a;e.each(this.active,function(t,e){t!==this.lastActive[e]&&(a=!0)},this),(!this.lastActive.length&&this.active.length||this.lastActive.length&&!this.active.length||this.lastActive.length&&this.active.length&&a)&&(this.stop(),this.render(this.options.hover.animationDuration,!0))}return this.lastActive=this.active,this}})}.call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers);e.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){e.each(Chart.instances,function(t){t.options.responsive&&t.resize()})},16)}}())}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=i},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?this.defaults[t]:{}},fitScalesForChart:function(t,e,a){var s=e>30?5:2,o=a>30?5:2;if(t){var n=i.where(t.scales,function(t){return"left"==t.options.position}),r=i.where(t.scales,function(t){return"right"==t.options.position}),h=i.where(t.scales,function(t){return"top"==t.options.position}),l=i.where(t.scales,function(t){return"bottom"==t.options.position}),c=e/2,u=a/2;c-=2*s,u-=2*o;var d=(e-c)/(n.length+r.length),g=(a-u)/(h.length+l.length),m=[],p=function(t){var e=t.fit(d,u);m.push({horizontal:!1,minSize:e,scale:t})},f=function(t){var e=t.fit(c,g);m.push({horizontal:!0,minSize:e,scale:t})};i.each(n,p),i.each(r,p),i.each(h,f),i.each(l,f);var v=a-2*o,b=e-2*s;i.each(m,function(t){t.horizontal?v-=t.minSize.height:b-=t.minSize.width});var x=function(t){var e=i.findNextWhere(m,function(e){return e.scale===t});e&&t.fit(e.minSize.width,v)},y=function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:w,right:C,top:0,bottom:0};e&&t.fit(b,e.minSize.height,a)},w=s,C=s,D=o,_=o;i.each(n,x),i.each(r,x),i.each(n,function(t){w+=t.width}),i.each(r,function(t){C+=t.width}),i.each(h,y),i.each(l,y),i.each(h,function(t){D+=t.height}),i.each(l,function(t){_+=t.height}),i.each(n,function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:0,right:0,top:D,bottom:_};e&&t.fit(e.minSize.width,v,a)}),i.each(r,function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:0,right:0,top:D,bottom:_};e&&t.fit(e.minSize.width,v,a)});var k=s,S=o,A=function(t){t.left=k,t.right=k+t.width,t.top=D,t.bottom=D+v,k=t.right},P=function(t){t.left=w,t.right=w+b,t.top=S,t.bottom=S+t.height,S=t.bottom};i.each(n,A),i.each(h,P),k+=b,S+=v,i.each(r,A),i.each(l,P),t.chartArea={left:w,top:D,right:w+b,bottom:D+v}}}}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.tooltips={enabled:!0,custom:null,backgroundColor:"rgba(0,0,0,0.8)",fontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",fontSize:10,fontStyle:"normal",fontColor:"#fff",titleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",titleFontSize:12,titleFontStyle:"bold",titleFontColor:"#fff",yPadding:6,xPadding:6,caretSize:8,cornerRadius:6,xOffset:10,template:["<% if(label){ %>","<%=label %>: ","<% } %>","<%=value %>"].join(""),multiTemplate:["<%if (datasetLabel){ %>","<%=datasetLabel %>: ","<% } %>","<%=value %>"].join(""),multiKeyBackground:"#fff"},e.Tooltip=e.Element.extend({initialize:function(){var t=this._options;i.extend(this,{_model:{xPadding:t.tooltips.xPadding,yPadding:t.tooltips.yPadding,xOffset:t.tooltips.xOffset,textColor:t.tooltips.fontColor,_fontFamily:t.tooltips.fontFamily,_fontStyle:t.tooltips.fontStyle,fontSize:t.tooltips.fontSize,titleTextColor:t.tooltips.titleFontColor,_titleFontFamily:t.tooltips.titleFontFamily,_titleFontStyle:t.tooltips.titleFontStyle,titleFontSize:t.tooltips.titleFontSize,caretHeight:t.tooltips.caretSize,cornerRadius:t.tooltips.cornerRadius,backgroundColor:t.tooltips.backgroundColor,opacity:0,legendColorBackground:t.tooltips.multiKeyBackground}})},update:function(){var t=this._chart.ctx;switch(this._options.hover.mode){case"single":i.extend(this._model,{text:i.template(this._options.tooltips.template,{element:this._active[0],value:this._data.datasets[this._active[0]._datasetIndex].data[this._active[0]._index],label:void 0!==this._active[0]._model.label?this._active[0]._model.label:this._data.labels?this._data.labels[this._active[0]._index]:""})});var e=this._active[0].tooltipPosition();i.extend(this._model,{x:Math.round(e.x),y:Math.round(e.y),caretPadding:e.padding});break;case"label":for(var a,s,o=[],n=[],r=this._data.datasets.length-1;r>=0&&(a=this._data.datasets[r].metaData,s=i.indexOf(a,this._active[0]),-1===s);r--);var h=function(){var t,e,a,r,h,l=[],c=[],u=[];return i.each(this._data.datasets,function(e){t=e.metaData,t[s]&&t[s].hasValue()&&l.push(t[s])},this),i.each(this._options.stacked?l.reverse():l,function(t){c.push(t._view.x),u.push(t._view.y),o.push(i.template(this._options.tooltips.multiTemplate,{element:t,datasetLabel:this._data.datasets[t._datasetIndex].label,value:this._data.datasets[t._datasetIndex].data[t._index]})),n.push({fill:t._view.backgroundColor,stroke:t._view.borderColor})},this),h=i.min(u),a=i.max(u),r=i.min(c),e=i.max(c),{x:r>this._chart.width/2?r:e,y:(h+a)/2}}.call(this,s);i.extend(this._model,{x:h.x,y:h.y,labels:o,title:this._data.labels&&this._data.labels.length?this._data.labels[this._active[0]._index]:"",legendColors:n,legendBackgroundColor:this._options.tooltips.multiKeyBackground}),this._model.height=o.length*this._model.fontSize+(o.length-1)*(this._model.fontSize/2)+2*this._model.yPadding+1.5*this._model.titleFontSize;var l=t.measureText(this._model.title).width,c=i.longestText(t,this.font,o)+this._model.fontSize+3,u=i.max([c,l]);this._model.width=u+2*this._model.xPadding;var d=this._model.height/2;this._model.y-d<0?this._model.y=d:this._model.y+d>this._chart.height&&(this._model.y=this._chart.height-d),this._model.x>this._chart.width/2?this._model.x-=this._model.xOffset+this._model.width:this._model.x+=this._model.xOffset}return this},draw:function(){var t=this._chart.ctx,e=this._view;switch(this._options.hover.mode){case"single":t.font=i.fontString(e.fontSize,e._fontStyle,e._fontFamily),e.xAlign="center",e.yAlign="above";var a=e.caretPadding||2,s=t.measureText(e.text).width+2*e.xPadding,o=e.fontSize+2*e.yPadding,n=o+e.caretHeight+a;e.x+s/2>this._chart.width?e.xAlign="left":e.x-s/2<0&&(e.xAlign="right"),e.y-n<0&&(e.yAlign="below");var r=e.x-s/2,h=e.y-n;if(t.fillStyle=i.color(e.backgroundColor).alpha(e.opacity).rgbString(),this._options.tooltips.custom&&this._options.tooltips.custom(this),!this._options.tooltips.enabled)return;switch(e.yAlign){case"above":t.beginPath(),t.moveTo(e.x,e.y-a),t.lineTo(e.x+e.caretHeight,e.y-(a+e.caretHeight)),t.lineTo(e.x-e.caretHeight,e.y-(a+e.caretHeight)),t.closePath(),t.fill();break;case"below":h=e.y+a+e.caretHeight,t.beginPath(),t.moveTo(e.x,e.y+a),t.lineTo(e.x+e.caretHeight,e.y+a+e.caretHeight),t.lineTo(e.x-e.caretHeight,e.y+a+e.caretHeight),t.closePath(),t.fill()}switch(e.xAlign){case"left":r=e.x-s+(e.cornerRadius+e.caretHeight);break;case"right":r=e.x-(e.cornerRadius+e.caretHeight)}i.drawRoundedRectangle(t,r,h,s,o,e.cornerRadius),t.fill(),t.fillStyle=i.color(e.textColor).alpha(e.opacity).rgbString(),t.textAlign="center",t.textBaseline="middle",t.fillText(e.text,r+s/2,h+o/2);break;case"label":if(this._options.tooltips.custom&&this._options.tooltips.custom(this),!this._options.tooltips.enabled)return;i.drawRoundedRectangle(t,e.x,e.y-e.height/2,e.width,e.height,e.cornerRadius),t.fillStyle=i.color(e.backgroundColor).alpha(e.opacity).rgbString(),t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=i.color(e.titleTextColor).alpha(e.opacity).rgbString(),t.font=i.fontString(e.fontSize,e._titleFontStyle,e._titleFontFamily),t.fillText(e.title,e.x+e.xPadding,this.getLineHeight(0)),t.font=i.fontString(e.fontSize,e._fontStyle,e._fontFamily),i.each(e.labels,function(a,s){t.fillStyle=i.color(e.textColor).alpha(e.opacity).rgbString(),t.fillText(a,e.x+e.xPadding+e.fontSize+3,this.getLineHeight(s+1)),t.fillStyle=i.color(e.legendColors[s].stroke).alpha(e.opacity).rgbString(),t.fillRect(e.x+e.xPadding-1,this.getLineHeight(s+1)-e.fontSize/2-1,e.fontSize+2,e.fontSize+2),t.fillStyle=i.color(e.legendColors[s].fill).alpha(e.opacity).rgbString(),t.fillRect(e.x+e.xPadding,this.getLineHeight(s+1)-e.fontSize/2,e.fontSize,e.fontSize)},this)}},getLineHeight:function(t){var e=this._view.y-this._view.height/2+this._view.yPadding,i=t-1;return 0===t?e+this._view.titleFontSize/2:e+(1.5*this._view.fontSize*i+this._view.fontSize/2)+1.5*this._view.titleFontSize}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categorySpacing:10,spacing:1,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},e.controllers.bar=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.bar.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){this.getDataset().xAxisID||(this.getDataset().xAxisID=this.chart.options.scales.xAxes[0].id),this.getDataset().yAxisID||(this.getDataset().yAxisID=this.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},getBarCount:function(){var t=0;return i.each(this.chart.data.datasets,function(e){"bar"===e.type?++t:void 0===e.type&&"bar"===this.chart.config.type&&++t},this),t},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})
--},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:t}),a=this.getBarCount();this.updateElement(i,t,!0,a),this.getDataset().metaData.splice(t,0,i)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},update:function(t){var e=this.getBarCount(),a=this.getDataset().data.length,s=this.getDataset().metaData.length;if(s>a)this.getDataset().metaData.splice(a,s-a);else if(a>s)for(var o=s;a>o;++o)this.addElementAndReset(o);i.each(this.getDataset().metaData,function(i,a){this.updateElement(i,a,t,e)},this)},updateElement:function(t,e,a,s){var o,n=this.getScaleForId(this.getDataset().xAxisID),r=this.getScaleForId(this.getDataset().yAxisID);o=r.getPixelForValue(r.min<0&&r.max<0?r.max:r.min>0&&r.max>0?r.min:0),i.extend(t,{_chart:this.chart.chart,_xScale:n,_yScale:r,_datasetIndex:this.index,_index:e,_model:{x:n.calculateBarX(s,this.index,e),y:a?o:r.calculateBarY(this.index,e),label:this.chart.data.labels[e],datasetLabel:this.getDataset().label,base:r.calculateBarBase(this.index,e),width:n.calculateBarWidth(s),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.rectangle.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.rectangle.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.rectangle.borderWidth)}}),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.hoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.rectangle.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.rectangle.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.rectangle.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.doughnut={animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},cutoutPercentage:50},e.defaults.pie=i.clone(e.defaults.doughnut),i.extend(e.defaults.pie,{cutoutPercentage:0}),e.controllers.doughnut=e.controllers.pie=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.doughnut.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t,a){this.getDataset().metaData=this.getDataset().metaData||[];var s=new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});a&&i.isArray(this.getDataset().backgroundColor)&&this.getDataset().backgroundColor.splice(t,0,a),this.updateElement(s,t,!0),this.getDataset().metaData.splice(t,0,s)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},update:function(t){this.chart.outerRadius=i.min([this.chart.chart.width,this.chart.chart.height])/2-this.chart.options.elements.arc.borderWidth/2,this.chart.innerRadius=this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.chart.data.datasets.length,this.getDataset().total=0,i.each(this.getDataset().data,function(t){this.getDataset().total+=Math.abs(t)},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.index,this.innerRadius=this.outerRadius-this.chart.radiusLength;var e=this.getDataset().data.length,a=this.getDataset().metaData.length;if(a>e)this.getDataset().metaData.splice(e,a-e);else if(e>a)for(var s=a;e>s;++s)this.addElementAndReset(s);i.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,e,a){var s={x:this.chart.chart.width/2,y:this.chart.chart.height/2,startAngle:Math.PI*-.5,circumference:this.chart.options.animation.animateRotate?0:this.calculateCircumference(this.getDataset().data[e]),outerRadius:this.chart.options.animation.animateScale?0:this.outerRadius,innerRadius:this.chart.options.animation.animateScale?0:this.innerRadius};i.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:e,_model:a?s:{x:this.chart.chart.width/2,y:this.chart.chart.height/2,circumference:this.calculateCircumference(this.getDataset().data[e]),outerRadius:this.outerRadius,innerRadius:this.innerRadius,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.getDataset().label,e,this.chart.data.labels[e])}}),a||(t._model.startAngle=0===e?Math.PI*-.5:this.getDataset().metaData[e-1]._model.endAngle,t._model.endAngle=t._model.startAngle+t._model.circumference,e<this.getDataset().data.length-1&&(this.getDataset().metaData[e+1]._model.startAngle=t._model.endAngle)),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.hoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){return this.getDataset().total>0?1.999999*Math.PI*(t/this.getDataset().total):0}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.line={hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}},e.controllers.line=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.line.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){this.getDataset().xAxisID||(this.getDataset().xAxisID=this.chart.options.scales.xAxes[0].id),this.getDataset().yAxisID||(this.getDataset().yAxisID=this.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new e.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData}),i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i),this.updateBezierControlPoints()},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},update:function(t){var e,a=this.getDataset().metaDataset,s=this.getDataset().metaData,o=this.getScaleForId(this.getDataset().yAxisID),n=(this.getScaleForId(this.getDataset().xAxisID),this.getDataset().data.length),r=this.getDataset().metaData.length;if(r>n)this.getDataset().metaData.splice(n,r-n);else if(n>r)for(var h=r;n>h;++h)this.addElementAndReset(h);e=o.getPixelForValue(o.min<0&&o.max<0?o.max:o.min>0&&o.max>0?o.min:0),i.extend(a,{_scale:o,_datasetIndex:this.index,_children:s,_model:{tension:a.custom&&a.custom.tension?a.custom.tension:this.getDataset().tension||this.chart.options.elements.line.tension,backgroundColor:a.custom&&a.custom.backgroundColor?a.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:a.custom&&a.custom.borderWidth?a.custom.borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:a.custom&&a.custom.borderColor?a.custom.borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,borderCapStyle:a.custom&&a.custom.borderCapStyle?a.custom.borderCapStyle:this.getDataset().borderCapStyle||this.chart.options.elements.line.borderCapStyle,borderDash:a.custom&&a.custom.borderDash?a.custom.borderDash:this.getDataset().borderDash||this.chart.options.elements.line.borderDash,borderDashOffset:a.custom&&a.custom.borderDashOffset?a.custom.borderDashOffset:this.getDataset().borderDashOffset||this.chart.options.elements.line.borderDashOffset,borderJoinStyle:a.custom&&a.custom.borderJoinStyle?a.custom.borderJoinStyle:this.getDataset().borderJoinStyle||this.chart.options.elements.line.borderJoinStyle,fill:a.custom&&a.custom.fill?a.custom.fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,skipNull:void 0!==this.getDataset().skipNull?this.getDataset().skipNull:this.chart.options.elements.line.skipNull,drawNull:void 0!==this.getDataset().drawNull?this.getDataset().drawNull:this.chart.options.elements.line.drawNull,scaleTop:o.top,scaleBottom:o.bottom,scaleZero:e}}),a.pivot(),i.each(s,function(e,i){this.updateElement(e,i,t)},this),this.updateBezierControlPoints()},updateElement:function(t,e,a){var s,o=this.getScaleForId(this.getDataset().yAxisID),n=this.getScaleForId(this.getDataset().xAxisID);s=o.getPixelForValue(o.min<0&&o.max<0?o.max:o.min>0&&o.max>0?o.min:0),i.extend(t,{_chart:this.chart.chart,_xScale:n,_yScale:o,_datasetIndex:this.index,_index:e,_model:{x:n.getPointPixelForValue(this.getDataset().data[e],e,this.index),y:a?s:o.getPointPixelForValue(this.getDataset().data[e],e,this.index),tension:t.custom&&t.custom.tension?t.custom.tension:this.getDataset().tension||this.chart.options.elements.line.tension,radius:t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth),skip:t.custom&&t.custom.skip?t.custom.skip:null===this.getDataset().data[e],hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:i.getValueAtIndexOrDefault(this.getDataset().hitRadius,e,this.chart.options.elements.point.hitRadius)}})},updateBezierControlPoints:function(){i.each(this.getDataset().metaData,function(t,e){var a=i.splineCurve(i.previousItem(this.getDataset().metaData,e)._model,t._model,i.nextItem(this.getDataset().metaData,e)._model,t._model.tension);t._model.controlPointPreviousX=a.previous.x,t._model.controlPointNextX=a.next.x,t._model.controlPointNextY=a.next.y>this.chart.chartArea.bottom?this.chart.chartArea.bottom:a.next.y<this.chart.chartArea.top?this.chart.chartArea.top:a.next.y,t._model.controlPointPreviousY=a.previous.y>this.chart.chartArea.bottom?this.chart.chartArea.bottom:a.previous.y<this.chart.chartArea.top?this.chart.chartArea.top:a.previous.y,t.pivot()},this)},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t){t.transition(e)},this),this.getDataset().metaDataset.transition(e).draw(),i.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.radius=t.custom&&t.custom.hoverRadius?t.custom.hoverRadius:i.getValueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.pointHoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.pointHoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.polarArea={scale:{type:"radialLinear",lineArc:!0},animateRotate:!0,animateScale:!0},e.controllers.polarArea=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.polarArea.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},update:function(t){e.scaleService.fitScalesForChart(this,this.chart.width,this.chart.height),this.chart.scale.calculateRange(),this.chart.scale.generateTicks(),this.chart.scale.buildYLabels(),this.chart.outerRadius=(i.min([this.chart.chart.width,this.chart.chart.height])-this.chart.options.elements.arc.borderWidth/2)/2,this.chart.innerRadius=this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.chart.data.datasets.length,this.getDataset().total=0,i.each(this.getDataset().data,function(t){this.getDataset().total+=Math.abs(t)},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.index,this.innerRadius=this.outerRadius-this.chart.radiusLength,i.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,e,a){var s=1/this.getDataset().data.length*2,o=-.5*Math.PI+Math.PI*s*e,n=o+s*Math.PI,r={x:this.chart.chart.width/2,y:this.chart.chart.height/2,innerRadius:0,outerRadius:this.chart.options.animateScale?0:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[e]),startAngle:this.chart.options.animateRotate?Math.PI*-.5:o,endAngle:this.chart.options.animateRotate?Math.PI*-.5:n,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.chart.data.labels,e,this.chart.data.labels[e])};i.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:e,_model:a?r:{x:this.chart.chart.width/2,y:this.chart.chart.height/2,innerRadius:0,outerRadius:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[e]),startAngle:o,endAngle:n,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.chart.data.labels,e,this.chart.data.labels[e])}}),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.borderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){return this.getDataset().total>0?2*Math.PI*(t/this.getDataset().total):0},updateScaleRange:function(){i.extend(this.chart.scale,{size:i.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.radar={scale:{type:"radialLinear"},elements:{line:{tension:0}}},e.controllers.radar=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.radar.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new e.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData,_loop:!0}),i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_model:{x:0,y:0}})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i),this.updateBezierControlPoints()},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},update:function(t){var e,a=(this.getDataset().metaDataset,this.getDataset().metaData),s=this.chart.scale;s.setScaleSize(),s.calculateRange(),s.generateTicks(),s.buildYLabels(),e=s.min<0&&s.max<0?s.getPointPositionForValue(0,s.max):s.min>0&&s.max>0?s.getPointPositionForValue(0,s.min):s.getPointPositionForValue(0,0),i.extend(this.getDataset().metaDataset,{_datasetIndex:this.index,_children:this.getDataset().metaData,_model:{tension:this.getDataset().tension||this.chart.options.elements.line.tension,backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,skipNull:void 0!==this.getDataset().skipNull?this.getDataset().skipNull:this.chart.options.elements.line.skipNull,drawNull:void 0!==this.getDataset().drawNull?this.getDataset().drawNull:this.chart.options.elements.line.drawNull,scaleTop:s.top,scaleBottom:s.bottom,scaleZero:e}}),this.getDataset().metaDataset.pivot(),i.each(a,function(e,i){this.updateElement(e,i,t)},this),this.updateBezierControlPoints()},updateElement:function(t,e,a){var s=this.chart.scale.getPointPositionForValue(e,this.getDataset().data[e]);i.extend(t,{_datasetIndex:this.index,_index:e,_model:{x:a?this.chart.scale.xCenter:s.x,y:a?this.chart.scale.yCenter:s.y,tension:t.custom&&t.custom.tension?t.custom.tension:this.chart.options.elements.line.tension,radius:t.custom&&t.custom.radius?t.custom.pointRadius:i.getValueAtIndexOrDefault(this.getDataset().pointRadius,e,this.chart.options.elements.point.radius),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth),skip:t.custom&&t.custom.skip?t.custom.skip:null===this.getDataset().data[e],hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:i.getValueAtIndexOrDefault(this.getDataset().hitRadius,e,this.chart.options.elements.point.hitRadius)}})},updateBezierControlPoints:function(){i.each(this.getDataset().metaData,function(t,e){var a=i.splineCurve(i.previousItem(this.getDataset().metaData,e,!0)._model,t._model,i.nextItem(this.getDataset().metaData,e,!0)._model,t._model.tension);t._model.controlPointPreviousX=a.previous.x,t._model.controlPointNextX=a.next.x,t._model.controlPointNextY=a.next.y>this.chart.chartArea.bottom?this.chart.chartArea.bottom:a.next.y<this.chart.chartArea.top?this.chart.chartArea.top:a.next.y,t._model.controlPointPreviousY=a.previous.y>this.chart.chartArea.bottom?this.chart.chartArea.bottom:a.previous.y<this.chart.chartArea.top?this.chart.chartArea.top:a.previous.y,t.pivot()},this)},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t){t.transition(e)},this),this.getDataset().metaDataset.transition(e).draw(),i.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.pointHoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.pointBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={display:!0,position:"bottom",gridLines:{show:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawOnChartArea:!0,drawTicks:!0,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",offsetGridLines:!1},labels:{show:!0,maxRotation:90,template:"<%=value%>",fontSize:12,fontStyle:"normal",fontColor:"#666",fontFamily:"Helvetica Neue"}},s=e.Element.extend({isHorizontal:function(){return"top"==this.options.position||"bottom"==this.options.position},buildLabels:function(){this.labels=[],this.options.labels.userCallback?this.data.labels.forEach(function(t,e){this.labels.push(this.options.labels.userCallback(t,e))},this):this.labels=this.data.labels},getPixelForValue:function(t,e,i,a){if(this.isHorizontal()){var s=(this.labelRotation>0,this.width-(this.paddingLeft+this.paddingRight)),o=s/Math.max(this.labels.length-(this.options.gridLines.offsetGridLines?0:1),1),n=o*e+this.paddingLeft;return this.options.gridLines.offsetGridLines&&a&&(n+=o/2),this.left+Math.round(n)}return this.top+e*(this.height/this.labels.length)},getPointPixelForValue:function(t,e,i){return this.getPixelForValue(t,e,i,!0)},calculateBaseWidth:function(){return this.getPixelForValue(null,1,0,!0)-this.getPixelForValue(null,0,0,!0)-2*this.options.categorySpacing},calculateBarWidth:function(t){var e=this.calculateBaseWidth()-(t-1)*this.options.spacing;return this.options.stacked?e:e/t},calculateBarX:function(t,e,i){var a=this.calculateBaseWidth(),s=this.getPixelForValue(null,i,e,!0)-a/2,o=this.calculateBarWidth(t);return this.options.stacked?s+o/2:s+o*e+e*this.options.spacing+o/2},calculateLabelRotation:function(t,e){var a=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily);this.ctx.font=a;var s,o,n=this.ctx.measureText(this.labels[0]).width,r=this.ctx.measureText(this.labels[this.labels.length-1]).width;if(this.paddingRight=r/2+3,this.paddingLeft=n/2+3,this.labelRotation=0,this.options.display){var h,l,c=i.longestText(this.ctx,a,this.labels);this.labelWidth=c;for(var u=Math.floor(this.getPixelForValue(0,1)-this.getPixelForValue(0,0))-6;this.labelWidth>u&&this.labelRotation<=this.options.labels.maxRotation;){if(h=Math.cos(i.toRadians(this.labelRotation)),l=Math.sin(i.toRadians(this.labelRotation)),s=h*n,o=h*r,s+this.options.labels.fontSize/2>this.yLabelWidth&&(this.paddingLeft=s+this.options.labels.fontSize/2),this.paddingRight=this.options.labels.fontSize/2,l*c>t){this.labelRotation--;break}this.labelRotation++,this.labelWidth=h*c}}else this.labelWidth=0,this.paddingRight=0,this.paddingLeft=0;e&&(this.paddingLeft-=e.left,this.paddingRight-=e.right,this.paddingLeft=Math.max(this.paddingLeft,0),this.paddingRight=Math.max(this.paddingRight,0))},fit:function(t,e,a){this.isHorizontal()?this.width=t:this.height=e,this.buildLabels(),this.calculateLabelRotation(e,a);var s={width:0,height:0},o=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily),n=i.longestText(this.ctx,o,this.labels);if(this.isHorizontal())s.width=t;else if(this.options.display){var r=this.options.labels.show?n+6:0;
--s.width=Math.min(r,t)}if(this.isHorizontal()&&this.options.display){var h=Math.sin(i.toRadians(this.labelRotation))*n+1.5*this.options.labels.fontSize;s.height=Math.min(this.options.labels.show?h:0,e)}else this.options.display&&(s.height=e);return this.width=s.width,this.height=s.height,s},draw:function(t){if(this.options.display){var e;if(this.ctx.fillStyle=this.options.labels.fontColor,this.isHorizontal()){e=!0;var a="bottom"==this.options.position?this.top:this.bottom-10,s="bottom"==this.options.position?this.top+10:this.bottom,o=0!==this.labelRotation,n=!1;(this.options.labels.fontSize+4)*this.labels.length>this.width-(this.paddingLeft+this.paddingRight)&&(n=1+Math.floor((this.options.labels.fontSize+4)*this.labels.length/(this.width-(this.paddingLeft+this.paddingRight)))),i.each(this.labels,function(r,h){if(!(n>1&&h%n>0||void 0===r||null===r)){var l=this.getPixelForValue(r,h,null,!1),c=this.getPixelForValue(r,h,null,!0);this.options.gridLines.show&&(0===h?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,e=!0):e&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,e=!1),l+=i.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(l,a),this.ctx.lineTo(l,s)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(l,t.top),this.ctx.lineTo(l,t.bottom)),this.ctx.stroke()),this.options.labels.show&&(this.ctx.save(),this.ctx.translate(c,o?this.top+12:this.top+8),this.ctx.rotate(-1*i.toRadians(this.labelRotation)),this.ctx.font=this.font,this.ctx.textAlign=o?"right":"center",this.ctx.textBaseline=o?"middle":"top",this.ctx.fillText(r,0,0),this.ctx.restore())}},this)}else this.options.gridLines.show,this.options.labels.show}}});e.scaleService.registerScaleType("category",s,a)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={display:!0,position:"left",gridLines:{show:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawOnChartArea:!0,drawTicks:!0,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)"},reverse:!1,beginAtZero:!1,override:null,labels:{show:!0,mirror:!1,padding:10,template:"<%=value.toLocaleString()%>",fontSize:12,fontStyle:"normal",fontColor:"#666",fontFamily:"Helvetica Neue"}},s=e.Element.extend({isHorizontal:function(){return"top"==this.options.position||"bottom"==this.options.position},generateTicks:function(t,e){if(this.ticks=[],this.options.override)for(var a=0;a<=this.options.override.steps;++a){var s=this.options.override.start+a*this.options.override.stepWidth;this.ticks.push(s)}else{var o;if(o=this.isHorizontal()?Math.min(11,Math.ceil(t/50)):Math.min(11,Math.ceil(e/(2*this.options.labels.fontSize))),o=Math.max(2,o),this.options.beginAtZero){var n=i.sign(this.min),r=i.sign(this.max);0>n&&0>r?this.max=0:n>0&&r>0&&(this.min=0)}for(var h=i.niceNum(this.max-this.min,!1),l=i.niceNum(h/(o-1),!0),c=Math.floor(this.min/l)*l,u=Math.ceil(this.max/l)*l,d=c;u>=d;d+=l)this.ticks.push(d)}("left"==this.options.position||"right"==this.options.position)&&this.ticks.reverse(),this.max=i.max(this.ticks),this.min=i.min(this.ticks),this.options.reverse?(this.ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max)},buildLabels:function(){this.labels=[],i.each(this.ticks,function(t,e,a){var s;this.options.labels.userCallback?s=this.options.labels.userCallback(t,e,a):this.options.labels.template&&(s=i.template(this.options.labels.template,{value:t})),this.labels.push(s?s:"")},this)},getRightValue:function(t){return"object"==typeof t&&null!==t?this.isHorizontal()?t.x:t.y:t},getPixelForValue:function(t){var e,i=this.end-this.start;if(this.isHorizontal()){var a=this.width-(this.paddingLeft+this.paddingRight);e=this.left+a/i*(t-this.start),e+=this.paddingLeft}else{var s=this.height-(this.paddingTop+this.paddingBottom);e=this.bottom-this.paddingBottom-s/i*(t-this.start)}return e},calculateRange:function(){this.min=null,this.max=null;var t=[],e=[];if(this.options.stacked){i.each(this.data.datasets,function(a){(this.isHorizontal()?a.xAxisID===this.id:a.yAxisID===this.id)&&i.each(a.data,function(i,a){var s=this.getRightValue(i);t[a]=t[a]||0,e[a]=e[a]||0,this.options.relativePoints?t[a]=100:0>s?e[a]+=s:t[a]+=s},this)},this);var a=t.concat(e);this.min=i.min(a),this.max=i.max(a)}else i.each(this.data.datasets,function(t){(this.isHorizontal()?t.xAxisID===this.id:t.yAxisID===this.id)&&i.each(t.data,function(t){var e=this.getRightValue(t);null===this.min?this.min=e:e<this.min&&(this.min=e),null===this.max?this.max=e:e>this.max&&(this.max=e)},this)},this);this.min===this.max&&(this.min--,this.max++)},getPointPixelForValue:function(t,e,i){var a=this.getRightValue(t);if(this.options.stacked){for(var s=0,o=0,n=this.data.datasets.length-1;n>i;--n)this.data.datasets[n].data[e]<0?o+=this.data.datasets[n].data[e]:s+=this.data.datasets[n].data[e];return this.getPixelForValue(0>a?o+a:s+a)}return this.getPixelForValue(a)},calculateBarBase:function(t,e){var i=0;if(this.options.stacked){var a=this.data.datasets[t].data[e];if(0>a)for(var s=0;t>s;s++)this.data.datasets[s].yAxisID===this.id&&(i+=this.data.datasets[s].data[e]<0?this.data.datasets[s].data[e]:0);else for(var o=0;t>o;o++)this.data.datasets[o].yAxisID===this.id&&(i+=this.data.datasets[o].data[e]>0?this.data.datasets[o].data[e]:0);return this.getPixelForValue(i)}return i=this.getPixelForValue(this.min),this.beginAtZero||this.min<=0&&this.max>=0||this.min>=0&&this.max<=0?(i=this.getPixelForValue(0),i+=this.options.gridLines.lineWidth):this.min<0&&this.max<0&&(i=this.getPixelForValue(this.max)),i},calculateBarY:function(t,e){var i=this.data.datasets[t].data[e];if(this.options.stacked){for(var a=0,s=0,o=0;t>o;o++)this.data.datasets[o].data[e]<0?s+=this.data.datasets[o].data[e]||0:a+=this.data.datasets[o].data[e]||0;return this.getPixelForValue(0>i?s+i:a+i)}return this.getPixelForValue(i)},fit:function(t,e,a){this.calculateRange(),this.generateTicks(t,e),this.buildLabels();var s={width:0,height:0};if(s.width=this.isHorizontal()?t:this.options.gridLines.show&&this.options.display?10:0,s.height=this.isHorizontal()?this.options.gridLines.show&&this.options.display?10:0:e,this.paddingLeft=0,this.paddingRight=0,this.paddingTop=0,this.paddingBottom=0,this.options.labels.show&&this.options.display){var o=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily);if(this.isHorizontal()){var n=(e-s.height,1.5*this.options.labels.fontSize);s.height=Math.min(e,s.height+n);var o=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily);this.ctx.font=o;var r=this.ctx.measureText(this.labels[0]).width,h=this.ctx.measureText(this.labels[this.labels.length-1]).width;this.paddingLeft=r/2,this.paddingRight=h/2}else{var l=t-s.width,c=i.longestText(this.ctx,o,this.labels);l>c?(s.width+=c,s.width+=3):s.width=t,this.paddingTop=this.options.labels.fontSize/2,this.paddingBottom=this.options.labels.fontSize/2}}return a&&(this.paddingLeft-=a.left,this.paddingTop-=a.top,this.paddingRight-=a.right,this.paddingBottom-=a.bottom,this.paddingLeft=Math.max(this.paddingLeft,0),this.paddingTop=Math.max(this.paddingTop,0),this.paddingRight=Math.max(this.paddingRight,0),this.paddingBottom=Math.max(this.paddingBottom,0)),this.width=s.width,this.height=s.height,s},draw:function(t){if(this.options.display){var e,a;if(this.ctx.fillStyle=this.options.labels.fontColor,this.isHorizontal()){if(this.options.gridLines.show){e=!0,a=void 0!==i.findNextWhere(this.ticks,function(t){return 0===t});var s="bottom"==this.options.position?this.top:this.bottom-5,o="bottom"==this.options.position?this.top+5:this.bottom;i.each(this.ticks,function(n,r){var h=this.getPixelForValue(n);0===n||!a&&0===r?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,e=!0):e&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,e=!1),h+=i.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(h,s),this.ctx.lineTo(h,o)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(h,t.top),this.ctx.lineTo(h,t.bottom)),this.ctx.stroke()},this)}if(this.options.labels.show){var n;"top"==this.options.position?(n=this.bottom-10,this.ctx.textBaseline="bottom"):(n=this.top+10,this.ctx.textBaseline="top"),this.ctx.textAlign="center",this.ctx.font=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily),i.each(this.labels,function(t,e){var i=this.getPixelForValue(this.ticks[e]);this.ctx.fillText(t,i,n)},this)}}else{if(this.options.gridLines.show){e=!0,a=void 0!==i.findNextWhere(this.ticks,function(t){return 0===t});var r="right"==this.options.position?this.left:this.right-5,h="right"==this.options.position?this.left+5:this.right;i.each(this.ticks,function(s,o){var n=this.getPixelForValue(s);0===s||!a&&0===o?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,e=!0):e&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,e=!1),n+=i.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(r,n),this.ctx.lineTo(h,n)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(t.left,n),this.ctx.lineTo(t.right,n)),this.ctx.stroke()},this)}if(this.options.labels.show){var l;"left"==this.options.position?this.options.labels.mirror?(l=this.right+this.options.labels.padding,this.ctx.textAlign="left"):(l=this.right-this.options.labels.padding,this.ctx.textAlign="right"):this.options.labels.mirror?(l=this.left-this.options.labels.padding,this.ctx.textAlign="right"):(l=this.left+this.options.labels.padding,this.ctx.textAlign="left"),this.ctx.textBaseline="middle",this.ctx.font=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily),i.each(this.labels,function(t,e){var i=this.getPixelForValue(this.ticks[e]);this.ctx.fillText(t,l,i)},this)}}}}});e.scaleService.registerScaleType("linear",s,a)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={display:!0,animate:!0,lineArc:!1,gridLines:{show:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},angleLines:{show:!0,color:"rgba(0,0,0, 0.1)",lineWidth:1},beginAtZero:!0,labels:{show:!0,template:"<%=value.toLocaleString()%>",fontSize:12,fontStyle:"normal",fontColor:"#666",fontFamily:"Helvetica Neue",showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2},pointLabels:{fontFamily:"'Arial'",fontStyle:"normal",fontSize:10,fontColor:"#666"}},s=e.Element.extend({initialize:function(){this.height=this.chart.height,this.width=this.chart.width,this.xCenter=this.chart.width/2,this.yCenter=this.chart.height/2,this.size=i.min([this.height,this.width]),this.labels=this.data.labels,this.drawingArea=this.options.display?this.size/2-(this.options.labels.fontSize/2+this.options.labels.backdropPaddingY):this.size/2},getValueCount:function(){return this.data.labels.length},update:function(){this.options.lineArc?this.drawingArea=this.options.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},calculateRange:function(){this.min=null,this.max=null,i.each(this.data.datasets,function(t){i.each(t.data,function(t){null===this.min?this.min=t:t<this.min&&(this.min=t),null===this.max?this.max=t:t>this.max&&(this.max=t)},this)},this)},generateTicks:function(){if(this.ticks=[],this.options.override)for(var t=0;t<=this.options.override.steps;++t){var e=this.options.override.start+t*this.options.override.stepWidth;this.ticks.push(e)}else{var a=Math.min(11,Math.ceil(this.drawingArea/(2*this.options.labels.fontSize)));if(a=Math.max(2,a),this.options.beginAtZero){var s=i.sign(this.min),o=i.sign(this.max);0>s&&0>o?this.max=0:s>0&&o>0&&(this.min=0)}for(var n=i.niceNum(this.max-this.min,!1),r=i.niceNum(n/(a-1),!0),h=Math.floor(this.min/r)*r,l=Math.ceil(this.max/r)*r,c=h;l>=c;c+=r)this.ticks.push(c)}("left"==this.options.position||"right"==this.options.position)&&this.ticks.reverse(),this.max=i.max(this.ticks),this.min=i.min(this.ticks)},buildYLabels:function(){this.yLabels=[],i.each(this.ticks,function(t,e,a){var s;this.options.labels.userCallback?s=this.options.labels.userCallback(t,e,a):this.options.labels.template&&(s=i.template(this.options.labels.template,{value:t})),this.yLabels.push(s?s:"")},this)},getCircumference:function(){return 2*Math.PI/this.getValueCount()},setScaleSize:function(){var t,e,a,s,o,n,r,h,l,c,u,d,g=i.min([this.height/2-this.options.pointLabels.fontSize-5,this.width/2]),m=this.width,p=0;for(this.ctx.font=i.fontString(this.options.pointLabels.fontSize,this.options.pointLabels.fontStyle,this.options.pointLabels.fontFamily),e=0;e<this.getValueCount();e++)t=this.getPointPosition(e,g),a=this.ctx.measureText(i.template(this.options.labels.template,{value:this.labels[e]})).width+5,0===e||e===this.getValueCount()/2?(s=a/2,t.x+s>m&&(m=t.x+s,o=e),t.x-s<p&&(p=t.x-s,r=e)):e<this.getValueCount()/2?t.x+a>m&&(m=t.x+a,o=e):e>this.getValueCount()/2&&t.x-a<p&&(p=t.x-a,r=e);l=p,c=Math.ceil(m-this.width),n=this.getIndexAngle(o),h=this.getIndexAngle(r),u=c/Math.sin(n+Math.PI/2),d=l/Math.sin(h+Math.PI/2),u=i.isNumber(u)?u:0,d=i.isNumber(d)?d:0,this.drawingArea=g-(d+u)/2,this.setCenterPoint(d,u)},setCenterPoint:function(t,e){var i=this.width-e-this.drawingArea,a=t+this.drawingArea;this.xCenter=(a+i)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var e=2*Math.PI/this.getValueCount();return t*e-Math.PI/2},getDistanceFromCenterForValue:function(t){var e=this.drawingArea/(this.max-this.min);return(t-this.min)*e},getPointPosition:function(t,e){var i=this.getIndexAngle(t);return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},draw:function(){if(this.options.display){var t=this.ctx;if(i.each(this.yLabels,function(e,a){if(a>0){var s=this.getDistanceFromCenterForValue(this.ticks[a]),o=this.yCenter-s;if(this.options.gridLines.show)if(t.strokeStyle=this.options.gridLines.color,t.lineWidth=this.options.gridLines.lineWidth,this.options.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,s,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var n=0;n<this.getValueCount();n++){var r=this.getPointPosition(n,this.getDistanceFromCenterForValue(this.ticks[a]));0===n?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)}t.closePath(),t.stroke()}if(this.options.labels.show){if(t.font=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily),this.options.labels.showLabelBackdrop){var h=t.measureText(e).width;t.fillStyle=this.options.labels.backdropColor,t.fillRect(this.xCenter-h/2-this.options.labels.backdropPaddingX,o-this.fontSize/2-this.options.labels.backdropPaddingY,h+2*this.options.labels.backdropPaddingX,this.options.labels.fontSize+2*this.options.labels.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.options.labels.fontColor,t.fillText(e,this.xCenter,o)}}},this),!this.options.lineArc){t.lineWidth=this.options.angleLines.lineWidth,t.strokeStyle=this.options.angleLines.color;for(var e=this.getValueCount()-1;e>=0;e--){if(this.options.angleLines.show){var a=this.getPointPosition(e,this.getDistanceFromCenterForValue(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke(),t.closePath()}var s=this.getPointPosition(e,this.getDistanceFromCenterForValue(this.max)+5);t.font=i.fontString(this.options.pointLabels.fontSize,this.options.pointLabels.fontStyle,this.options.pointLabels.fontFamily),t.fillStyle=this.options.pointLabels.fontColor;var o=this.labels.length,n=this.labels.length/2,r=n/2,h=r>e||e>o-r,l=e===r||e===o-r;t.textAlign=0===e?"center":e===n?"center":n>e?"left":"right",t.textBaseline=l?"middle":h?"bottom":"top",t.fillText(this.labels[e],s.x,s.y)}}}}});e.scaleService.registerScaleType("radialLinear",s,a)}.call(this),/*!
++(function(){"use strict";var t=this,e=t.Chart,i=function(t,e){this.config=e,t.length&&t[0].getContext&&(t=t[0]),t.getContext&&(t=t.getContext("2d")),this.ctx=t,this.canvas=t.canvas,this.width=t.canvas.width||parseInt(i.helpers.getStyle(t.canvas,"width"))||i.helpers.getMaximumWidth(t.canvas),this.height=t.canvas.height||parseInt(i.helpers.getStyle(t.canvas,"height"))||i.helpers.getMaximumHeight(t.canvas),this.aspectRatio=this.width/this.height,(isNaN(this.aspectRatio)||isFinite(this.aspectRatio)===!1)&&(this.aspectRatio=void 0!==e.aspectRatio?e.aspectRatio:2),this.originalCanvasStyleWidth=t.canvas.style.width,this.originalCanvasStyleHeight=t.canvas.style.height,i.helpers.retinaScale(this);var a=this;return i.helpers.addResizeListener(t.canvas.parentNode,function(){e.options.responsive&&a.controller.resize()}),e?(this.controller=new i.Controller(this),this.controller):this};i.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove","touchend"],hover:{onHover:null,mode:"single",animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",elements:{},legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets.length; i++){%><li><span style="background-color:<%=data.datasets[i].backgroundColor%>"><%if(data.datasets[i].label){%><%=data.datasets[i].label%><%}%></span></li><%}%></ul>'}},"undefined"!=typeof amd?define(function(){return i}):"object"==typeof module&&module.exports&&(module.exports=i),t.Chart=i,i.noConflict=function(){return t.Chart=e,i}}).call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers={}),i=e.each=function(t,e,i,a){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;if(a)for(n=t.length-1;n>=0;n--)e.apply(i,[t[n],n].concat(s));else for(n=0;n<t.length;n++)e.apply(i,[t[n],n].concat(s))}else for(var o in t)e.apply(i,[t[o],o].concat(s))},a=e.clone=function(t){var s={};return i(t,function(i,n){t.hasOwnProperty(n)&&(e.isArray(i)?s[n]=i.slice(0):"object"==typeof i&&null!==i?s[n]=a(i):s[n]=i)}),s},s=e.extend=function(t){return i(Array.prototype.slice.call(arguments,1),function(e){i(e,function(i,a){e.hasOwnProperty(a)&&(t[a]=i)})}),t},n=(e.configMerge=function(t){var i=a(t);return e.each(Array.prototype.slice.call(arguments,1),function(t){e.each(t,function(a,s){if(t.hasOwnProperty(s))if("scales"===s)i[s]=e.scaleMerge(i.hasOwnProperty(s)?i[s]:{},a);else if("scale"===s)i[s]=e.configMerge(i.hasOwnProperty(s)?i[s]:{},Chart.scaleService.getScaleDefaults(a.type),a);else if(i.hasOwnProperty(s)&&e.isArray(i[s])&&e.isArray(a)){var n=i[s];e.each(a,function(t,i){i<n.length?"object"==typeof n[i]&&null!==n[i]&&"object"==typeof t&&null!==t?n[i]=e.configMerge(n[i],t):n[i]=t:n.push(t)})}else i.hasOwnProperty(s)&&"object"==typeof i[s]&&null!==i[s]&&"object"==typeof a?i[s]=e.configMerge(i[s],a):i[s]=a})}),i},e.extendDeep=function(t){function i(t){return e.each(arguments,function(a){a!==t&&e.each(a,function(e,a){t[a]&&t[a].constructor&&t[a].constructor===Object?i(t[a],e):t[a]=e})}),t}return i.apply(this,arguments)},e.scaleMerge=function(t,i){var s=a(t);return e.each(i,function(t,a){i.hasOwnProperty(a)&&("xAxes"===a||"yAxes"===a?s.hasOwnProperty(a)?e.each(t,function(t,i){i>=s[a].length||!s[a][i].type?s[a].push(e.configMerge(t.type?Chart.scaleService.getScaleDefaults(t.type):{},t)):t.type!==s[a][i].type?s[a][i]=e.configMerge(s[a][i],t.type?Chart.scaleService.getScaleDefaults(t.type):{},t):s[a][i]=e.configMerge(s[a][i],t)}):(s[a]=[],e.each(t,function(t){s[a].push(e.configMerge(t.type?Chart.scaleService.getScaleDefaults(t.type):{},t))})):s.hasOwnProperty(a)&&"object"==typeof s[a]&&null!==s[a]&&"object"==typeof t?s[a]=e.configMerge(s[a],t):s[a]=t)}),s},e.getValueAtIndexOrDefault=function(t,i,a){return void 0===t||null===t?a:e.isArray(t)?i<t.length?t[i]:a:t},e.indexOf=function(t,e){if(Array.prototype.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},e.where=function(t,i){var a=[];return e.each(t,function(t){i(t)&&a.push(t)}),a},e.findNextWhere=function(t,e,i){(void 0===i||null===i)&&(i=-1);for(var a=i+1;a<t.length;a++){var s=t[a];if(e(s))return s}},e.findPreviousWhere=function(t,e,i){(void 0===i||null===i)&&(i=t.length);for(var a=i-1;a>=0;a--){var s=t[a];if(e(s))return s}},e.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=i};return a.prototype=e.prototype,i.prototype=new a,i.extend=n,t&&s(i.prototype,t),i.__super__=e.prototype,i}),o=e.noop=function(){},r=(e.uid=function(){var t=0;return function(){return"chart-"+t++}}(),e.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},e.amd="function"==typeof define&&define.amd,e.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)}),h=(e.max=function(t){return Math.max.apply(Math,t)},e.min=function(t){return Math.min.apply(Math,t)},e.sign=function(t){return Math.sign?Math.sign(t):(t=+t,0===t||isNaN(t)?t:t>0?1:-1)},e.log10=function(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10},e.getDecimalPlaces=function(t){if(t%1!==0&&r(t)){var e=t.toString();if(e.indexOf("e-")<0)return e.split(".")[1].length;if(e.indexOf(".")<0)return parseInt(e.split("e-")[1]);var i=e.split(".")[1].split("e-");return i[0].length+parseInt(i[1])}return 0},e.toRadians=function(t){return t*(Math.PI/180)},e.toDegrees=function(t){return t*(180/Math.PI)},e.getAngleFromPoint=function(t,e){var i=e.x-t.x,a=e.y-t.y,s=Math.sqrt(i*i+a*a),n=Math.atan2(a,i);return n<-.5*Math.PI&&(n+=2*Math.PI),{angle:n,distance:s}},e.aliasPixel=function(t){return t%2===0?0:.5},e.splineCurve=function(t,e,i,a){var s=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),n=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2)),o=a*s/(s+n),r=a*n/(s+n);return{previous:{x:e.x-o*(i.x-t.x),y:e.y-o*(i.y-t.y)},next:{x:e.x+r*(i.x-t.x),y:e.y+r*(i.y-t.y)}}},e.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},e.previousItem=function(t,e,i){return i?0>=e?t[t.length-1]:t[e-1]:0>=e?t[0]:t[e-1]},e.niceNum=function(t,i){var a,s=Math.floor(e.log10(t)),n=t/Math.pow(10,s);return a=i?1.5>n?1:3>n?2:7>n?5:10:1>=n?1:2>=n?2:5>=n?5:10,a*Math.pow(10,s)},{}),l=(e.template=function(t,e){function i(t,e){var i;if(h.hasOwnProperty(t))i=h[t];else{var a="var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');";i=new Function("obj",a),h[t]=i}return e?i(e):i}return t instanceof Function?t(e):i(t,e)},e.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),-(a*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i)))},easeOutElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin(2*(1*t-e)*Math.PI/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,a=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.3*1.5),a<Math.abs(1)?(a=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/a),1>t?-.5*a*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i):a*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/i)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*t*t*(((e*=1.525)+1)*t-e):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-l.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*l.easeInBounce(2*t):.5*l.easeOutBounce(2*t-1)+.5}}),c=(e.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),e.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),e.getRelativePosition=function(t,e){var i,a,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX,a=s.touches[0].clientY):(i=s.clientX,a=s.clientY),i=Math.round((i-o.left)/(o.right-o.left)*n.width/e.currentDevicePixelRatio),a=Math.round((a-o.top)/(o.bottom-o.top)*n.height/e.currentDevicePixelRatio),{x:i,y:a}},e.addEvent=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}),u=e.removeEvent=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=o},d=(e.bindEvents=function(t,e,a){t.events||(t.events={}),i(e,function(e){t.events[e]=function(){a.apply(t,arguments)},c(t.chart.canvas,e,t.events[e])})},e.unbindEvents=function(t,e){i(e,function(e,i){u(t.chart.canvas,i,e)})},e.getConstraintWidth=function(t){var e,i=document.defaultView.getComputedStyle(t)["max-width"],a=document.defaultView.getComputedStyle(t.parentNode)["max-width"],s=null!==i&&"none"!==i,n=null!==a&&"none"!==a;return(s||n)&&(e=Math.min(s?parseInt(i,10):Number.POSITIVE_INFINITY,n?parseInt(a,10):Number.POSITIVE_INFINITY)),e}),f=e.getConstraintHeight=function(t){var e,i=document.defaultView.getComputedStyle(t)["max-height"],a=document.defaultView.getComputedStyle(t.parentNode)["max-height"],s=null!==i&&"none"!==i,n=null!==a&&"none"!==a;return(i||a)&&(e=Math.min(s?parseInt(i,10):Number.POSITIVE_INFINITY,n?parseInt(a,10):Number.POSITIVE_INFINITY)),e},m=(e.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(m(e,"padding-left"))+parseInt(m(e,"padding-right")),a=e.clientWidth-i,s=d(t);return void 0!==s&&(a=Math.min(a,s)),a},e.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(m(e,"padding-top"))+parseInt(m(e,"padding-bottom")),a=e.clientHeight-i,s=f(t);return void 0!==s&&(a=Math.min(a,s)),a},e.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)});e.getMaximumSize=e.getMaximumWidth,e.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,a=t.canvas.height;t.currentDevicePixelRatio=window.devicePixelRatio||1,1!==window.devicePixelRatio&&(e.canvas.height=a*window.devicePixelRatio,e.canvas.width=i*window.devicePixelRatio,e.scale(window.devicePixelRatio,window.devicePixelRatio),e.canvas.style.width=i+"px",e.canvas.style.height=a+"px",t.originalDevicePixelRatio=t.originalDevicePixelRatio||window.devicePixelRatio)},e.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},e.fontString=function(t,e,i){return e+" "+t+"px "+i},e.longestText=function(t,e,a){t.font=e;var s=0;return i(a,function(e){var i=t.measureText(e).width;s=i>s?i:s}),s},e.drawRoundedRectangle=function(t,e,i,a,s,n){t.beginPath(),t.moveTo(e+n,i),t.lineTo(e+a-n,i),t.quadraticCurveTo(e+a,i,e+a,i+n),t.lineTo(e+a,i+s-n),t.quadraticCurveTo(e+a,i+s,e+a-n,i+s),t.lineTo(e+n,i+s),t.quadraticCurveTo(e,i+s,e,i+s-n),t.lineTo(e,i+n),t.quadraticCurveTo(e,i,e+n,i),t.closePath()},e.color=function(t){return window.Color?window.Color(t):(console.log("Color.js not found!"),t)},e.addResizeListener=function(t,e){var i=document.createElement("iframe"),a="chartjs-hidden-iframe";i.classlist?i.classlist.add(a):i.setAttribute("class",a),i.style.width="100%",i.style.display="block",i.style.border=0,i.style.height=0,i.style.margin=0,i.style.position="absolute",i.style.left=0,i.style.right=0,i.style.top=0,i.style.bottom=0,t.insertBefore(i,t.firstChild);(i.contentWindow||i).onresize=function(){e&&e()}},e.removeResizeListener=function(t){var e=t.querySelector(".chartjs-hidden-iframe");e&&e.remove()},e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(arg)}}.call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers);Chart.elements={},Chart.Element=function(t){e.extend(this,t),this.initialize.apply(this,arguments)},e.extend(Chart.Element.prototype,{initialize:function(){},pivot:function(){return this._view||(this._view=e.clone(this._model)),this._start=e.clone(this._view),this},transition:function(t){return this._view||(this._view=e.clone(this._model)),this._start||this.pivot(),e.each(this._model,function(i,a){if("_"!==a[0]&&this._model.hasOwnProperty(a))if(this._view[a])if(this._model[a]===this._view[a]);else if("string"==typeof i)try{var s=e.color(this._start[a]).mix(e.color(this._model[a]),t);this._view[a]=s.rgbString()}catch(n){this._view[a]=i}else if("number"==typeof i){var o=void 0!==this._start[a]?this._start[a]:0;this._view[a]=(this._model[a]-o)*t+o}else this._view[a]=i;else"number"==typeof i?this._view[a]=i*t:this._view[a]=i||null;else;},this),1===t&&delete this._start,this},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return e.isNumber(this._model.x)&&e.isNumber(this._model.y)}}),Chart.Element.extend=e.inherits}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:function(){},onComplete:function(){}},e.Animation=e.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),e.animationService={frameDuration:17,animations:[],dropFrames:0,addAnimation:function(t,e,a,s){s||(t.animating=!0);for(var n=0;n<this.animations.length;++n)if(this.animations[n].chartInstance===t)return void(this.animations[n].animationObject=e);this.animations.push({chartInstance:t,animationObject:e}),1==this.animations.length&&i.requestAnimFrame.call(window,this.digestWrapper)},cancelAnimation:function(t){var e=i.findNextWhere(this.animations,function(e){return e.chartInstance===t});e&&(this.animations.splice(e,1),t.animating=!1)},digestWrapper:function(){e.animationService.startDigest.call(e.animationService)},startDigest:function(){var t=Date.now(),e=0;this.dropFrames>1&&(e=Math.floor(this.dropFrames),this.dropFrames=this.dropFrames%1);for(var a=0;a<this.animations.length;a++)null===this.animations[a].animationObject.currentStep&&(this.animations[a].animationObject.currentStep=0),this.animations[a].animationObject.currentStep+=1+e,this.animations[a].animationObject.currentStep>this.animations[a].animationObject.numSteps&&(this.animations[a].animationObject.currentStep=this.animations[a].animationObject.numSteps),this.animations[a].animationObject.render(this.animations[a].chartInstance,this.animations[a].animationObject),this.animations[a].animationObject.currentStep==this.animations[a].animationObject.numSteps&&(this.animations[a].chartInstance.animating=!1,this.animations.splice(a,1),a--);var s=Date.now(),n=(s-t)/this.frameDuration;this.dropFrames+=n,this.animations.length>0&&i.requestAnimFrame.call(window,this.digestWrapper)}}}.call(this),function(){"use strict";var t=this,e=(t.Chart,Chart.helpers);Chart.types={},Chart.instances={},Chart.controllers={},Chart.Controller=function(t){return this.chart=t,this.config=t.config,this.data=this.config.data,this.options=this.config.options=e.configMerge(Chart.defaults.global,Chart.defaults[this.config.type],this.config.options||{}),this.id=e.uid(),Chart.instances[this.id]=this,this.options.responsive&&this.resize(!0),this.initialize.call(this),this},e.extend(Chart.Controller.prototype,{initialize:function(){return this.bindEvents(),this.ensureScalesHaveIDs(),this.buildOrUpdateControllers(),this.buildScales(),this.resetElements(),this.initToolTip(),this.update(),this},clear:function(){return e.clear(this.chart),this},stop:function(){return Chart.animationService.cancelAnimation(this),this},resize:function(t){this.stop();var i=this.chart.canvas,a=e.getMaximumWidth(this.chart.canvas),s=this.options.maintainAspectRatio&&isNaN(this.chart.aspectRatio)===!1&&isFinite(this.chart.aspectRatio)&&0!==this.chart.aspectRatio?a/this.chart.aspectRatio:e.getMaximumHeight(this.chart.canvas);return i.width=this.chart.width=a,i.height=this.chart.height=s,e.retinaScale(this.chart),t||this.update(this.options.responsiveAnimationDuration),this},ensureScalesHaveIDs:function(){var t="x-axis-",i="y-axis-";this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(e,i){e.id=e.id||t+i},this),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(t,e){t.id=t.id||i+e},this))},buildScales:function(){if(this.scales={},this.options.scales&&(this.options.scales.xAxes&&this.options.scales.xAxes.length&&e.each(this.options.scales.xAxes,function(t,e){var i=Chart.scaleService.getScaleConstructor(t.type),a=new i({ctx:this.chart.ctx,options:t,data:this.data,id:t.id});this.scales[a.id]=a},this),this.options.scales.yAxes&&this.options.scales.yAxes.length&&e.each(this.options.scales.yAxes,function(t,e){var i=Chart.scaleService.getScaleConstructor(t.type),a=new i({ctx:this.chart.ctx,options:t,data:this.data,id:t.id});this.scales[a.id]=a},this)),this.options.scale){var t=Chart.scaleService.getScaleConstructor(this.options.scale.type),i=new t({ctx:this.chart.ctx,options:this.options.scale,data:this.data,chart:this.chart});this.scale=i}Chart.scaleService.update(this,this.chart.width,this.chart.height)},buildOrUpdateControllers:function(t){var i=[];if(e.each(this.data.datasets,function(e,a){e.type||(e.type=this.config.type);var s=e.type;return i.push(s),e.controller?void e.controller.updateIndex(a):(e.controller=new Chart.controllers[s](this,a),void(t&&e.controller.reset()))},this),i.length>1)for(var a=1;a<i.length;a++)if(i[a]!=i[a-1]){this.isCombo=!0;break}},resetElements:function(){e.each(this.data.datasets,function(t,e){t.controller.reset()},this)},update:function(t,i){Chart.scaleService.update(this,this.chart.width,this.chart.height),this.buildOrUpdateControllers(!0),e.each(this.data.datasets,function(t,e){t.controller.buildOrUpdateElements()},this),e.each(this.data.datasets,function(t,e){t.controller.update()},this),this.render(t,i)},render:function(t,i){if("undefined"!=typeof t&&0!==t||"undefined"==typeof t&&0!==this.options.animation.duration){var a=new Chart.Animation;a.numSteps=(t||this.options.animation.duration)/16.66,a.easing=this.options.animation.easing,a.render=function(t,i){var a=e.easingEffects[i.easing],s=i.currentStep/i.numSteps,n=a(s);t.draw(n,s,i.currentStep)},a.onAnimationProgress=this.options.onAnimationProgress,a.onAnimationComplete=this.options.onAnimationComplete,Chart.animationService.addAnimation(this,a,t,i)}else this.draw(),this.options.onAnimationComplete&&this.options.onAnimationComplete.call&&this.options.onAnimationComplete.call(this);return this},draw:function(t){var i=t||1;this.clear(),e.each(this.scales,function(t){t.draw(this.chartArea)},this),this.scale&&this.scale.draw(),e.each(this.data.datasets,function(e,i){e.controller.draw(t)},this),this.tooltip.transition(i).draw()},getElementAtEvent:function(t){var i=e.getRelativePosition(t,this.chart),a=[];return e.each(this.data.datasets,function(t,s){e.each(t.metaData,function(t,e){return t.inRange(i.x,i.y)?(a.push(t),a):void 0},this)},this),a},getElementsAtEvent:function(t){var i=e.getRelativePosition(t,this.chart),a=[];return e.each(this.data.datasets,function(t,s){e.each(t.metaData,function(t,e){t.inLabelRange(i.x,i.y)&&a.push(t)},this)},this),a},getDatasetAtEvent:function(t){for(var i=e.getRelativePosition(t,this.chart),a=[],s=0;s<this.data.datasets.length;s++)for(var n=0;n<this.data.datasets[s].metaData.length;n++)this.data.datasets[s].metaData[n].inLabelRange(i.x,i.y)&&e.each(this.data.datasets[s].metaData,function(t,e){a.push(t)},this);return a.length?a:[]},generateLegend:function(){return e.template(this.options.legendTemplate,this)},destroy:function(){this.clear(),e.unbindEvents(this,this.events),e.removeResizeListener(this.chart.canvas.parentNode);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,void 0!==this.chart.originalDevicePixelRatio&&this.chart.ctx.scale(1/this.chart.originalDevicePixelRatio,1/this.chart.originalDevicePixelRatio),t.style.width=this.chart.originalCanvasStyleWidth,t.style.height=this.chart.originalCanvasStyleHeight,delete Chart.instances[this.id]},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)},initToolTip:function(){this.tooltip=new Chart.Tooltip({_chart:this.chart,_data:this.data,_options:this.options},this)},bindEvents:function(){e.bindEvents(this,this.options.events,function(t){this.eventHandler(t)})},eventHandler:function(t){this.lastActive=this.lastActive||[],"mouseout"==t.type?this.active=[]:this.active=function(){switch(this.options.hover.mode){case"single":return this.getElementAtEvent(t);case"label":return this.getElementsAtEvent(t);case"dataset":return this.getDatasetAtEvent(t);default:return t}}.call(this),this.options.hover.onHover&&this.options.hover.onHover.call(this,this.active),("mouseup"==t.type||"click"==t.type)&&this.options.onClick&&this.options.onClick.call(this,t,this.active);if(this.lastActive.length)switch(this.options.hover.mode){case"single":this.data.datasets[this.lastActive[0]._datasetIndex].controller.removeHoverStyle(this.lastActive[0],this.lastActive[0]._datasetIndex,this.lastActive[0]._index);break;case"label":case"dataset":for(var i=0;i<this.lastActive.length;i++)this.data.datasets[this.lastActive[i]._datasetIndex].controller.removeHoverStyle(this.lastActive[i],this.lastActive[i]._datasetIndex,this.lastActive[i]._index)}if(this.active.length&&this.options.hover.mode)switch(this.options.hover.mode){case"single":this.data.datasets[this.active[0]._datasetIndex].controller.setHoverStyle(this.active[0]);break;case"label":case"dataset":for(var i=0;i<this.active.length;i++)this.data.datasets[this.active[i]._datasetIndex].controller.setHoverStyle(this.active[i])}if((this.options.tooltips.enabled||this.options.tooltips.custom)&&(this.tooltip.initialize(),this.active.length?(this.tooltip._model.opacity=1,e.extend(this.tooltip,{_active:this.active}),this.tooltip.update()):this.tooltip._model.opacity=0),this.tooltip.pivot(),!this.animating){var a;e.each(this.active,function(t,e){t!==this.lastActive[e]&&(a=!0)},this),(!this.lastActive.length&&this.active.length||this.lastActive.length&&!this.active.length||this.lastActive.length&&this.active.length&&a)&&(this.stop(),this.render(this.options.hover.animationDuration,!0))}return this.lastActive=this.active,this}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.scale={display:!0,gridLines:{show:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawOnChartArea:!0,drawTicks:!0,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",offsetGridLines:!1},ticks:{show:!0,minRotation:20,maxRotation:90,template:"<%=value%>",fontSize:12,fontStyle:"normal",fontColor:"#666",fontFamily:"Helvetica Neue"}},e.Scale=e.Element.extend({beforeUpdate:i.noop,update:function(t,e,i){return this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this.margins=i,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this.beforeBuildTicks(),this.buildTicks(),this.afterBuildTicks(),this.beforeCalculateTickRotation(),this.calculateTickRotation(),this.afterCalculateTickRotation(),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate(),this.minSize},afterUpdate:i.noop,beforeSetDimensions:i.noop,setDimensions:function(){this.isHorizontal()?this.width=this.maxWidth:this.height=this.maxHeight},afterSetDimensions:i.noop,beforeBuildTicks:i.noop,buildTicks:i.noop,afterBuildTicks:i.noop,beforeCalculateTickRotation:i.noop,calculateTickRotation:function(){var t=i.fontString(this.options.ticks.fontSize,this.options.ticks.fontStyle,this.options.ticks.fontFamily);this.ctx.font=t;var e,a,s=this.ctx.measureText(this.ticks[0]).width,n=this.ctx.measureText(this.ticks[this.ticks.length-1]).width;if(this.paddingRight=n/2+3,this.paddingLeft=s/2+3,this.labelRotation=0,this.options.display&&this.isHorizontal()){var o,r,h=i.longestText(this.ctx,t,this.ticks);this.labelWidth=h;for(var l=this.getPixelForTick(1)-this.getPixelForTick(0)-6;this.labelWidth>l&&this.labelRotation<=this.options.ticks.maxRotation;){if(o=Math.cos(i.toRadians(this.labelRotation)),r=Math.sin(i.toRadians(this.labelRotation)),e=o*s,a=o*n,e+this.options.ticks.fontSize/2>this.yLabelWidth&&(this.paddingLeft=e+this.options.ticks.fontSize/2),this.paddingRight=this.options.ticks.fontSize/2,r*h>this.maxHeight){this.labelRotation--;break}this.labelRotation++,this.labelWidth=o*h}}else this.labelWidth=0,this.paddingRight=0,this.paddingLeft=0;this.margins&&(this.paddingLeft-=this.margins.left,this.paddingRight-=this.margins.right,this.paddingLeft=Math.max(this.paddingLeft,0),this.paddingRight=Math.max(this.paddingRight,0))},afterCalculateTickRotation:i.noop,beforeFit:i.noop,fit:function(){if(this.minSize={width:0,height:0},this.isHorizontal()?this.minSize.width=this.maxWidth:this.minSize.width=this.options.gridLines.show&&this.options.display?10:0,this.isHorizontal()?this.minSize.height=this.options.gridLines.show&&this.options.display?10:0:this.minSize.height=this.maxHeight,this.paddingLeft=0,this.paddingRight=0,this.paddingTop=0,this.paddingBottom=0,this.options.ticks.show&&this.options.display){var t=i.fontString(this.options.ticks.fontSize,this.options.ticks.fontStyle,this.options.ticks.fontFamily);if(this.isHorizontal()){var e=(this.maxHeight-this.minSize.height,1.5*this.options.ticks.fontSize);this.minSize.height=Math.min(this.maxHeight,this.minSize.height+e),t=i.fontString(this.options.ticks.fontSize,this.options.ticks.fontStyle,this.options.ticks.fontFamily),this.ctx.font=t;var a=this.ctx.measureText(this.ticks[0]).width,s=this.ctx.measureText(this.ticks[this.ticks.length-1]).width;this.paddingLeft=a/2,this.paddingRight=s/2}else{var n=this.maxWidth-this.minSize.width,o=i.longestText(this.ctx,t,this.ticks);n>o?this.minSize.width+=o:this.minSize.width=this.maxWidth,this.paddingTop=this.options.ticks.fontSize/2,this.paddingBottom=this.options.ticks.fontSize/2}}this.margins&&(this.paddingLeft-=this.margins.left,this.paddingTop-=this.margins.top,this.paddingRight-=this.margins.right,this.paddingBottom-=this.margins.bottom,this.paddingLeft=Math.max(this.paddingLeft,0),this.paddingTop=Math.max(this.paddingTop,0),this.paddingRight=Math.max(this.paddingRight,0),this.paddingBottom=Math.max(this.paddingBottom,0)),this.width=this.minSize.width,this.height=this.minSize.height},afterFit:i.noop,isHorizontal:function(){return"top"==this.options.position||"bottom"==this.options.position},getPixelForValue:i.noop,getPixelForTick:function(t,e){if(this.isHorizontal()){var i=this.width-(this.paddingLeft+this.paddingRight),a=i/Math.max(this.ticks.length-(this.options.gridLines.offsetGridLines?0:1),1),s=a*t+this.paddingLeft;return e&&(s+=a/2),this.left+Math.round(s)}var n=this.height-(this.paddingTop+this.paddingBottom);return this.top+t*(n/(this.ticks.length-1))},getPixelForDecimal:function(t,e){if(this.isHorizontal()){var i=this.width-(this.paddingLeft+this.paddingRight),a=i*t+this.paddingLeft;return this.left+Math.round(a)}return this.top+t*(this.height/this.ticks.length)},draw:function(t){if(this.options.display){var e,a,s,n,o;if(this.ctx.fillStyle=this.options.ticks.fontColor,this.isHorizontal()){e=!0;var r="bottom"==this.options.position?this.top:this.bottom-10,h="bottom"==this.options.position?this.top+10:this.bottom;a=0!==this.labelRotation,s=!1,(this.options.ticks.fontSize+4)*this.ticks.length>this.width-(this.paddingLeft+this.paddingRight)&&(s=1+Math.floor((this.options.ticks.fontSize+4)*this.ticks.length/(this.width-(this.paddingLeft+this.paddingRight)))),i.each(this.ticks,function(n,o){if(!(s>1&&o%s>0||void 0===n||null===n)){var l=this.getPixelForTick(o),c=this.getPixelForTick(o,this.options.gridLines.offsetGridLines);this.options.gridLines.show&&(o===("undefined"!=typeof this.zeroLineIndex?this.zeroLineIndex:0)?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,e=!0):e&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,e=!1),l+=i.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(l,r),this.ctx.lineTo(l,h)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(l,t.top),this.ctx.lineTo(l,t.bottom)),this.ctx.stroke()),this.options.ticks.show&&(this.ctx.save(),this.ctx.translate(c,a?this.top+12:this.top+8),this.ctx.rotate(-1*i.toRadians(this.labelRotation)),this.ctx.font=this.font,this.ctx.textAlign=a?"right":"center",this.ctx.textBaseline=a?"middle":"top",this.ctx.fillText(n,0,0),this.ctx.restore())}},this),this.options.scaleLabel.show&&(this.ctx.textAlign="center",this.ctx.textBaseline="middle",this.ctx.font=i.fontString(this.options.scaleLabel.fontSize,this.options.scaleLabel.fontStyle,this.options.scaleLabel.fontFamily),n=this.left+(this.right-this.left)/2,o="bottom"==this.options.position?this.bottom-this.options.scaleLabel.fontSize/2:this.top+this.options.scaleLabel.fontSize/2,this.ctx.fillText(this.options.scaleLabel.labelString,n,o))}else{e=!0;var l="left"==this.options.position?this.right:this.left-10,c="left"==this.options.position?this.right+10:this.left;if(a=0!==this.labelRotation,i.each(this.ticks,function(a,s){var n=this.getPixelForTick(s),o=this.getPixelForTick(s,this.options.gridLines.offsetGridLines),r=this.left+this.width/2;this.options.gridLines.show&&(s===("undefined"!=typeof this.zeroLineIndex?this.zeroLineIndex:0)?(this.ctx.lineWidth=this.options.gridLines.zeroLineWidth,this.ctx.strokeStyle=this.options.gridLines.zeroLineColor,e=!0):e&&(this.ctx.lineWidth=this.options.gridLines.lineWidth,this.ctx.strokeStyle=this.options.gridLines.color,e=!1),n+=i.aliasPixel(this.ctx.lineWidth),this.ctx.beginPath(),this.options.gridLines.drawTicks&&(this.ctx.moveTo(l,n),this.ctx.lineTo(c,n)),this.options.gridLines.drawOnChartArea&&(this.ctx.moveTo(t.left,n),this.ctx.lineTo(t.right,n)),this.ctx.stroke()),this.options.ticks.show&&(this.ctx.save(),this.ctx.translate(r,o),this.ctx.rotate(-1*i.toRadians(this.labelRotation)),this.ctx.font=this.font,this.ctx.textAlign="center",this.ctx.textBaseline="middle",
++this.ctx.fillText(a,0,0),this.ctx.restore())},this),this.options.scaleLabel.show){n="left"==this.options.position?this.left+this.options.scaleLabel.fontSize/2:this.right-this.options.scaleLabel.fontSize/2,o=this.top+(this.bottom-this.top)/2;var u="left"==this.options.position?-.5*Math.PI:.5*Math.PI;this.ctx.save(),this.ctx.translate(n,o),this.ctx.rotate(u),this.ctx.textAlign="center",this.ctx.font=i.fontString(this.options.scaleLabel.fontSize,this.options.scaleLabel.fontStyle,this.options.scaleLabel.fontFamily),this.ctx.textBaseline="middle",this.ctx.fillText(this.options.scaleLabel.labelString,0,0),this.ctx.restore()}}}}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.scaleService={constructors:{},defaults:{},registerScaleType:function(t,a,s){this.constructors[t]=a,this.defaults[t]=i.extendDeep({},e.defaults.scale,s)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?this.defaults[t]:{}},update:function(t,e,a){var s=e>30?5:2,n=a>30?5:2;if(t){var o=i.where(t.scales,function(t){return"left"==t.options.position}),r=i.where(t.scales,function(t){return"right"==t.options.position}),h=i.where(t.scales,function(t){return"top"==t.options.position}),l=i.where(t.scales,function(t){return"bottom"==t.options.position}),c=e/2,u=a/2;c-=2*s,u-=2*n;var d=(e-c)/(o.length+r.length),f=(a-u)/(h.length+l.length),m=[],g=function(t){var e=t.update(d,u);m.push({horizontal:!1,minSize:e,scale:t})},p=function(t){var e=t.update(c,f);m.push({horizontal:!0,minSize:e,scale:t})};i.each(o,g),i.each(r,g),i.each(h,p),i.each(l,p);var v=a-2*n,b=e-2*s;i.each(m,function(t){t.horizontal?v-=t.minSize.height:b-=t.minSize.width});var y=function(t){var e=i.findNextWhere(m,function(e){return e.scale===t});e&&t.update(e.minSize.width,v)},x=function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:_,right:w,top:0,bottom:0};e&&t.update(b,e.minSize.height,a)},_=s,w=s,D=n,k=n;i.each(o,y),i.each(r,y),i.each(o,function(t){_+=t.width}),i.each(r,function(t){w+=t.width}),i.each(h,x),i.each(l,x),i.each(h,function(t){D+=t.height}),i.each(l,function(t){k+=t.height}),i.each(o,function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:0,right:0,top:D,bottom:k};e&&t.update(e.minSize.width,v,a)}),i.each(r,function(t){var e=i.findNextWhere(m,function(e){return e.scale===t}),a={left:0,right:0,top:D,bottom:k};e&&t.update(e.minSize.width,v,a)}),_=s,w=s,D=n,k=n,i.each(o,function(t){_+=t.width}),i.each(r,function(t){w+=t.width}),i.each(h,function(t){D+=t.height}),i.each(l,function(t){k+=t.height});var C=a-D-k,S=e-_-w;(S!==b||C!==v)&&(i.each(o,function(t){t.height=C}),i.each(r,function(t){t.height=C}),i.each(h,function(t){t.width=S}),i.each(l,function(t){t.width=S}),v=C,b=S);var M=s,A=n,P=function(t){t.left=M,t.right=M+t.width,t.top=D,t.bottom=D+v,M=t.right},I=function(t){t.left=_,t.right=_+b,t.top=A,t.bottom=A+t.height,A=t.bottom};i.each(o,P),i.each(h,I),M+=b,A+=v,i.each(r,P),i.each(l,I),t.chartArea={left:_,top:D,right:_+b,bottom:D+v}}}}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.tooltips={enabled:!0,custom:null,backgroundColor:"rgba(0,0,0,0.8)",fontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",fontSize:10,fontStyle:"normal",fontColor:"#fff",titleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",titleFontSize:12,titleFontStyle:"bold",titleFontColor:"#fff",yPadding:6,xPadding:6,caretSize:8,cornerRadius:6,xOffset:10,template:["<% if(label){ %>","<%=label %>: ","<% } %>","<%=value %>"].join(""),multiTemplate:["<%if (datasetLabel){ %>","<%=datasetLabel %>: ","<% } %>","<%=value %>"].join(""),multiKeyBackground:"#fff"},e.Tooltip=e.Element.extend({initialize:function(){var t=this._options;i.extend(this,{_model:{xPadding:t.tooltips.xPadding,yPadding:t.tooltips.yPadding,xOffset:t.tooltips.xOffset,textColor:t.tooltips.fontColor,_fontFamily:t.tooltips.fontFamily,_fontStyle:t.tooltips.fontStyle,fontSize:t.tooltips.fontSize,titleTextColor:t.tooltips.titleFontColor,_titleFontFamily:t.tooltips.titleFontFamily,_titleFontStyle:t.tooltips.titleFontStyle,titleFontSize:t.tooltips.titleFontSize,caretHeight:t.tooltips.caretSize,cornerRadius:t.tooltips.cornerRadius,backgroundColor:t.tooltips.backgroundColor,opacity:0,legendColorBackground:t.tooltips.multiKeyBackground}})},update:function(){var t=this._chart.ctx;switch(this._options.hover.mode){case"single":i.extend(this._model,{text:i.template(this._options.tooltips.template,{element:this._active[0],value:this._data.datasets[this._active[0]._datasetIndex].data[this._active[0]._index],label:void 0!==this._active[0]._model.label?this._active[0]._model.label:this._data.labels?this._data.labels[this._active[0]._index]:""})});var e=this._active[0].tooltipPosition();i.extend(this._model,{x:Math.round(e.x),y:Math.round(e.y),caretPadding:e.padding});break;case"label":for(var a,s,n=[],o=[],r=this._data.datasets.length-1;r>=0&&(a=this._data.datasets[r].metaData,s=i.indexOf(a,this._active[0]),-1===s);r--);var h=function(t){var e,a,r,h,l,c=[],u=[],d=[];return i.each(this._data.datasets,function(t){e=t.metaData,e[s]&&e[s].hasValue()&&c.push(e[s])},this),i.each(this._options.stacked?c.reverse():c,function(t){u.push(t._view.x),d.push(t._view.y),n.push(i.template(this._options.tooltips.multiTemplate,{element:t,datasetLabel:this._data.datasets[t._datasetIndex].label,value:this._data.datasets[t._datasetIndex].data[t._index]})),o.push({fill:t._view.backgroundColor,stroke:t._view.borderColor})},this),l=i.min(d),r=i.max(d),h=i.min(u),a=i.max(u),{x:h>this._chart.width/2?h:a,y:(l+r)/2}}.call(this,s);i.extend(this._model,{x:h.x,y:h.y,labels:n,title:function(){return this._data.timeLabels?this._data.timeLabels[this._active[0]._index]:this._data.labels&&this._data.labels.length?this._data.labels[this._active[0]._index]:""}.call(this),legendColors:o,legendBackgroundColor:this._options.tooltips.multiKeyBackground}),this._model.height=n.length*this._model.fontSize+(n.length-1)*(this._model.fontSize/2)+2*this._model.yPadding+1.5*this._model.titleFontSize;var l=t.measureText(this._model.title).width,c=i.longestText(t,this.font,n)+this._model.fontSize+3,u=i.max([c,l]);this._model.width=u+2*this._model.xPadding;var d=this._model.height/2;this._model.y-d<0?this._model.y=d:this._model.y+d>this._chart.height&&(this._model.y=this._chart.height-d),this._model.x>this._chart.width/2?this._model.x-=this._model.xOffset+this._model.width:this._model.x+=this._model.xOffset}return this},draw:function(){var t=this._chart.ctx,e=this._view;switch(this._options.hover.mode){case"single":t.font=i.fontString(e.fontSize,e._fontStyle,e._fontFamily),e.xAlign="center",e.yAlign="above";var a=e.caretPadding||2,s=t.measureText(e.text).width+2*e.xPadding,n=e.fontSize+2*e.yPadding,o=n+e.caretHeight+a;e.x+s/2>this._chart.width?e.xAlign="left":e.x-s/2<0&&(e.xAlign="right"),e.y-o<0&&(e.yAlign="below");var r=e.x-s/2,h=e.y-o;if(t.fillStyle=i.color(e.backgroundColor).alpha(e.opacity).rgbString(),this._options.tooltips.custom&&this._options.tooltips.custom(this),!this._options.tooltips.enabled)return;switch(e.yAlign){case"above":t.beginPath(),t.moveTo(e.x,e.y-a),t.lineTo(e.x+e.caretHeight,e.y-(a+e.caretHeight)),t.lineTo(e.x-e.caretHeight,e.y-(a+e.caretHeight)),t.closePath(),t.fill();break;case"below":h=e.y+a+e.caretHeight,t.beginPath(),t.moveTo(e.x,e.y+a),t.lineTo(e.x+e.caretHeight,e.y+a+e.caretHeight),t.lineTo(e.x-e.caretHeight,e.y+a+e.caretHeight),t.closePath(),t.fill()}switch(e.xAlign){case"left":r=e.x-s+(e.cornerRadius+e.caretHeight);break;case"right":r=e.x-(e.cornerRadius+e.caretHeight)}i.drawRoundedRectangle(t,r,h,s,n,e.cornerRadius),t.fill(),t.fillStyle=i.color(e.textColor).alpha(e.opacity).rgbString(),t.textAlign="center",t.textBaseline="middle",t.fillText(e.text,r+s/2,h+n/2);break;case"label":if(this._options.tooltips.custom&&this._options.tooltips.custom(this),!this._options.tooltips.enabled)return;i.drawRoundedRectangle(t,e.x,e.y-e.height/2,e.width,e.height,e.cornerRadius),t.fillStyle=i.color(e.backgroundColor).alpha(e.opacity).rgbString(),t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=i.color(e.titleTextColor).alpha(e.opacity).rgbString(),t.font=i.fontString(e.fontSize,e._titleFontStyle,e._titleFontFamily),t.fillText(e.title,e.x+e.xPadding,this.getLineHeight(0)),t.font=i.fontString(e.fontSize,e._fontStyle,e._fontFamily),i.each(e.labels,function(a,s){t.fillStyle=i.color(e.textColor).alpha(e.opacity).rgbString(),t.fillText(a,e.x+e.xPadding+e.fontSize+3,this.getLineHeight(s+1)),t.fillStyle=i.color(e.legendColors[s].stroke).alpha(e.opacity).rgbString(),t.fillRect(e.x+e.xPadding-1,this.getLineHeight(s+1)-e.fontSize/2-1,e.fontSize+2,e.fontSize+2),t.fillStyle=i.color(e.legendColors[s].fill).alpha(e.opacity).rgbString(),t.fillRect(e.x+e.xPadding,this.getLineHeight(s+1)-e.fontSize/2,e.fontSize,e.fontSize)},this)}},getLineHeight:function(t){var e=this._view.y-this._view.height/2+this._view.yPadding,i=t-1;return 0===t?e+this._view.titleFontSize/2:e+(1.5*this._view.fontSize*i+this._view.fontSize/2)+1.5*this._view.titleFontSize}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},e.controllers.bar=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.bar.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){this.getDataset().xAxisID||(this.getDataset().xAxisID=this.chart.options.scales.xAxes[0].id),this.getDataset().yAxisID||(this.getDataset().yAxisID=this.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForID:function(t){return this.chart.scales[t]},getBarCount:function(){var t=0;return i.each(this.chart.data.datasets,function(e){"bar"===e.type?++t:void 0===e.type&&"bar"===this.chart.config.type&&++t},this),t},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:t}),a=this.getBarCount();this.updateElement(i,t,!0,a),this.getDataset().metaData.splice(t,0,i)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},buildOrUpdateElements:function(){var t=this.getDataset().data.length,e=this.getDataset().metaData.length;if(e>t)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},update:function(t){var e=this.getBarCount();i.each(this.getDataset().metaData,function(i,a){this.updateElement(i,a,t,e)},this)},updateElement:function(t,e,a,s){var n,o=this.getScaleForID(this.getDataset().xAxisID),r=this.getScaleForID(this.getDataset().yAxisID);n=r.getPixelForValue(r.min<0&&r.max<0?r.max:r.min>0&&r.max>0?r.min:0),i.extend(t,{_chart:this.chart.chart,_xScale:o,_yScale:r,_datasetIndex:this.index,_index:e,_model:{x:this.calculateBarX(e,this.index),y:a?n:this.calculateBarY(e,this.index),label:this.chart.data.labels[e],datasetLabel:this.getDataset().label,base:this.calculateBarBase(this.index,e),width:this.calculateBarWidth(s),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.rectangle.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.rectangle.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.rectangle.borderWidth)}}),t.pivot()},calculateBarBase:function(t,e){var i=(this.getScaleForID(this.getDataset().xAxisID),this.getScaleForID(this.getDataset().yAxisID)),a=0;if(i.options.stacked){var s=this.chart.data.datasets[t].data[e];if(0>s)for(var n=0;t>n;n++)this.chart.data.datasets[n].yAxisID===i.id&&(a+=this.chart.data.datasets[n].data[e]<0?this.chart.data.datasets[n].data[e]:0);else for(var o=0;t>o;o++)this.chart.data.datasets[o].yAxisID===i.id&&(a+=this.chart.data.datasets[o].data[e]>0?this.chart.data.datasets[o].data[e]:0);return i.getPixelForValue(a)}return a=i.getPixelForValue(i.min),i.beginAtZero||i.min<=0&&i.max>=0||i.min>=0&&i.max<=0?a=i.getPixelForValue(0,0):i.min<0&&i.max<0&&(a=i.getPixelForValue(i.max)),a},getRuler:function(){var t=this.getScaleForID(this.getDataset().xAxisID),e=(this.getScaleForID(this.getDataset().yAxisID),this.chart.isCombo?i.where(this.chart.data.datasets,function(t){return"bar"==t.type}).length:this.chart.data.datasets.length),a=function(){for(var e=t.getPixelForValue(null,1)-t.getPixelForValue(null,0),i=2;i<this.getDataset().data.length;i++)e=Math.min(t.getPixelForValue(null,i)-t.getPixelForValue(null,i-1),e);return e}.call(this),s=a*t.options.categoryPercentage,n=(a-a*t.options.categoryPercentage)/2,o=s/e,r=o*t.options.barPercentage,h=o-o*t.options.barPercentage;return{datasetCount:e,tickWidth:a,categoryWidth:s,categorySpacing:n,fullBarWidth:o,barWidth:r,barSpacing:h}},calculateBarWidth:function(){var t=this.getScaleForID(this.getDataset().xAxisID),e=this.getRuler();return t.options.stacked?e.categoryWidth:e.barWidth},calculateBarX:function(t,e){var i=this.getScaleForID(this.getDataset().yAxisID),a=this.getScaleForID(this.getDataset().xAxisID),s=this.getRuler(),n=a.getPixelForValue(null,t,e);return n-=this.chart.isCombo?s.tickWidth/2:0,i.options.stacked?n+s.categoryWidth/2+s.categorySpacing:n+s.barWidth/2+s.categorySpacing+s.barWidth*e+s.barSpacing/2+s.barSpacing*e},calculateBarY:function(t,e){var i=(this.getScaleForID(this.getDataset().xAxisID),this.getScaleForID(this.getDataset().yAxisID)),a=this.getDataset().data[t];if(i.options.stacked){for(var s=0,n=0,o=0;e>o;o++)this.chart.data.datasets[o].data[t]<0?n+=this.chart.data.datasets[o].data[t]||0:s+=this.chart.data.datasets[o].data[t]||0;return i.getPixelForValue(0>a?n+a:s+a)}return i.getPixelForValue(a)},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.hoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.rectangle.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.rectangle.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.rectangle.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.doughnut={animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},cutoutPercentage:50},e.defaults.pie=i.clone(e.defaults.doughnut),i.extend(e.defaults.pie,{cutoutPercentage:0}),e.controllers.doughnut=e.controllers.pie=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.doughnut.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t,a){this.getDataset().metaData=this.getDataset().metaData||[];var s=new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});a&&i.isArray(this.getDataset().backgroundColor)&&this.getDataset().backgroundColor.splice(t,0,a),this.updateElement(s,t,!0),this.getDataset().metaData.splice(t,0,s)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},buildOrUpdateElements:function(){var t=this.getDataset().data.length,e=this.getDataset().metaData.length;if(e>t)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},update:function(t){this.chart.outerRadius=Math.max(i.min([this.chart.chart.width,this.chart.chart.height])/2-this.chart.options.elements.arc.borderWidth/2,0),this.chart.innerRadius=Math.max(this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,0),this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.chart.data.datasets.length,this.getDataset().total=0,i.each(this.getDataset().data,function(t){this.getDataset().total+=Math.abs(t)},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.index,this.innerRadius=this.outerRadius-this.chart.radiusLength,i.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,e,a){var s={x:this.chart.chart.width/2,y:this.chart.chart.height/2,startAngle:Math.PI*-.5,circumference:this.chart.options.animation.animateRotate?0:this.calculateCircumference(this.getDataset().data[e]),outerRadius:this.chart.options.animation.animateScale?0:this.outerRadius,innerRadius:this.chart.options.animation.animateScale?0:this.innerRadius};i.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:e,_model:a?s:{x:this.chart.chart.width/2,y:this.chart.chart.height/2,circumference:this.calculateCircumference(this.getDataset().data[e]),outerRadius:this.outerRadius,innerRadius:this.innerRadius,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.getDataset().label,e,this.chart.data.labels[e])}}),a||(0===e?t._model.startAngle=Math.PI*-.5:t._model.startAngle=this.getDataset().metaData[e-1]._model.endAngle,t._model.endAngle=t._model.startAngle+t._model.circumference,e<this.getDataset().data.length-1&&(this.getDataset().metaData[e+1]._model.startAngle=t._model.endAngle)),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.hoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){return this.getDataset().total>0?1.999999*Math.PI*(t/this.getDataset().total):0}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.line={hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}},e.controllers.line=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.line.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){this.getDataset().xAxisID||(this.getDataset().xAxisID=this.chart.options.scales.xAxes[0].id),this.getDataset().yAxisID||(this.getDataset().yAxisID=this.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new e.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData}),i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i),this.updateBezierControlPoints()},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},buildOrUpdateElements:function(){var t=this.getDataset().data.length,e=this.getDataset().metaData.length;if(e>t)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},update:function(t){var e,a=this.getDataset().metaDataset,s=this.getDataset().metaData,n=this.getScaleForId(this.getDataset().yAxisID);this.getScaleForId(this.getDataset().xAxisID);e=n.getPixelForValue(n.min<0&&n.max<0?n.max:n.min>0&&n.max>0?n.min:0),i.extend(a,{_scale:n,_datasetIndex:this.index,_children:s,_model:{tension:a.custom&&a.custom.tension?a.custom.tension:this.getDataset().tension||this.chart.options.elements.line.tension,backgroundColor:a.custom&&a.custom.backgroundColor?a.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:a.custom&&a.custom.borderWidth?a.custom.borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:a.custom&&a.custom.borderColor?a.custom.borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,borderCapStyle:a.custom&&a.custom.borderCapStyle?a.custom.borderCapStyle:this.getDataset().borderCapStyle||this.chart.options.elements.line.borderCapStyle,borderDash:a.custom&&a.custom.borderDash?a.custom.borderDash:this.getDataset().borderDash||this.chart.options.elements.line.borderDash,borderDashOffset:a.custom&&a.custom.borderDashOffset?a.custom.borderDashOffset:this.getDataset().borderDashOffset||this.chart.options.elements.line.borderDashOffset,borderJoinStyle:a.custom&&a.custom.borderJoinStyle?a.custom.borderJoinStyle:this.getDataset().borderJoinStyle||this.chart.options.elements.line.borderJoinStyle,fill:a.custom&&a.custom.fill?a.custom.fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,skipNull:void 0!==this.getDataset().skipNull?this.getDataset().skipNull:this.chart.options.elements.line.skipNull,drawNull:void 0!==this.getDataset().drawNull?this.getDataset().drawNull:this.chart.options.elements.line.drawNull,scaleTop:n.top,scaleBottom:n.bottom,scaleZero:e}}),a.pivot(),i.each(s,function(e,i){this.updateElement(e,i,t)},this),this.updateBezierControlPoints()},updateElement:function(t,e,a){var s,n=this.getScaleForId(this.getDataset().yAxisID),o=this.getScaleForId(this.getDataset().xAxisID);s=n.getPixelForValue(n.min<0&&n.max<0?n.max:n.min>0&&n.max>0?n.min:0),i.extend(t,{_chart:this.chart.chart,_xScale:o,_yScale:n,_datasetIndex:this.index,_index:e,_model:{x:o.getPixelForValue(this.getDataset().data[e],e,this.index,this.chart.isCombo),y:a?s:n.getPixelForValue(this.getDataset().data[e],e,this.index),tension:t.custom&&t.custom.tension?t.custom.tension:this.getDataset().tension||this.chart.options.elements.line.tension,radius:t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth),skip:t.custom&&t.custom.skip?t.custom.skip:null===this.getDataset().data[e],hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:i.getValueAtIndexOrDefault(this.getDataset().hitRadius,e,this.chart.options.elements.point.hitRadius)}})},updateBezierControlPoints:function(){i.each(this.getDataset().metaData,function(t,e){var a=i.splineCurve(i.previousItem(this.getDataset().metaData,e)._model,t._model,i.nextItem(this.getDataset().metaData,e)._model,t._model.tension);t._model.controlPointPreviousX=a.previous.x,t._model.controlPointNextX=a.next.x,a.next.y>this.chart.chartArea.bottom?t._model.controlPointNextY=this.chart.chartArea.bottom:a.next.y<this.chart.chartArea.top?t._model.controlPointNextY=this.chart.chartArea.top:t._model.controlPointNextY=a.next.y,a.previous.y>this.chart.chartArea.bottom?t._model.controlPointPreviousY=this.chart.chartArea.bottom:a.previous.y<this.chart.chartArea.top?t._model.controlPointPreviousY=this.chart.chartArea.top:t._model.controlPointPreviousY=a.previous.y,t.pivot()},this)},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e)},this),this.getDataset().metaDataset.transition(e).draw(),i.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.radius=t.custom&&t.custom.hoverRadius?t.custom.hoverRadius:i.getValueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.pointHoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.pointHoverBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.polarArea={scale:{type:"radialLinear",lineArc:!0},animateRotate:!0,animateScale:!0},e.controllers.polarArea=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.polarArea.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Arc({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i)},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},buildOrUpdateElements:function(){var t=this.getDataset().data.length,e=this.getDataset().metaData.length;if(e>t)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},update:function(t){e.scaleService.update(this,this.chart.width,this.chart.height),this.chart.scale.calculateRange(),this.chart.scale.generateTicks(),this.chart.scale.buildYLabels(),this.chart.outerRadius=Math.max((i.min([this.chart.chart.width,this.chart.chart.height])-this.chart.options.elements.arc.borderWidth/2)/2,0),this.chart.innerRadius=Math.max(this.chart.options.cutoutPercentage?this.chart.outerRadius/100*this.chart.options.cutoutPercentage:1,0),this.chart.radiusLength=(this.chart.outerRadius-this.chart.innerRadius)/this.chart.data.datasets.length,this.getDataset().total=0,i.each(this.getDataset().data,function(t){this.getDataset().total+=Math.abs(t)},this),this.outerRadius=this.chart.outerRadius-this.chart.radiusLength*this.index,this.innerRadius=this.outerRadius-this.chart.radiusLength,i.each(this.getDataset().metaData,function(e,i){this.updateElement(e,i,t)},this)},updateElement:function(t,e,a){var s=1/this.getDataset().data.length*2,n=-.5*Math.PI+Math.PI*s*e,o=n+s*Math.PI,r={x:this.chart.chart.width/2,y:this.chart.chart.height/2,innerRadius:0,outerRadius:this.chart.options.animateScale?0:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[e]),startAngle:this.chart.options.animateRotate?Math.PI*-.5:n,
++endAngle:this.chart.options.animateRotate?Math.PI*-.5:o,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.chart.data.labels,e,this.chart.data.labels[e])};i.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:e,_model:a?r:{x:this.chart.chart.width/2,y:this.chart.chart.height/2,innerRadius:0,outerRadius:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[e]),startAngle:n,endAngle:o,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),hoverBackgroundColor:t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(this.getDataset().hoverBackgroundColor,e,this.chart.options.elements.arc.hoverBackgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.chart.data.labels,e,this.chart.data.labels[e])}}),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e).draw()},this)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.borderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){return this.getDataset().total>0?2*Math.PI*(t/this.getDataset().total):0},updateScaleRange:function(){i.extend(this.chart.scale,{size:i.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.radar={scale:{type:"radialLinear"},elements:{line:{tension:0}}},e.controllers.radar=function(t,e){this.initialize.call(this,t,e)},i.extend(e.controllers.radar.prototype,{initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){},getDataset:function(){return this.chart.data.datasets[this.index]},getScaleForId:function(t){return this.chart.scales[t]},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new e.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData,_loop:!0}),i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_model:{x:0,y:0}})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i),this.updateBezierControlPoints()},removeElement:function(t){this.getDataset().metaData.splice(t,1)},reset:function(){this.update(!0)},buildOrUpdateElements:function(){var t=this.getDataset().data.length,e=this.getDataset().metaData.length;if(e>t)this.getDataset().metaData.splice(t,e-t);else if(t>e)for(var i=e;t>i;++i)this.addElementAndReset(i)},update:function(t){var e,a=(this.getDataset().metaDataset,this.getDataset().metaData),s=this.chart.scale;s.setScaleSize(),s.calculateRange(),s.generateTicks(),s.buildYLabels(),e=s.min<0&&s.max<0?s.getPointPositionForValue(0,s.max):s.min>0&&s.max>0?s.getPointPositionForValue(0,s.min):s.getPointPositionForValue(0,0),i.extend(this.getDataset().metaDataset,{_datasetIndex:this.index,_children:this.getDataset().metaData,_model:{tension:this.getDataset().tension||this.chart.options.elements.line.tension,backgroundColor:this.getDataset().backgroundColor||this.chart.options.elements.line.backgroundColor,borderWidth:this.getDataset().borderWidth||this.chart.options.elements.line.borderWidth,borderColor:this.getDataset().borderColor||this.chart.options.elements.line.borderColor,fill:void 0!==this.getDataset().fill?this.getDataset().fill:this.chart.options.elements.line.fill,skipNull:void 0!==this.getDataset().skipNull?this.getDataset().skipNull:this.chart.options.elements.line.skipNull,drawNull:void 0!==this.getDataset().drawNull?this.getDataset().drawNull:this.chart.options.elements.line.drawNull,scaleTop:s.top,scaleBottom:s.bottom,scaleZero:e}}),this.getDataset().metaDataset.pivot(),i.each(a,function(e,i){this.updateElement(e,i,t)},this),this.updateBezierControlPoints()},updateElement:function(t,e,a){var s=this.chart.scale.getPointPositionForValue(e,this.getDataset().data[e]);i.extend(t,{_datasetIndex:this.index,_index:e,_model:{x:a?this.chart.scale.xCenter:s.x,y:a?this.chart.scale.yCenter:s.y,tension:t.custom&&t.custom.tension?t.custom.tension:this.chart.options.elements.line.tension,radius:t.custom&&t.custom.radius?t.custom.pointRadius:i.getValueAtIndexOrDefault(this.getDataset().pointRadius,e,this.chart.options.elements.point.radius),backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth),skip:t.custom&&t.custom.skip?t.custom.skip:null===this.getDataset().data[e],hitRadius:t.custom&&t.custom.hitRadius?t.custom.hitRadius:i.getValueAtIndexOrDefault(this.getDataset().hitRadius,e,this.chart.options.elements.point.hitRadius)}})},updateBezierControlPoints:function(){i.each(this.getDataset().metaData,function(t,e){var a=i.splineCurve(i.previousItem(this.getDataset().metaData,e,!0)._model,t._model,i.nextItem(this.getDataset().metaData,e,!0)._model,t._model.tension);t._model.controlPointPreviousX=a.previous.x,t._model.controlPointNextX=a.next.x,a.next.y>this.chart.chartArea.bottom?t._model.controlPointNextY=this.chart.chartArea.bottom:a.next.y<this.chart.chartArea.top?t._model.controlPointNextY=this.chart.chartArea.top:t._model.controlPointNextY=a.next.y,a.previous.y>this.chart.chartArea.bottom?t._model.controlPointPreviousY=this.chart.chartArea.bottom:a.previous.y<this.chart.chartArea.top?t._model.controlPointPreviousY=this.chart.chartArea.top:t._model.controlPointPreviousY=a.previous.y,t.pivot()},this)},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e)},this),this.getDataset().metaDataset.transition(e).draw(),i.each(this.getDataset().metaData,function(t){t.draw()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],a=t._index;t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(e.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.pointHoverBackgroundColor,a,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.pointHoverBorderColor,a,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.pointBorderWidth,a,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.radius=t.custom&&t.custom.radius?t.custom.radius:i.getValueAtIndexOrDefault(this.getDataset().radius,e,this.chart.options.elements.point.radius),t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().pointBackgroundColor,e,this.chart.options.elements.point.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().pointBorderColor,e,this.chart.options.elements.point.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().pointBorderWidth,e,this.chart.options.elements.point.borderWidth)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,i=(e.helpers,{position:"bottom"}),a=e.Scale.extend({buildTicks:function(t){this.ticks=this.data.labels},getPixelForValue:function(t,e,i,a){if(this.isHorizontal()){var s=this.width-(this.paddingLeft+this.paddingRight),n=s/Math.max(this.data.labels.length-(this.options.gridLines.offsetGridLines?0:1),1),o=n*e+this.paddingLeft;return this.options.gridLines.offsetGridLines&&a&&(o+=n/2),this.left+Math.round(o)}return this.top+e*(this.height/this.labels.length)}});e.scaleService.registerScaleType("category",a,i)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={position:"left"},s=e.Scale.extend({buildTicks:function(){this.min=null,this.max=null;var t=[],e=[];if(this.options.stacked){i.each(this.data.datasets,function(a){(this.isHorizontal()?a.xAxisID===this.id:a.yAxisID===this.id)&&i.each(a.data,function(i,a){var s=this.getRightValue(i);t[a]=t[a]||0,e[a]=e[a]||0,this.options.relativePoints?t[a]=100:0>s?e[a]+=s:t[a]+=s},this)},this);var a=t.concat(e);this.min=i.min(a),this.max=i.max(a)}else i.each(this.data.datasets,function(t){(this.isHorizontal()?t.xAxisID===this.id:t.yAxisID===this.id)&&i.each(t.data,function(t,e){var i=this.getRightValue(t);null===this.min?this.min=i:i<this.min&&(this.min=i),null===this.max?this.max=i:i>this.max&&(this.max=i)},this)},this);this.min===this.max&&(this.min--,this.max++),this.ticks=[];var s;if(s=this.isHorizontal()?Math.min(11,Math.ceil(this.width/50)):Math.min(11,Math.ceil(this.height/(2*this.options.ticks.fontSize))),s=Math.max(2,s),this.options.beginAtZero){var n=i.sign(this.min),o=i.sign(this.max);0>n&&0>o?this.max=0:n>0&&o>0&&(this.min=0)}for(var r=i.niceNum(this.max-this.min,!1),h=i.niceNum(r/(s-1),!0),l=Math.floor(this.min/h)*h,c=Math.ceil(this.max/h)*h,u=l;c>=u;u+=h)this.ticks.push(u);("left"==this.options.position||"right"==this.options.position)&&this.ticks.reverse(),this.max=i.max(this.ticks),this.min=i.min(this.ticks),this.options.reverse?(this.ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.max,this.end=this.min),this.zeroLineIndex=this.ticks.indexOf(0)},getPixelForValue:function(t,e,i,a){var s,n=this.end-this.start;if(this.isHorizontal()){var o=this.width-(this.paddingLeft+this.paddingRight);return s=this.left+o/n*(this.getRightValue(t)-this.start),Math.round(s+this.paddingLeft)}var r=this.height-(this.paddingTop+this.paddingBottom);return s=this.top+r/n*(this.getRightValue(t)-this.start),Math.round(s+this.paddingTop)},getRightValue:function(t){return"object"==typeof t&&null!==t?this.isHorizontal()?t.x:t.y:t}});e.scaleService.registerScaleType("linear",s,a)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={position:"left",scaleLabel:{labelString:"",show:!1},labels:{template:"<%var remain = value / (Math.pow(10, Math.floor(Chart.helpers.log10(value))));if (remain === 1 || remain === 2 || remain === 5) {%><%=value.toExponential()%><%} else {%><%= null %><%}%>"}},s=e.Scale.extend({buildTicks:function(){this.min=null,this.max=null;var t=[];this.options.stacked?(i.each(this.data.datasets,function(e){(this.isHorizontal()?e.xAxisID===this.id:e.yAxisID===this.id)&&i.each(e.data,function(e,i){var a=this.getRightValue(e);t[i]=t[i]||0,this.options.relativePoints?t[i]=100:t[i]+=a},this)},this),this.min=i.min(t),this.max=i.max(t)):i.each(this.data.datasets,function(t){(this.isHorizontal()?t.xAxisID===this.id:t.yAxisID===this.id)&&i.each(t.data,function(t,e){var i=this.getRightValue(t);null===this.min?this.min=i:i<this.min&&(this.min=i),null===this.max?this.max=i:i>this.max&&(this.max=i)},this)},this),this.min===this.max&&(0!==this.min&&null!==this.min?(this.min=Math.pow(10,Math.floor(i.log10(this.min))-1),this.max=Math.pow(10,Math.floor(i.log10(this.max))+1)):(this.min=1,this.max=10)),this.tickValues=[];for(var e=Math.floor(i.log10(this.min)),a=Math.ceil(i.log10(this.max)),s=e;a>s;++s)for(var n=1;10>n;++n)this.tickValues.push(n*Math.pow(10,s));this.tickValues.push(1*Math.pow(10,a)),("left"==this.options.position||"right"==this.options.position)&&this.tickValues.reverse(),this.max=i.max(this.tickValues),this.min=i.min(this.tickValues),this.options.reverse?(this.tickValues.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),this.ticks=[],i.each(this.tickValues,function(t,e,a){var s;this.options.labels.userCallback?s=this.options.labels.userCallback(t,e,a):this.options.labels.template&&(s=i.template(this.options.labels.template,{value:t})),this.ticks.push(s)},this)},getRightValue:function(t){return"object"==typeof t?this.isHorizontal()?t.x:t.y:t},getPixelForTick:function(t,e){return this.getPixelForValue(this.tickValues[t],null,null,e)},getPixelForValue:function(t,e,a,s){var n,o=this.getRightValue(t),r=i.log10(this.end)-i.log10(this.start);if(this.isHorizontal()){if(0!==o){var h=this.width-(this.paddingLeft+this.paddingRight);return n=this.left+h/r*(i.log10(o)-i.log10(this.start)),n+this.paddingLeft}n=this.left+this.paddingLeft}else{if(0!==o){var l=this.height-(this.paddingTop+this.paddingBottom);return this.bottom-this.paddingBottom-l/r*(i.log10(o)-i.log10(this.start))}n=this.top+this.paddingTop}}});e.scaleService.registerScaleType("logarithmic",s,a)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={display:!0,animate:!0,lineArc:!1,gridLines:{show:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},angleLines:{show:!0,color:"rgba(0,0,0, 0.1)",lineWidth:1},reverse:!1,beginAtZero:!0,labels:{show:!0,template:"<%=value.toLocaleString()%>",fontSize:12,fontStyle:"normal",fontColor:"#666",fontFamily:"Helvetica Neue",showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2},pointLabels:{fontFamily:"'Arial'",fontStyle:"normal",fontSize:10,fontColor:"#666"}},s=e.Element.extend({initialize:function(){this.height=this.chart.height,this.width=this.chart.width,this.xCenter=this.chart.width/2,this.yCenter=this.chart.height/2,this.size=i.min([this.height,this.width]),this.labels=this.data.labels,this.drawingArea=this.options.display?this.size/2-(this.options.labels.fontSize/2+this.options.labels.backdropPaddingY):this.size/2},getValueCount:function(){return this.data.labels.length},update:function(){this.options.lineArc?this.drawingArea=this.options.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},calculateRange:function(){this.min=null,this.max=null,i.each(this.data.datasets,function(t){i.each(t.data,function(t,e){null!==t&&(null===this.min?this.min=t:t<this.min&&(this.min=t),null===this.max?this.max=t:t>this.max&&(this.max=t))},this)},this)},generateTicks:function(){if(this.ticks=[],this.options.override)for(var t=0;t<=this.options.override.steps;++t){var e=this.options.override.start+t*this.options.override.stepWidth;this.ticks.push(e)}else{var a=Math.min(11,Math.ceil(this.drawingArea/(2*this.options.labels.fontSize)));if(a=Math.max(2,a),this.options.beginAtZero){var s=i.sign(this.min),n=i.sign(this.max);0>s&&0>n?this.max=0:s>0&&n>0&&(this.min=0)}for(var o=i.niceNum(this.max-this.min,!1),r=i.niceNum(o/(a-1),!0),h=Math.floor(this.min/r)*r,l=Math.ceil(this.max/r)*r,c=h;l>=c;c+=r)this.ticks.push(c)}("left"==this.options.position||"right"==this.options.position)&&this.ticks.reverse(),this.max=i.max(this.ticks),this.min=i.min(this.ticks)},buildYLabels:function(){this.yLabels=[],i.each(this.ticks,function(t,e,a){var s;this.options.labels.userCallback?s=this.options.labels.userCallback(t,e,a):this.options.labels.template&&(s=i.template(this.options.labels.template,{value:t})),this.yLabels.push(s?s:"")},this)},getCircumference:function(){return 2*Math.PI/this.getValueCount()},setScaleSize:function(){var t,e,a,s,n,o,r,h,l,c,u,d,f=i.min([this.height/2-this.options.pointLabels.fontSize-5,this.width/2]),m=this.width,g=0;for(this.ctx.font=i.fontString(this.options.pointLabels.fontSize,this.options.pointLabels.fontStyle,this.options.pointLabels.fontFamily),e=0;e<this.getValueCount();e++)t=this.getPointPosition(e,f),a=this.ctx.measureText(i.template(this.options.labels.template,{value:this.labels[e]})).width+5,0===e||e===this.getValueCount()/2?(s=a/2,t.x+s>m&&(m=t.x+s,n=e),t.x-s<g&&(g=t.x-s,r=e)):e<this.getValueCount()/2?t.x+a>m&&(m=t.x+a,n=e):e>this.getValueCount()/2&&t.x-a<g&&(g=t.x-a,r=e);l=g,c=Math.ceil(m-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(r),u=c/Math.sin(o+Math.PI/2),d=l/Math.sin(h+Math.PI/2),u=i.isNumber(u)?u:0,d=i.isNumber(d)?d:0,this.drawingArea=f-(d+u)/2,this.setCenterPoint(d,u)},setCenterPoint:function(t,e){var i=this.width-e-this.drawingArea,a=t+this.drawingArea;this.xCenter=(a+i)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var e=2*Math.PI/this.getValueCount();return t*e-Math.PI/2},getDistanceFromCenterForValue:function(t){if(null===t)return 0;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e},getPointPosition:function(t,e){var i=this.getIndexAngle(t);return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},draw:function(){if(this.options.display){var t=this.ctx;if(i.each(this.yLabels,function(e,a){if(a>0||this.options.reverse){var s=this.getDistanceFromCenterForValue(this.ticks[a]),n=this.yCenter-s;if(this.options.gridLines.show)if(t.strokeStyle=this.options.gridLines.color,t.lineWidth=this.options.gridLines.lineWidth,this.options.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,s,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var o=0;o<this.getValueCount();o++){var r=this.getPointPosition(o,this.getDistanceFromCenterForValue(this.ticks[a]));0===o?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)}t.closePath(),t.stroke()}if(this.options.labels.show){if(t.font=i.fontString(this.options.labels.fontSize,this.options.labels.fontStyle,this.options.labels.fontFamily),this.options.labels.showLabelBackdrop){var h=t.measureText(e).width;t.fillStyle=this.options.labels.backdropColor,t.fillRect(this.xCenter-h/2-this.options.labels.backdropPaddingX,n-this.fontSize/2-this.options.labels.backdropPaddingY,h+2*this.options.labels.backdropPaddingX,this.options.labels.fontSize+2*this.options.labels.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.options.labels.fontColor,t.fillText(e,this.xCenter,n)}}},this),!this.options.lineArc){t.lineWidth=this.options.angleLines.lineWidth,t.strokeStyle=this.options.angleLines.color;for(var e=this.getValueCount()-1;e>=0;e--){if(this.options.angleLines.show){var a=this.getPointPosition(e,this.getDistanceFromCenterForValue(this.options.reverse?this.min:this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke(),t.closePath()}var s=this.getPointPosition(e,this.getDistanceFromCenterForValue(this.options.reverse?this.min:this.max)+5);t.font=i.fontString(this.options.pointLabels.fontSize,this.options.pointLabels.fontStyle,this.options.pointLabels.fontFamily),t.fillStyle=this.options.pointLabels.fontColor;var n=this.labels.length,o=this.labels.length/2,r=o/2,h=r>e||e>n-r,l=e===r||e===n-r;0===e?t.textAlign="center":e===o?t.textAlign="center":o>e?t.textAlign="left":t.textAlign="right",l?t.textBaseline="middle":h?t.textBaseline="bottom":t.textBaseline="top",t.fillText(this.labels[e],s.x,s.y)}}}}});e.scaleService.registerScaleType("radialLinear",s,a)}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={units:["millisecond","second","minute","hour","day","week","month","quarter","year"],unit:{millisecond:{display:"SSS [ms]",maxStep:1e3},second:{display:"h:mm:ss a",maxStep:60},minute:{display:"h:mm:ss a",maxStep:60},hour:{display:"MMM D, hA",maxStep:24},day:{display:"ll",maxStep:7},week:{display:"ll",maxStep:4.3333},month:{display:"MMM YYYY",maxStep:12},quarter:{display:"[Q]Q - YYYY",maxStep:4},year:{display:"YYYY",maxStep:!1}}},s={position:"bottom",time:{format:!1,unit:!1,round:!1,displayFormat:!1}},n=e.Scale.extend({buildTicks:function(t){if(this.ticks=[],this.labelMoments=[],this.data.labels.forEach(function(t,e){var i=this.parseTime(t);this.options.time.round&&i.startOf(this.options.time.round),this.labelMoments.push(i)},this),this.firstTick=moment.min.call(this,this.labelMoments).clone(),this.lastTick=moment.max.call(this,this.labelMoments).clone(),this.options.time.unit)this.tickUnit=this.options.time.unit||"day",this.displayFormat=a.unit.day.display,this.tickRange=Math.ceil(this.lastTick.diff(this.firstTick,this.tickUnit,!0));else{var e=this.width-(this.paddingLeft+this.paddingRight),s=e/this.options.ticks.fontSize+4,n=this.options.time.round?0:2;this.tickRange=Math.ceil(this.lastTick.diff(this.firstTick,!0)+n);i.each(a.units,function(t){this.tickRange<=s||(this.tickUnit=t,this.tickRange=Math.ceil(this.lastTick.diff(this.firstTick,this.tickUnit)+n),this.displayFormat=a.unit[t].display)},this)}this.firstTick.startOf(this.tickUnit),this.lastTick.endOf(this.tickUnit),this.smallestLabelSeparation=this.width;var o=0;for(o=1;o<this.labelMoments.length;o++)this.smallestLabelSeparation=Math.min(this.smallestLabelSeparation,this.labelMoments[o].diff(this.labelMoments[o-1],this.tickUnit,!0));if(this.options.time.displayFormat&&(this.displayFormat=this.options.time.displayFormat),this.options.ticks.userCallback)for(o=0;o<=this.tickRange;o++)this.ticks.push(this.options.ticks.userCallback(this.firstTick.clone().add(o,this.tickUnit).format(this.options.time.displayFormat?this.options.time.displayFormat:a.unit[this.tickUnit].display)));else for(o=0;o<=this.tickRange;o++)this.ticks.push(this.firstTick.clone().add(o,this.tickUnit).format(this.options.time.displayFormat?this.options.time.displayFormat:a.unit[this.tickUnit].display))},getPixelForValue:function(t,e,i,a){var s=this.labelMoments[e].diff(this.firstTick,this.tickUnit,!0),n=s/this.tickRange;if(this.isHorizontal()){var o=this.width-(this.paddingLeft+this.paddingRight),r=(o/Math.max(this.ticks.length-1,1),o*n+this.paddingLeft);return this.left+Math.round(r)}return this.top+n*(this.height/this.ticks.length)},parseTime:function(t){return"function"==typeof t.getMonth||"number"==typeof t?moment(t):t.isValid&&t.isValid()?t:"string"!=typeof this.options.time.format&&this.options.time.format.call?this.options.time.format(t):moment(t,this.options.time.format)}});e.scaleService.registerScaleType("time",n,s)}.call(this),/*!
* Chart.js
* http://chartjs.org/
* Version: 2.0.0-alpha
* Released under the MIT license
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/
--function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.elements.arc={backgroundColor:e.defaults.global.defaultColor,borderColor:"#fff",borderWidth:2},e.elements.Arc=e.Element.extend({inLabelRange:function(t){var e=this._view;return e?Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2):!1},inRange:function(t,e){var a=this._view;if(a){var s=i.getAngleFromPoint(a,{x:t,y:e}),o=a.startAngle<-.5*Math.PI?a.startAngle+2*Math.PI:a.startAngle>1.5*Math.PI?a.startAngle-2*Math.PI:a.startAngle,n=a.endAngle<-.5*Math.PI?a.endAngle+2*Math.PI:a.endAngle>1.5*Math.PI?a.endAngle-2*Math.PI:a.endAngle,r=s.angle>=o&&s.angle<=n,h=s.distance>=a.innerRadius&&s.distance<=a.outerRadius;return r&&h}return!1},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,e.startAngle,e.endAngle),t.arc(e.x,e.y,e.innerRadius,e.endAngle,e.startAngle,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})}.call(this),/*!
++function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.elements.arc={backgroundColor:e.defaults.global.defaultColor,borderColor:"#fff",borderWidth:2},e.elements.Arc=e.Element.extend({inLabelRange:function(t){var e=this._view;return e?Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2):!1},inRange:function(t,e){var a=this._view;if(a){var s=i.getAngleFromPoint(a,{x:t,y:e}),n=a.startAngle<-.5*Math.PI?a.startAngle+2*Math.PI:a.startAngle>1.5*Math.PI?a.startAngle-2*Math.PI:a.startAngle,o=a.endAngle<-.5*Math.PI?a.endAngle+2*Math.PI:a.endAngle>1.5*Math.PI?a.endAngle-2*Math.PI:a.endAngle,r=s.angle>=n&&s.angle<=o,h=s.distance>=a.innerRadius&&s.distance<=a.outerRadius;return r&&h}return!1},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,e.startAngle,e.endAngle),t.arc(e.x,e.y,e.innerRadius,e.endAngle,e.startAngle,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})}.call(this),/*!
* Chart.js
* http://chartjs.org/
* Version: 2.0.0-alpha
* Released under the MIT license
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/
--function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.elements.line={tension:.4,backgroundColor:e.defaults.global.defaultColor,borderWidth:3,borderColor:e.defaults.global.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",fill:!0,skipNull:!0,drawNull:!1},e.elements.Line=e.Element.extend({draw:function(){var t=this._view,a=this._chart.ctx,s=this._children[0],o=this._children[this._children.length-1];a.save(),i.each(this._children,function(e,s){var o=i.previousItem(this._children,s),n=i.nextItem(this._children,s);return 0===s?void a.moveTo(e._view.x,e._view.y):(e._view.skip&&t.skipNull&&!this._loop?(a.lineTo(o._view.x,e._view.y),a.moveTo(n._view.x,e._view.y)):o._view.skip&&t.skipNull&&!this._loop&&(a.moveTo(e._view.x,o._view.y),a.lineTo(e._view.x,e._view.y)),void(o._view.skip&&t.skipNull?a.moveTo(e._view.x,e._view.y):t.tension>0?a.bezierCurveTo(o._view.controlPointNextX,o._view.controlPointNextY,e._view.controlPointPreviousX,e._view.controlPointPreviousY,e._view.x,e._view.y):a.lineTo(e._view.x,e._view.y)))},this),this._loop&&(t.tension>0&&!s._view.skip?a.bezierCurveTo(o._view.controlPointNextX,o._view.controlPointNextY,s._view.controlPointPreviousX,s._view.controlPointPreviousY,s._view.x,s._view.y):a.lineTo(s._view.x,s._view.y)),this._children.length>0&&t.fill&&(a.lineTo(this._children[this._children.length-1]._view.x,t.scaleZero),a.lineTo(this._children[0]._view.x,t.scaleZero),a.fillStyle=t.backgroundColor||e.defaults.global.defaultColor,a.closePath(),a.fill()),a.lineCap=t.borderCapStyle||e.defaults.global.elements.line.borderCapStyle,a.setLineDash&&a.setLineDash(t.borderDash||e.defaults.global.elements.line.borderDash),a.lineDashOffset=t.borderDashOffset||e.defaults.global.elements.line.borderDashOffset,a.lineJoin=t.borderJoinStyle||e.defaults.global.elements.line.borderJoinStyle,a.lineWidth=t.borderWidth||e.defaults.global.elements.line.borderWidth,a.strokeStyle=t.borderColor||e.defaults.global.defaultColor,a.beginPath(),i.each(this._children,function(e,s){var o=i.previousItem(this._children,s),n=i.nextItem(this._children,s);return 0===s?void a.moveTo(e._view.x,e._view.y):e._view.skip&&t.skipNull&&!this._loop?(a.moveTo(o._view.x,e._view.y),void a.moveTo(n._view.x,e._view.y)):o._view.skip&&t.skipNull&&!this._loop?(a.moveTo(e._view.x,o._view.y),void a.moveTo(e._view.x,e._view.y)):o._view.skip&&t.skipNull?void a.moveTo(e._view.x,e._view.y):void(t.tension>0?a.bezierCurveTo(o._view.controlPointNextX,o._view.controlPointNextY,e._view.controlPointPreviousX,e._view.controlPointPreviousY,e._view.x,e._view.y):a.lineTo(e._view.x,e._view.y))},this),this._loop&&!s._view.skip&&(t.tension>0?a.bezierCurveTo(o._view.controlPointNextX,o._view.controlPointNextY,s._view.controlPointPreviousX,s._view.controlPointPreviousY,s._view.x,s._view.y):a.lineTo(s._view.x,s._view.y)),a.stroke(),a.restore()}})}.call(this),/*!
++function(){"use strict";var t=this,e=t.Chart,i=e.helpers;e.defaults.global.elements.line={tension:.4,backgroundColor:e.defaults.global.defaultColor,borderWidth:3,borderColor:e.defaults.global.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",fill:!0,skipNull:!0,drawNull:!1},e.elements.Line=e.Element.extend({draw:function(){var t=this._view,a=this._chart.ctx,s=this._children[0],n=this._children[this._children.length-1];a.save(),i.each(this._children,function(e,s){var n=i.previousItem(this._children,s),o=i.nextItem(this._children,s);return 0===s?void a.moveTo(e._view.x,e._view.y):(e._view.skip&&t.skipNull&&!this._loop?(a.lineTo(n._view.x,e._view.y),a.moveTo(o._view.x,e._view.y)):n._view.skip&&t.skipNull&&!this._loop&&(a.moveTo(e._view.x,n._view.y),a.lineTo(e._view.x,e._view.y)),void(n._view.skip&&t.skipNull?a.moveTo(e._view.x,e._view.y):t.tension>0?a.bezierCurveTo(n._view.controlPointNextX,n._view.controlPointNextY,e._view.controlPointPreviousX,e._view.controlPointPreviousY,e._view.x,e._view.y):a.lineTo(e._view.x,e._view.y)))},this),this._loop&&(t.tension>0&&!s._view.skip?a.bezierCurveTo(n._view.controlPointNextX,n._view.controlPointNextY,s._view.controlPointPreviousX,s._view.controlPointPreviousY,s._view.x,s._view.y):a.lineTo(s._view.x,s._view.y)),this._children.length>0&&t.fill&&(a.lineTo(this._children[this._children.length-1]._view.x,t.scaleZero),a.lineTo(this._children[0]._view.x,t.scaleZero),a.fillStyle=t.backgroundColor||e.defaults.global.defaultColor,a.closePath(),a.fill()),a.lineCap=t.borderCapStyle||e.defaults.global.elements.line.borderCapStyle,a.setLineDash&&a.setLineDash(t.borderDash||e.defaults.global.elements.line.borderDash),a.lineDashOffset=t.borderDashOffset||e.defaults.global.elements.line.borderDashOffset,a.lineJoin=t.borderJoinStyle||e.defaults.global.elements.line.borderJoinStyle,a.lineWidth=t.borderWidth||e.defaults.global.elements.line.borderWidth,a.strokeStyle=t.borderColor||e.defaults.global.defaultColor,a.beginPath(),i.each(this._children,function(e,s){var n=i.previousItem(this._children,s),o=i.nextItem(this._children,s);return 0===s?void a.moveTo(e._view.x,e._view.y):e._view.skip&&t.skipNull&&!this._loop?(a.moveTo(n._view.x,e._view.y),void a.moveTo(o._view.x,e._view.y)):n._view.skip&&t.skipNull&&!this._loop?(a.moveTo(e._view.x,n._view.y),void a.moveTo(e._view.x,e._view.y)):n._view.skip&&t.skipNull?void a.moveTo(e._view.x,e._view.y):void(t.tension>0?a.bezierCurveTo(n._view.controlPointNextX,n._view.controlPointNextY,e._view.controlPointPreviousX,e._view.controlPointPreviousY,e._view.x,e._view.y):a.lineTo(e._view.x,e._view.y))},this),this._loop&&!s._view.skip&&(t.tension>0?a.bezierCurveTo(n._view.controlPointNextX,n._view.controlPointNextY,s._view.controlPointPreviousX,s._view.controlPointPreviousY,s._view.x,s._view.y):a.lineTo(s._view.x,s._view.y)),a.stroke(),a.restore()}})}.call(this),/*!
* Chart.js
* http://chartjs.org/
* Version: 2.0.0-alpha
* Released under the MIT license
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/
--function(){"use strict";{var t=this,e=t.Chart;e.helpers}e.defaults.global.elements.point={radius:3,backgroundColor:e.defaults.global.defaultColor,borderWidth:1,borderColor:e.defaults.global.defaultColor,hitRadius:1,hoverRadius:4,hoverBorderWidth:1},e.elements.Point=e.Element.extend({inRange:function(t,e){var i=this._view;if(i){var a=i.hitRadius+i.radius;return Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(a,2)}return!1},inLabelRange:function(t){var e=this._view;return e?Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2):!1},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(){var t=this._view,i=this._chart.ctx;t.skip||(t.radius>0||t.borderWidth>0)&&(i.beginPath(),i.arc(t.x,t.y,t.radius||e.defaults.global.elements.point.radius,0,2*Math.PI),i.closePath(),i.strokeStyle=t.borderColor||e.defaults.global.defaultColor,i.lineWidth=t.borderWidth||e.defaults.global.elements.point.borderWidth,i.fillStyle=t.backgroundColor||e.defaults.global.defaultColor,i.fill(),i.stroke())}})}.call(this),function(){"use strict";{var t=this,e=t.Chart;e.helpers}e.defaults.global.elements.rectangle={backgroundColor:e.defaults.global.defaultColor,borderWidth:0,borderColor:e.defaults.global.defaultColor},e.elements.Rectangle=e.Element.extend({draw:function(){var t=this._chart.ctx,e=this._view,i=e.width/2,a=e.x-i,s=e.x+i,o=e.base-(e.base-e.y),n=e.borderWidth/2;e.borderWidth&&(a+=n,s-=n,o+=n),t.beginPath(),t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.moveTo(a,e.base),t.lineTo(a,o),t.lineTo(s,o),t.lineTo(s,e.base),t.fill(),e.borderWidth&&t.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=this._view,a=!1;return i&&(a=i.y<i.base?t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.y&&e<=i.base:t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.base&&e<=i.y),a},inLabelRange:function(t){var e=this._view;return e?t>=e.x-e.width/2&&t<=e.x+e.width/2:!1},tooltipPosition:function(){var t=this._view;return t.y<t.base?{x:t.x,y:t.y}:{x:t.x,y:t.base}}})}.call(this),function(){"use strict";{var t=this,e=t.Chart;e.helpers}e.Bar=function(t,i){return i.type="bar",new e(t,i)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>'};e.Doughnut=function(t,s){return s.options=i.configMerge(a,s.options),s.type="doughnut",new e(t,s)}}.call(this),function(){"use strict";{var t=this,e=t.Chart;e.helpers}e.Line=function(t,i){return i.type="line",new e(t,i)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>'};e.PolarArea=function(t,s){return s.options=i.configMerge(a,s.options),s.type="polarArea",new e(t,s)}}.call(this),function(){"use strict";{var t=this,e=t.Chart;e.helpers}e.Radar=function(t,i){return i.type="radar",new e(t,i)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{template:"(<%= value.x %>, <%= value.y %>)",multiTemplate:"<%if (datasetLabel){%><%=datasetLabel%>: <%}%>(<%= value.x %>, <%= value.y %>)"}};e.Scatter=function(t,s){return s.options=i.configMerge(a,s.options),s.type="line",new e(t,s)}}.call(this),!function t(e,i,a){function s(n,r){if(!i[n]){if(!e[n]){var h="function"==typeof require&&require;if(!r&&h)return h(n,!0);if(o)return o(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[n]={exports:{}};e[n][0].call(c.exports,function(t){var i=e[n][1][t];return s(i?i:t)},c,c.exports,t,e,i,a)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n<a.length;n++)s(a[n]);return s}({1:[function(t,e){!function(){var i=t("color-convert"),a=t("color-string"),s=function(t){if(t instanceof s)return t;if(!(this instanceof s))return new s(t);if(this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},"string"==typeof t){var e=a.getRgba(t);if(e)this.setValues("rgb",e);else if(e=a.getHsla(t))this.setValues("hsl",e);else{if(!(e=a.getHwb(t)))throw new Error('Unable to parse color from string "'+t+'"');this.setValues("hwb",e)}}else if("object"==typeof t){var e=t;if(void 0!==e.r||void 0!==e.red)this.setValues("rgb",e);else if(void 0!==e.l||void 0!==e.lightness)this.setValues("hsl",e);else if(void 0!==e.v||void 0!==e.value)this.setValues("hsv",e);else if(void 0!==e.w||void 0!==e.whiteness)this.setValues("hwb",e);else{if(void 0===e.c&&void 0===e.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(t));this.setValues("cmyk",e)}}};s.prototype={rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return 1!==this.values.alpha?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values.rgb;return t.concat([this.values.alpha])},hslaArray:function(){var t=this.values.hsl;return t.concat([this.values.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var a=t[i]/255;e[i]=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return 128>e},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;3>e;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=0>e?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){e=1-(null==e?.5:e);for(var i=2*e-1,a=this.alpha()-t.alpha(),s=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,o=1-s,n=this.rgbArray(),r=t.rgbArray(),h=0;h<n.length;h++)n[h]=n[h]*s+r[h]*o;this.setValues("rgb",n);var l=this.alpha()*e+t.alpha()*(1-e);return this.setValues("alpha",l),this},toJSON:function(){return this.rgb()},clone:function(){return new s(this.rgb())}},s.prototype.getValues=function(t){for(var e={},i=0;i<t.length;i++)e[t.charAt(i)]=this.values[t][i];return 1!=this.values.alpha&&(e.a=this.values.alpha),e},s.prototype.setValues=function(t,e){var a={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},s={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o=1;if("alpha"==t)o=e;else if(e.length)this.values[t]=e.slice(0,t.length),o=e[t.length];else if(void 0!==e[t.charAt(0)]){for(var n=0;n<t.length;n++)this.values[t][n]=e[t.charAt(n)];o=e.a}else if(void 0!==e[a[t][0]]){for(var r=a[t],n=0;n<t.length;n++)this.values[t][n]=e[r[n]];o=e.alpha}if(this.values.alpha=Math.max(0,Math.min(1,void 0!==o?o:this.values.alpha)),"alpha"!=t){for(var n=0;n<t.length;n++){var h=Math.max(0,Math.min(s[t][n],this.values[t][n]));this.values[t][n]=Math.round(h)}for(var l in a){l!=t&&(this.values[l]=i[t][l](this.values[t]));for(var n=0;n<l.length;n++){var h=Math.max(0,Math.min(s[l][n],this.values[l][n]));this.values[l][n]=Math.round(h)}}return!0}},s.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},s.prototype.setChannel=function(t,e,i){return void 0===i?this.values[t][e]:(this.values[t][e]=i,this.setValues(t,this.values[t]),this)},window.Color=e.exports=s}()},{"color-convert":3,"color-string":4}],2:[function(t,e){function i(t){var e,i,a,s=t[0]/255,o=t[1]/255,n=t[2]/255,r=Math.min(s,o,n),h=Math.max(s,o,n),l=h-r;return h==r?e=0:s==h?e=(o-n)/l:o==h?e=2+(n-s)/l:n==h&&(e=4+(s-o)/l),e=Math.min(60*e,360),0>e&&(e+=360),a=(r+h)/2,i=h==r?0:.5>=a?l/(h+r):l/(2-h-r),[e,100*i,100*a]}function a(t){var e,i,a,s=t[0],o=t[1],n=t[2],r=Math.min(s,o,n),h=Math.max(s,o,n),l=h-r;return i=0==h?0:l/h*1e3/10,h==r?e=0:s==h?e=(o-n)/l:o==h?e=2+(n-s)/l:n==h&&(e=4+(s-o)/l),e=Math.min(60*e,360),0>e&&(e+=360),a=h/255*1e3/10,[e,i,a]}function s(t){var e=t[0],a=t[1],s=t[2],o=i(t)[0],n=1/255*Math.min(e,Math.min(a,s)),s=1-1/255*Math.max(e,Math.max(a,s));return[o,100*n,100*s]}function o(t){var e,i,a,s,o=t[0]/255,n=t[1]/255,r=t[2]/255;return s=Math.min(1-o,1-n,1-r),e=(1-o-s)/(1-s)||0,i=(1-n-s)/(1-s)||0,a=(1-r-s)/(1-s)||0,[100*e,100*i,100*a,100*s]}function n(t){return Z[JSON.stringify(t)]}function h(t){var e=t[0]/255,i=t[1]/255,a=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var s=.4124*e+.3576*i+.1805*a,o=.2126*e+.7152*i+.0722*a,n=.0193*e+.1192*i+.9505*a;return[100*s,100*o,100*n]}function l(t){var e,i,a,s=h(t),o=s[0],n=s[1],r=s[2];return o/=95.047,n/=100,r/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*n-16,i=500*(o-n),a=200*(n-r),[e,i,a]}function c(t){return L(l(t))}function u(t){var e,i,a,s,o,n=t[0]/360,r=t[1]/100,h=t[2]/100;if(0==r)return o=255*h,[o,o,o];i=.5>h?h*(1+r):h+r-h*r,e=2*h-i,s=[0,0,0];for(var l=0;3>l;l++)a=n+1/3*-(l-1),0>a&&a++,a>1&&a--,o=1>6*a?e+6*(i-e)*a:1>2*a?i:2>3*a?e+(i-e)*(2/3-a)*6:e,s[l]=255*o;return s}function d(t){var e,i,a=t[0],s=t[1]/100,o=t[2]/100;return o*=2,s*=1>=o?o:2-o,i=(o+s)/2,e=2*s/(o+s),[a,100*e,100*i]}function m(t){return s(u(t))}function p(t){return o(u(t))}function f(t){return n(u(t))}function v(t){var e=t[0]/60,i=t[1]/100,a=t[2]/100,s=Math.floor(e)%6,o=e-Math.floor(e),n=255*a*(1-i),r=255*a*(1-i*o),h=255*a*(1-i*(1-o)),a=255*a;switch(s){case 0:return[a,h,n];case 1:return[r,a,n];case 2:return[n,a,h];case 3:return[n,r,a];case 4:return[h,n,a];case 5:return[a,n,r]}}function x(t){var e,i,a=t[0],s=t[1]/100,o=t[2]/100;return i=(2-s)*o,e=s*o,e/=1>=i?i:2-i,e=e||0,i/=2,[a,100*e,100*i]}function y(t){return s(v(t))}function w(t){return o(v(t))}function C(t){return n(v(t))}function D(t){var e,i,a,s,o=t[0]/360,n=t[1]/100,h=t[2]/100,l=n+h;switch(l>1&&(n/=l,h/=l),e=Math.floor(6*o),i=1-h,a=6*o-e,0!=(1&e)&&(a=1-a),s=n+a*(i-n),e){default:case 6:case 0:r=i,g=s,b=n;break;case 1:r=s,g=i,b=n;break;case 2:r=n,g=i,b=s;break;case 3:r=n,g=s,b=i;break;case 4:r=s,g=n,b=i;break;case 5:r=i,g=n,b=s}return[255*r,255*g,255*b]}function _(t){return i(D(t))}function k(t){return a(D(t))}function S(t){return o(D(t))}function A(t){return n(D(t))}function P(t){var e,i,a,s=t[0]/100,o=t[1]/100,n=t[2]/100,r=t[3]/100;return e=1-Math.min(1,s*(1-r)+r),i=1-Math.min(1,o*(1-r)+r),a=1-Math.min(1,n*(1-r)+r),[255*e,255*i,255*a]}function I(t){return i(P(t))}function M(t){return a(P(t))}function R(t){return s(P(t))}function W(t){return n(P(t))}function V(t){var e,i,a,s=t[0]/100,o=t[1]/100,n=t[2]/100;return e=3.2406*s+-1.5372*o+n*-.4986,i=s*-.9689+1.8758*o+.0415*n,a=.0557*s+o*-.204+1.057*n,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e=12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i=12.92*i,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=12.92*a,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[255*e,255*i,255*a]}function O(t){var e,i,a,s=t[0],o=t[1],n=t[2];return s/=95.047,o/=100,n/=108.883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,e=116*o-16,i=500*(s-o),a=200*(o-n),[e,i,a]}function z(t){return L(O(t))}function F(t){var e,i,a,s,o=t[0],n=t[1],r=t[2];return 8>=o?(i=100*o/903.3,s=7.787*(i/100)+16/116):(i=100*Math.pow((o+16)/116,3),s=Math.pow(i/100,1/3)),e=.008856>=e/95.047?e=95.047*(n/500+s-16/116)/7.787:95.047*Math.pow(n/500+s,3),a=.008859>=a/108.883?a=108.883*(s-r/200-16/116)/7.787:108.883*Math.pow(s-r/200,3),[e,i,a]}function L(t){var e,i,a,s=t[0],o=t[1],n=t[2];return e=Math.atan2(n,o),i=360*e/2/Math.PI,0>i&&(i+=360),a=Math.sqrt(o*o+n*n),[s,a,i]}function B(t){return V(F(t))}function T(t){var e,i,a,s=t[0],o=t[1],n=t[2];return a=n/360*2*Math.PI,e=o*Math.cos(a),i=o*Math.sin(a),[s,e,i]}function E(t){return F(T(t))}function H(t){return B(T(t))}function N(t){return U[t]}function q(t){return i(N(t))}function j(t){return a(N(t))}function Y(t){return s(N(t))}function X(t){return o(N(t))}function J(t){return l(N(t))}function Q(t){return h(N(t))}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:s,rgb2cmyk:o,rgb2keyword:n,rgb2xyz:h,rgb2lab:l,rgb2lch:c,hsl2rgb:u,hsl2hsv:d,hsl2hwb:m,hsl2cmyk:p,hsl2keyword:f,hsv2rgb:v,hsv2hsl:x,hsv2hwb:y,hsv2cmyk:w,hsv2keyword:C,hwb2rgb:D,hwb2hsl:_,hwb2hsv:k,hwb2cmyk:S,hwb2keyword:A,cmyk2rgb:P,cmyk2hsl:I,cmyk2hsv:M,cmyk2hwb:R,cmyk2keyword:W,keyword2rgb:N,keyword2hsl:q,keyword2hsv:j,keyword2hwb:Y,keyword2cmyk:X,keyword2lab:J,keyword2xyz:Q,xyz2rgb:V,xyz2lab:O,xyz2lch:z,lab2xyz:F,lab2rgb:B,lab2lch:L,lch2lab:T,lch2xyz:E,lch2rgb:H};var U={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Z={};for(var $ in U)Z[JSON.stringify(U[$])]=$},{}],3:[function(t,e){var i=t("./conversions"),a=function(){return new h};for(var s in i){a[s+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(s);var o=/(\w+)2(\w+)/.exec(s),n=o[1],r=o[2];a[n]=a[n]||{},a[n][r]=a[s]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var a=i[t](e);if("string"==typeof a||void 0===a)return a;for(var s=0;s<a.length;s++)a[s]=Math.round(a[s]);return a}}(s)}var h=function(){this.convs={}};h.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},h.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},h.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,s=this.convs[i];e=a[i][t](s),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){h.prototype[t]=function(){return this.routeSpace(t,arguments)}}),e.exports=a},{"./conversions":2}],4:[function(t,e){function i(t){if(t){var e=/^#([a-fA-F0-9]{3})$/,i=/^#([a-fA-F0-9]{6})$/,a=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,s=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,o=/(\w+)/,n=[0,0,0],r=1,h=t.match(e);if(h){h=h[1];for(var l=0;l<n.length;l++)n[l]=parseInt(h[l]+h[l],16)}else if(h=t.match(i)){h=h[1];for(var l=0;l<n.length;l++)n[l]=parseInt(h.slice(2*l,2*l+2),16)}else if(h=t.match(a)){for(var l=0;l<n.length;l++)n[l]=parseInt(h[l+1]);r=parseFloat(h[4])}else if(h=t.match(s)){for(var l=0;l<n.length;l++)n[l]=Math.round(2.55*parseFloat(h[l+1]));r=parseFloat(h[4])}else if(h=t.match(o)){if("transparent"==h[1])return[0,0,0,0];if(n=x[h[1]],!n)return}for(var l=0;l<n.length;l++)n[l]=v(n[l],0,255);return r=r||0==r?v(r,0,1):1,n[3]=r,n}}function a(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var a=parseFloat(i[4]),s=v(parseInt(i[1]),0,360),o=v(parseFloat(i[2]),0,100),n=v(parseFloat(i[3]),0,100),r=v(isNaN(a)?1:a,0,1);return[s,o,n,r]}}}function s(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var a=parseFloat(i[4]),s=v(parseInt(i[1]),0,360),o=v(parseFloat(i[2]),0,100),n=v(parseFloat(i[3]),0,100),r=v(isNaN(a)?1:a,0,1);return[s,o,n,r]}}}function o(t){var e=i(t);return e&&e.slice(0,3)}function n(t){var e=a(t);return e&&e.slice(0,3)}function r(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=s(t))?e[3]:void 0}function h(t){return"#"+b(t[0])+b(t[1])+b(t[2])}function l(t,e){return 1>e||t[3]&&t[3]<1?c(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function c(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function u(t,e){if(1>e||t[3]&&t[3]<1)return d(t,e);var i=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),s=Math.round(t[2]/255*100);return"rgb("+i+"%, "+a+"%, "+s+"%)"}function d(t,e){var i=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),s=Math.round(t[2]/255*100);return"rgba("+i+"%, "+a+"%, "+s+"%, "+(e||t[3]||1)+")"}function g(t,e){return 1>e||t[3]&&t[3]<1?m(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function m(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function f(t){return y[t.slice(0,3)]}function v(t,e,i){return Math.min(Math.max(e,t),i)}function b(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var x=t("color-name");e.exports={getRgba:i,getHsla:a,getRgb:o,getHsl:n,getHwb:s,getAlpha:r,hexString:h,rgbString:l,rgbaString:c,percentString:u,percentaString:d,hslString:g,hslaString:m,hwbString:p,keyword:f};var y={};for(var w in x)y[x[w]]=w},{"color-name":5}],5:[function(t,e){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}]},{},[1]);
++function(){"use strict";var t=this,e=t.Chart;e.helpers;e.defaults.global.elements.point={radius:3,backgroundColor:e.defaults.global.defaultColor,borderWidth:1,borderColor:e.defaults.global.defaultColor,hitRadius:1,hoverRadius:4,hoverBorderWidth:1},e.elements.Point=e.Element.extend({inRange:function(t,e){var i=this._view;if(i){var a=i.hitRadius+i.radius;return Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(a,2)}return!1},inLabelRange:function(t){var e=this._view;return e?Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2):!1},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(){var t=this._view,i=this._chart.ctx;t.skip||(t.radius>0||t.borderWidth>0)&&(i.beginPath(),i.arc(t.x,t.y,t.radius||e.defaults.global.elements.point.radius,0,2*Math.PI),i.closePath(),i.strokeStyle=t.borderColor||e.defaults.global.defaultColor,i.lineWidth=t.borderWidth||e.defaults.global.elements.point.borderWidth,i.fillStyle=t.backgroundColor||e.defaults.global.defaultColor,i.fill(),i.stroke())}})}.call(this),function(){"use strict";var t=this,e=t.Chart;e.helpers;e.defaults.global.elements.rectangle={backgroundColor:e.defaults.global.defaultColor,borderWidth:0,borderColor:e.defaults.global.defaultColor},e.elements.Rectangle=e.Element.extend({draw:function(){var t=this._chart.ctx,e=this._view,i=e.width/2,a=e.x-i,s=e.x+i,n=e.base-(e.base-e.y),o=e.borderWidth/2;e.borderWidth&&(a+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.moveTo(a,e.base),t.lineTo(a,n),t.lineTo(s,n),t.lineTo(s,e.base),t.fill(),e.borderWidth&&t.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=this._view,a=!1;return i&&(a=i.y<i.base?t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.y&&e<=i.base:t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.base&&e<=i.y),a},inLabelRange:function(t){var e=this._view;return e?t>=e.x-e.width/2&&t<=e.x+e.width/2:!1},tooltipPosition:function(){var t=this._view;return t.y<t.base?{x:t.x,y:t.y}:{x:t.x,y:t.base}}})}.call(this),function(){"use strict";var t=this,e=t.Chart;e.helpers;e.Bar=function(t,i){return i.type="bar",new e(t,i)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={aspectRatio:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>'};e.Doughnut=function(t,s){return s.options=i.configMerge(a,s.options),s.type="doughnut",new e(t,s)}}.call(this),function(){"use strict";var t=this,e=t.Chart;e.helpers;e.Line=function(t,i){return i.type="line",new e(t,i)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={aspectRatio:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>'};e.PolarArea=function(t,s){return s.options=i.configMerge(a,s.options),s.type="polarArea",new e(t,s)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={aspectRatio:1};e.Radar=function(t,s){return s.options=i.configMerge(a,s.options),s.type="radar",new e(t,s)}}.call(this),function(){"use strict";var t=this,e=t.Chart,i=e.helpers,a={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{template:"(<%= value.x %>, <%= value.y %>)",multiTemplate:"<%if (datasetLabel){%><%=datasetLabel%>: <%}%>(<%= value.x %>, <%= value.y %>)"}};e.Scatter=function(t,s){return s.options=i.configMerge(a,s.options),s.type="line",new e(t,s)}}.call(this),!function t(e,i,a){function s(o,r){if(!i[o]){if(!e[o]){var h="function"==typeof require&&require;if(!r&&h)return h(o,!0);if(n)return n(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[o]={exports:{}};e[o][0].call(c.exports,function(t){var i=e[o][1][t];return s(i?i:t)},c,c.exports,t,e,i,a)}return i[o].exports}for(var n="function"==typeof require&&require,o=0;o<a.length;o++)s(a[o]);return s}({1:[function(t,e,i){!function(){var i=t("color-convert"),a=t("color-string"),s=function(t){if(t instanceof s)return t;if(!(this instanceof s))return new s(t);if(this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},"string"==typeof t){var e=a.getRgba(t);if(e)this.setValues("rgb",e);else if(e=a.getHsla(t))this.setValues("hsl",e);else{if(!(e=a.getHwb(t)))throw new Error('Unable to parse color from string "'+t+'"');this.setValues("hwb",e)}}else if("object"==typeof t){var e=t;if(void 0!==e.r||void 0!==e.red)this.setValues("rgb",e);else if(void 0!==e.l||void 0!==e.lightness)this.setValues("hsl",e);else if(void 0!==e.v||void 0!==e.value)this.setValues("hsv",e);else if(void 0!==e.w||void 0!==e.whiteness)this.setValues("hwb",e);else{if(void 0===e.c&&void 0===e.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(t));this.setValues("cmyk",e)}}};s.prototype={rgb:function(t){return this.setSpace("rgb",arguments)},hsl:function(t){return this.setSpace("hsl",arguments)},hsv:function(t){return this.setSpace("hsv",arguments)},hwb:function(t){return this.setSpace("hwb",arguments)},cmyk:function(t){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return 1!==this.values.alpha?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values.rgb;return t.concat([this.values.alpha])},hslaArray:function(){var t=this.values.hsl;return t.concat([this.values.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var a=t[i]/255;e[i]=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return 128>e},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;3>e;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=0>e?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){e=1-(null==e?.5:e);for(var i=2*e-1,a=this.alpha()-t.alpha(),s=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,n=1-s,o=this.rgbArray(),r=t.rgbArray(),h=0;h<o.length;h++)o[h]=o[h]*s+r[h]*n;this.setValues("rgb",o);var l=this.alpha()*e+t.alpha()*(1-e);return this.setValues("alpha",l),this},toJSON:function(){return this.rgb()},clone:function(){return new s(this.rgb())}},s.prototype.getValues=function(t){for(var e={},i=0;i<t.length;i++)e[t.charAt(i)]=this.values[t][i];return 1!=this.values.alpha&&(e.a=this.values.alpha),e},s.prototype.setValues=function(t,e){var a={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},s={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},n=1;if("alpha"==t)n=e;else if(e.length)this.values[t]=e.slice(0,t.length),n=e[t.length];else if(void 0!==e[t.charAt(0)]){for(var o=0;o<t.length;o++)this.values[t][o]=e[t.charAt(o)];n=e.a}else if(void 0!==e[a[t][0]]){for(var r=a[t],o=0;o<t.length;o++)this.values[t][o]=e[r[o]];n=e.alpha}if(this.values.alpha=Math.max(0,Math.min(1,void 0!==n?n:this.values.alpha)),"alpha"!=t){for(var o=0;o<t.length;o++){var h=Math.max(0,Math.min(s[t][o],this.values[t][o]));this.values[t][o]=Math.round(h)}for(var l in a){l!=t&&(this.values[l]=i[t][l](this.values[t]));for(var o=0;o<l.length;o++){var h=Math.max(0,Math.min(s[l][o],this.values[l][o]));this.values[l][o]=Math.round(h)}}return!0}},s.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},s.prototype.setChannel=function(t,e,i){return void 0===i?this.values[t][e]:(this.values[t][e]=i,this.setValues(t,this.values[t]),this)},window.Color=e.exports=s}()},{"color-convert":3,"color-string":4}],2:[function(t,e,i){function a(t){var e,i,a,s=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(s,n,o),h=Math.max(s,n,o),l=h-r;return h==r?e=0:s==h?e=(n-o)/l:n==h?e=2+(o-s)/l:o==h&&(e=4+(s-n)/l),e=Math.min(60*e,360),0>e&&(e+=360),a=(r+h)/2,i=h==r?0:.5>=a?l/(h+r):l/(2-h-r),[e,100*i,100*a]}function s(t){var e,i,a,s=t[0],n=t[1],o=t[2],r=Math.min(s,n,o),h=Math.max(s,n,o),l=h-r;return i=0==h?0:l/h*1e3/10,h==r?e=0:s==h?e=(n-o)/l:n==h?e=2+(o-s)/l:o==h&&(e=4+(s-n)/l),e=Math.min(60*e,360),0>e&&(e+=360),a=h/255*1e3/10,[e,i,a]}function n(t){var e=t[0],i=t[1],s=t[2],n=a(t)[0],o=1/255*Math.min(e,Math.min(i,s)),s=1-1/255*Math.max(e,Math.max(i,s));return[n,100*o,100*s]}function o(t){var e,i,a,s,n=t[0]/255,o=t[1]/255,r=t[2]/255;return s=Math.min(1-n,1-o,1-r),e=(1-n-s)/(1-s)||0,i=(1-o-s)/(1-s)||0,a=(1-r-s)/(1-s)||0,[100*e,100*i,100*a,100*s]}function h(t){return Q[JSON.stringify(t)]}function l(t){var e=t[0]/255,i=t[1]/255,a=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var s=.4124*e+.3576*i+.1805*a,n=.2126*e+.7152*i+.0722*a,o=.0193*e+.1192*i+.9505*a;return[100*s,100*n,100*o]}function c(t){var e,i,a,s=l(t),n=s[0],o=s[1],r=s[2];return n/=95.047,o/=100,r/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*o-16,i=500*(n-o),a=200*(o-r),[e,i,a]}function u(t){return z(c(t))}function d(t){var e,i,a,s,n,o=t[0]/360,r=t[1]/100,h=t[2]/100;if(0==r)return n=255*h,[n,n,n];i=.5>h?h*(1+r):h+r-h*r,e=2*h-i,s=[0,0,0];for(var l=0;3>l;l++)a=o+1/3*-(l-1),0>a&&a++,a>1&&a--,n=1>6*a?e+6*(i-e)*a:1>2*a?i:2>3*a?e+(i-e)*(2/3-a)*6:e,s[l]=255*n;return s}function f(t){var e,i,a=t[0],s=t[1]/100,n=t[2]/100;return n*=2,s*=1>=n?n:2-n,i=(n+s)/2,e=2*s/(n+s),[a,100*e,100*i]}function m(t){return n(d(t))}function p(t){return o(d(t))}function v(t){return h(d(t))}function y(t){var e=t[0]/60,i=t[1]/100,a=t[2]/100,s=Math.floor(e)%6,n=e-Math.floor(e),o=255*a*(1-i),r=255*a*(1-i*n),h=255*a*(1-i*(1-n)),a=255*a;switch(s){case 0:return[a,h,o];case 1:return[r,a,o];case 2:return[o,a,h];case 3:return[o,r,a];case 4:return[h,o,a];case 5:return[a,o,r]}}function x(t){var e,i,a=t[0],s=t[1]/100,n=t[2]/100;return i=(2-s)*n,e=s*n,e/=1>=i?i:2-i,e=e||0,i/=2,[a,100*e,100*i]}function _(t){return n(y(t))}function w(t){return o(y(t))}function D(t){return h(y(t))}function k(t){var e,i,a,s,n=t[0]/360,o=t[1]/100,h=t[2]/100,l=o+h;switch(l>1&&(o/=l,h/=l),e=Math.floor(6*n),i=1-h,a=6*n-e,0!=(1&e)&&(a=1-a),s=o+a*(i-o),e){default:case 6:case 0:r=i,g=s,b=o;break;case 1:r=s,g=i,b=o;break;case 2:r=o,g=i,b=s;break;case 3:r=o,g=s,b=i;break;case 4:r=s,g=o,b=i;break;case 5:r=i,g=o,b=s}return[255*r,255*g,255*b]}function C(t){return a(k(t))}function S(t){return s(k(t))}function M(t){return o(k(t))}function A(t){return h(k(t))}function P(t){var e,i,a,s=t[0]/100,n=t[1]/100,o=t[2]/100,r=t[3]/100;return e=1-Math.min(1,s*(1-r)+r),i=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,o*(1-r)+r),[255*e,255*i,255*a]}function I(t){return a(P(t))}function T(t){return s(P(t))}function O(t){return n(P(t))}function W(t){return h(P(t))}function R(t){var e,i,a,s=t[0]/100,n=t[1]/100,o=t[2]/100;return e=3.2406*s+-1.5372*n+o*-.4986,i=s*-.9689+1.8758*n+.0415*o,a=.0557*s+n*-.204+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e=12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i=12.92*i,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=12.92*a,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[255*e,255*i,255*a]}function F(t){var e,i,a,s=t[0],n=t[1],o=t[2];return s/=95.047,n/=100,o/=108.883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*n-16,i=500*(s-n),a=200*(n-o),[e,i,a]}function Y(t){return z(F(t))}function L(t){var e,i,a,s,n=t[0],o=t[1],r=t[2];return 8>=n?(i=100*n/903.3,s=7.787*(i/100)+16/116):(i=100*Math.pow((n+16)/116,3),s=Math.pow(i/100,1/3)),e=.008856>=e/95.047?e=95.047*(o/500+s-16/116)/7.787:95.047*Math.pow(o/500+s,3),a=.008859>=a/108.883?a=108.883*(s-r/200-16/116)/7.787:108.883*Math.pow(s-r/200,3),[e,i,a]}function z(t){var e,i,a,s=t[0],n=t[1],o=t[2];return e=Math.atan2(o,n),i=360*e/2/Math.PI,0>i&&(i+=360),a=Math.sqrt(n*n+o*o),[s,a,i]}function V(t){return R(L(t))}function B(t){var e,i,a,s=t[0],n=t[1],o=t[2];return a=o/360*2*Math.PI,e=n*Math.cos(a),i=n*Math.sin(a),[s,e,i]}function H(t){return L(B(t))}function E(t){return V(B(t))}function N(t){return J[t]}function U(t){return a(N(t))}function j(t){return s(N(t))}function G(t){return n(N(t))}function q(t){return o(N(t))}function Z(t){return c(N(t))}function X(t){return l(N(t))}e.exports={rgb2hsl:a,rgb2hsv:s,rgb2hwb:n,rgb2cmyk:o,rgb2keyword:h,rgb2xyz:l,rgb2lab:c,rgb2lch:u,hsl2rgb:d,hsl2hsv:f,hsl2hwb:m,hsl2cmyk:p,hsl2keyword:v,hsv2rgb:y,hsv2hsl:x,hsv2hwb:_,hsv2cmyk:w,hsv2keyword:D,hwb2rgb:k,hwb2hsl:C,hwb2hsv:S,hwb2cmyk:M,hwb2keyword:A,cmyk2rgb:P,cmyk2hsl:I,cmyk2hsv:T,cmyk2hwb:O,cmyk2keyword:W,keyword2rgb:N,keyword2hsl:U,keyword2hsv:j,keyword2hwb:G,keyword2cmyk:q,keyword2lab:Z,keyword2xyz:X,xyz2rgb:R,xyz2lab:F,xyz2lch:Y,lab2xyz:L,lab2rgb:V,lab2lch:z,lch2lab:B,lch2xyz:H,lch2rgb:E};var J={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Q={};for(var $ in J)Q[JSON.stringify(J[$])]=$},{}],3:[function(t,e,i){var a=t("./conversions"),s=function(){return new l};for(var n in a){s[n+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),a[t](e)}}(n);var o=/(\w+)2(\w+)/.exec(n),r=o[1],h=o[2];s[r]=s[r]||{},s[r][h]=s[n]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var i=a[t](e);if("string"==typeof i||void 0===i)return i;for(var s=0;s<i.length;s++)i[s]=Math.round(i[s]);return i}}(n)}var l=function(){this.convs={}};l.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},l.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},l.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,a=this.convs[i];e=s[i][t](a),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){l.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=s},{"./conversions":2}],4:[function(t,e,i){function a(t){if(t){var e=/^#([a-fA-F0-9]{3})$/,i=/^#([a-fA-F0-9]{6})$/,a=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,s=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,n=/(\w+)/,o=[0,0,0],r=1,h=t.match(e);if(h){h=h[1];for(var l=0;l<o.length;l++)o[l]=parseInt(h[l]+h[l],16)}else if(h=t.match(i)){h=h[1];for(var l=0;l<o.length;l++)o[l]=parseInt(h.slice(2*l,2*l+2),16)}else if(h=t.match(a)){for(var l=0;l<o.length;l++)o[l]=parseInt(h[l+1]);r=parseFloat(h[4])}else if(h=t.match(s)){for(var l=0;l<o.length;l++)o[l]=Math.round(2.55*parseFloat(h[l+1]));r=parseFloat(h[4])}else if(h=t.match(n)){if("transparent"==h[1])return[0,0,0,0];if(o=x[h[1]],!o)return}for(var l=0;l<o.length;l++)o[l]=b(o[l],0,255);return r=r||0==r?b(r,0,1):1,o[3]=r,o}}function s(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var a=parseFloat(i[4]),s=b(parseInt(i[1]),0,360),n=b(parseFloat(i[2]),0,100),o=b(parseFloat(i[3]),0,100),r=b(isNaN(a)?1:a,0,1);return[s,n,o,r]}}}function n(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var a=parseFloat(i[4]),s=b(parseInt(i[1]),0,360),n=b(parseFloat(i[2]),0,100),o=b(parseFloat(i[3]),0,100),r=b(isNaN(a)?1:a,0,1);return[s,n,o,r]}}}function o(t){var e=a(t);return e&&e.slice(0,3)}function r(t){var e=s(t);return e&&e.slice(0,3)}function h(t){var e=a(t);return e?e[3]:(e=s(t))?e[3]:(e=n(t))?e[3]:void 0}function l(t){return"#"+y(t[0])+y(t[1])+y(t[2])}function c(t,e){return 1>e||t[3]&&t[3]<1?u(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function u(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function d(t,e){if(1>e||t[3]&&t[3]<1)return f(t,e);var i=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),s=Math.round(t[2]/255*100);return"rgb("+i+"%, "+a+"%, "+s+"%)"}function f(t,e){var i=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),s=Math.round(t[2]/255*100);return"rgba("+i+"%, "+a+"%, "+s+"%, "+(e||t[3]||1)+")"}function m(t,e){return 1>e||t[3]&&t[3]<1?g(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function v(t){return _[t.slice(0,3)]}function b(t,e,i){return Math.min(Math.max(e,t),i)}function y(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var x=t("color-name");e.exports={getRgba:a,getHsla:s,getRgb:o,getHsl:r,getHwb:n,getAlpha:h,hexString:l,rgbString:c,rgbaString:u,percentString:d,percentaString:f,hslString:m,hslaString:g,hwbString:p,keyword:v};var _={};for(var w in x)_[x[w]]=w},{"color-name":5}],5:[function(t,e,i){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}]},{},[1]),
++//! moment.js
++//! version : 2.10.6
++//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
++//! license : MIT
++//! momentjs.com
++!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return Wi.apply(null,arguments)}function e(t){Wi=t}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,a=[];for(i=0;i<t.length;++i)a.push(e(t[i],i));return a}function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function o(t,e){for(var i in e)n(e,i)&&(t[i]=e[i]);return n(e,"toString")&&(t.toString=e.toString),n(e,"valueOf")&&(t.valueOf=e.valueOf),t}function r(t,e,i,a){return At(t,e,i,a,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function l(t){return null==t._pf&&(t._pf=h()),t._pf}function c(t){if(null==t._isValid){var e=l(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function u(t){var e=r(NaN);return null!=t?o(l(e),t):l(e).userInvalidated=!0,e}function d(t,e){var i,a,s;if("undefined"!=typeof e._isAMomentObject&&(t._isAMomentObject=e._isAMomentObject),"undefined"!=typeof e._i&&(t._i=e._i),"undefined"!=typeof e._f&&(t._f=e._f),"undefined"!=typeof e._l&&(t._l=e._l),"undefined"!=typeof e._strict&&(t._strict=e._strict),"undefined"!=typeof e._tzm&&(t._tzm=e._tzm),"undefined"!=typeof e._isUTC&&(t._isUTC=e._isUTC),"undefined"!=typeof e._offset&&(t._offset=e._offset),"undefined"!=typeof e._pf&&(t._pf=l(e)),"undefined"!=typeof e._locale&&(t._locale=e._locale),Fi.length>0)for(i in Fi)a=Fi[i],s=e[a],"undefined"!=typeof s&&(t[a]=s);return t}function f(e){d(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),Yi===!1&&(Yi=!0,t.updateOffset(this),Yi=!1)}function m(t){return t instanceof f||null!=t&&null!=t._isAMomentObject}function g(t){return 0>t?Math.ceil(t):Math.floor(t)}function p(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=g(e)),i}function v(t,e,i){var a,s=Math.min(t.length,e.length),n=Math.abs(t.length-e.length),o=0;for(a=0;s>a;a++)(i&&t[a]!==e[a]||!i&&p(t[a])!==p(e[a]))&&o++;return o+n}function b(){}function y(t){return t?t.toLowerCase().replace("_","-"):t}function x(t){for(var e,i,a,s,n=0;n<t.length;){for(s=y(t[n]).split("-"),e=s.length,i=y(t[n+1]),i=i?i.split("-"):null;e>0;){if(a=_(s.slice(0,e).join("-")))return a;if(i&&i.length>=e&&v(s,i,!0)>=e-1)break;e--}n++}return null}function _(t){var e=null;if(!Li[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=Ri._abbr,require("./locale/"+t),w(e)}catch(i){}return Li[t]}function w(t,e){var i;return t&&(i="undefined"==typeof e?k(t):D(t,e),i&&(Ri=i)),Ri._abbr}function D(t,e){return null!==e?(e.abbr=t,Li[t]=Li[t]||new b,Li[t].set(e),w(t),Li[t]):(delete Li[t],null)}function k(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ri;if(!i(t)){if(e=_(t))return e;t=[t]}return x(t)}function C(t,e){var i=t.toLowerCase();zi[i]=zi[i+"s"]=zi[e]=t}function S(t){return"string"==typeof t?zi[t]||zi[t.toLowerCase()]:void 0}function M(t){var e,i,a={};for(i in t)n(t,i)&&(e=S(i),e&&(a[e]=t[i]));return a}function A(e,i){return function(a){return null!=a?(I(this,e,a),t.updateOffset(this,i),this):P(this,e)}}function P(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function I(t,e,i){return t._d["set"+(t._isUTC?"UTC":"")+e](i)}function T(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=S(t),"function"==typeof this[t])return this[t](e);return this}function O(t,e,i){var a=""+Math.abs(t),s=e-a.length,n=t>=0;return(n?i?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+a}function W(t,e,i,a){var s=a;"string"==typeof a&&(s=function(){return this[a]()}),t&&(Ei[t]=s),e&&(Ei[e[0]]=function(){return O(s.apply(this,arguments),e[1],e[2])}),i&&(Ei[i]=function(){return this.localeData().ordinal(s.apply(this,arguments),t)})}function R(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function F(t){var e,i,a=t.match(Vi);for(e=0,i=a.length;i>e;e++)Ei[a[e]]?a[e]=Ei[a[e]]:a[e]=R(a[e]);return function(s){var n="";for(e=0;i>e;e++)n+=a[e]instanceof Function?a[e].call(s,t):a[e];return n}}function Y(t,e){return t.isValid()?(e=L(e,t.localeData()),Hi[e]=Hi[e]||F(e),Hi[e](t)):t.localeData().invalidDate()}function L(t,e){function i(t){return e.longDateFormat(t)||t}var a=5;for(Bi.lastIndex=0;a>=0&&Bi.test(t);)t=t.replace(Bi,i),Bi.lastIndex=0,a-=1;return t}function z(t){return"function"==typeof t&&"[object Function]"===Object.prototype.toString.call(t)}function V(t,e,i){aa[t]=z(e)?e:function(t){return t&&i?i:e}}function B(t,e){return n(aa,t)?aa[t](e._strict,e._locale):new RegExp(H(t))}function H(t){return t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,a,s){return e||i||a||s}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function E(t,e){var i,a=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(a=function(t,i){i[e]=p(t)}),i=0;i<t.length;i++)sa[t[i]]=a}function N(t,e){E(t,function(t,i,a,s){a._w=a._w||{},e(t,a._w,a,s)})}function U(t,e,i){null!=e&&n(sa,t)&&sa[t](e,i._a,i,t)}function j(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function G(t){return this._months[t.month()]}function q(t){return this._monthsShort[t.month()]}function Z(t,e,i){var a,s,n;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;12>a;a++){if(s=r([2e3,a]),i&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),i||this._monthsParse[a]||(n="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[a]=new RegExp(n.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[a].test(t))return a;if(i&&"MMM"===e&&this._shortMonthsParse[a].test(t))return a;if(!i&&this._monthsParse[a].test(t))return a}}function X(t,e){var i;return"string"==typeof e&&(e=t.localeData().monthsParse(e),"number"!=typeof e)?t:(i=Math.min(t.date(),j(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t)}function J(e){return null!=e?(X(this,e),t.updateOffset(this,!0),this):P(this,"Month")}function Q(){return j(this.year(),this.month())}function $(t){var e,i=t._a;return i&&-2===l(t).overflow&&(e=i[oa]<0||i[oa]>11?oa:i[ra]<1||i[ra]>j(i[na],i[oa])?ra:i[ha]<0||i[ha]>24||24===i[ha]&&(0!==i[la]||0!==i[ca]||0!==i[ua])?ha:i[la]<0||i[la]>59?la:i[ca]<0||i[ca]>59?ca:i[ua]<0||i[ua]>999?ua:-1,l(t)._overflowDayOfYear&&(na>e||e>ra)&&(e=ra),l(t).overflow=e),t}function K(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function tt(t,e){var i=!0;return o(function(){return i&&(K(t+"\n"+(new Error).stack),i=!1),e.apply(this,arguments)},e)}function et(t,e){ma[t]||(K(e),ma[t]=!0)}function it(t){var e,i,a=t._i,s=ga.exec(a);if(s){for(l(t).iso=!0,e=0,i=pa.length;i>e;e++)if(pa[e][1].exec(a)){t._f=pa[e][0];break}for(e=0,i=va.length;i>e;e++)if(va[e][1].exec(a)){t._f+=(s[6]||" ")+va[e][0];break}a.match(ta)&&(t._f+="Z"),_t(t)}else t._isValid=!1}function at(e){var i=ba.exec(e._i);return null!==i?void(e._d=new Date(+i[1])):(it(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function st(t,e,i,a,s,n,o){var r=new Date(t,e,i,a,s,n,o);return 1970>t&&r.setFullYear(t),r}function nt(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function ot(t){return rt(t)?366:365}function rt(t){return t%4===0&&t%100!==0||t%400===0}function ht(){return rt(this.year())}function lt(t,e,i){var a,s=i-e,n=i-t.day();return n>s&&(n-=7),s-7>n&&(n+=7),a=Pt(t).add(n,"d"),{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function ct(t){return lt(t,this._week.dow,this._week.doy).week}function ut(){return this._week.dow}function dt(){return this._week.doy}function ft(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function mt(t){var e=lt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function gt(t,e,i,a,s){var n,o=6+s-a,r=nt(t,0,1+o),h=r.getUTCDay();return s>h&&(h+=7),i=null!=i?1*i:s,n=1+o+7*(e-1)-h+i,{year:n>0?t:t-1,dayOfYear:n>0?n:ot(t-1)+n}}function pt(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function vt(t,e,i){return null!=t?t:null!=e?e:i}function bt(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function yt(t){var e,i,a,s,n=[];if(!t._d){for(a=bt(t),t._w&&null==t._a[ra]&&null==t._a[oa]&&xt(t),t._dayOfYear&&(s=vt(t._a[na],a[na]),t._dayOfYear>ot(s)&&(l(t)._overflowDayOfYear=!0),i=nt(s,0,t._dayOfYear),t._a[oa]=i.getUTCMonth(),t._a[ra]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=n[e]=a[e];for(;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ha]&&0===t._a[la]&&0===t._a[ca]&&0===t._a[ua]&&(t._nextDay=!0,t._a[ha]=0),t._d=(t._useUTC?nt:st).apply(null,n),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ha]=24)}}function xt(t){var e,i,a,s,n,o,r;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(n=1,o=4,i=vt(e.GG,t._a[na],lt(Pt(),1,4).year),a=vt(e.W,1),s=vt(e.E,1)):(n=t._locale._week.dow,o=t._locale._week.doy,i=vt(e.gg,t._a[na],lt(Pt(),n,o).year),a=vt(e.w,1),null!=e.d?(s=e.d,n>s&&++a):s=null!=e.e?e.e+n:n),r=gt(i,a,s,o,n),t._a[na]=r.year,t._dayOfYear=r.dayOfYear}function _t(e){if(e._f===t.ISO_8601)return void it(e);e._a=[],l(e).empty=!0;var i,a,s,n,o,r=""+e._i,h=r.length,c=0;for(s=L(e._f,e._locale).match(Vi)||[],i=0;i<s.length;i++)n=s[i],a=(r.match(B(n,e))||[])[0],a&&(o=r.substr(0,r.indexOf(a)),o.length>0&&l(e).unusedInput.push(o),r=r.slice(r.indexOf(a)+a.length),c+=a.length),Ei[n]?(a?l(e).empty=!1:l(e).unusedTokens.push(n),U(n,a,e)):e._strict&&!a&&l(e).unusedTokens.push(n);l(e).charsLeftOver=h-c,r.length>0&&l(e).unusedInput.push(r),l(e).bigHour===!0&&e._a[ha]<=12&&e._a[ha]>0&&(l(e).bigHour=void 0),e._a[ha]=wt(e._locale,e._a[ha],e._meridiem),yt(e),$(e)}function wt(t,e,i){var a;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(a=t.isPM(i),a&&12>e&&(e+=12),a||12!==e||(e=0),e):e}function Dt(t){var e,i,a,s,n;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(s=0;s<t._f.length;s++)n=0,e=d({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[s],_t(e),c(e)&&(n+=l(e).charsLeftOver,n+=10*l(e).unusedTokens.length,l(e).score=n,(null==a||a>n)&&(a=n,i=e));o(t,i||e)}function kt(t){if(!t._d){var e=M(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],yt(t)}}function Ct(t){var e=new f($(St(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function St(t){var e=t._i,s=t._f;return t._locale=t._locale||k(t._l),null===e||void 0===s&&""===e?u({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),m(e)?new f($(e)):(i(s)?Dt(t):s?_t(t):a(e)?t._d=e:Mt(t),t))}function Mt(e){var n=e._i;void 0===n?e._d=new Date:a(n)?e._d=new Date(+n):"string"==typeof n?at(e):i(n)?(e._a=s(n.slice(0),function(t){return parseInt(t,10)}),yt(e)):"object"==typeof n?kt(e):"number"==typeof n?e._d=new Date(n):t.createFromInputFallback(e)}function At(t,e,i,a,s){var n={};return"boolean"==typeof i&&(a=i,i=void 0),n._isAMomentObject=!0,n._useUTC=n._isUTC=s,n._l=i,n._i=t,n._f=e,n._strict=a,Ct(n)}function Pt(t,e,i,a){return At(t,e,i,a,!1)}function It(t,e){var a,s;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Pt();for(a=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][t](a))&&(a=e[s]);return a}function Tt(){var t=[].slice.call(arguments,0);return It("isBefore",t)}function Ot(){var t=[].slice.call(arguments,0);return It("isAfter",t)}function Wt(t){var e=M(t),i=e.year||0,a=e.quarter||0,s=e.month||0,n=e.week||0,o=e.day||0,r=e.hour||0,h=e.minute||0,l=e.second||0,c=e.millisecond||0;this._milliseconds=+c+1e3*l+6e4*h+36e5*r,this._days=+o+7*n,this._months=+s+3*a+12*i,this._data={},this._locale=k(),this._bubble()}function Rt(t){return t instanceof Wt}function Ft(t,e){W(t,0,0,function(){var t=this.utcOffset(),i="+";return 0>t&&(t=-t,i="-"),i+O(~~(t/60),2)+e+O(~~t%60,2)})}function Yt(t){var e=(t||"").match(ta)||[],i=e[e.length-1]||[],a=(i+"").match(Da)||["-",0,0],s=+(60*a[1])+p(a[2]);return"+"===a[0]?s:-s}function Lt(e,i){var s,n;return i._isUTC?(s=i.clone(),n=(m(e)||a(e)?+e:+Pt(e))-+s,s._d.setTime(+s._d+n),t.updateOffset(s,!1),s):Pt(e).local()}function zt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Vt(e,i){var a,s=this._offset||0;return null!=e?("string"==typeof e&&(e=Yt(e)),Math.abs(e)<16&&(e=60*e),!this._isUTC&&i&&(a=zt(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),s!==e&&(!i||this._changeInProgress?ee(this,Jt(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:zt(this)}function Bt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Ht(t){return this.utcOffset(0,t)}function Et(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(zt(this),"m")),this}function Nt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Yt(this._i)),this}function Ut(t){return t=t?Pt(t).utcOffset():0,(this.utcOffset()-t)%60===0}function jt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Gt(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var t={};if(d(t,this),t=St(t),t._a){var e=t._isUTC?r(t._a):Pt(t._a);this._isDSTShifted=this.isValid()&&v(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function qt(){return!this._isUTC}function Zt(){return this._isUTC}function Xt(){return this._isUTC&&0===this._offset}function Jt(t,e){var i,a,s,o=t,r=null;return Rt(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(r=ka.exec(t))?(i="-"===r[1]?-1:1,o={y:0,d:p(r[ra])*i,h:p(r[ha])*i,m:p(r[la])*i,s:p(r[ca])*i,ms:p(r[ua])*i}):(r=Ca.exec(t))?(i="-"===r[1]?-1:1,o={y:Qt(r[2],i),M:Qt(r[3],i),d:Qt(r[4],i),h:Qt(r[5],i),m:Qt(r[6],i),s:Qt(r[7],i),w:Qt(r[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(s=Kt(Pt(o.from),Pt(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new Wt(o),Rt(t)&&n(t,"_locale")&&(a._locale=t._locale),a}function Qt(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function $t(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function Kt(t,e){var i;return e=Lt(e,t),t.isBefore(e)?i=$t(t,e):(i=$t(e,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function te(t,e){return function(i,a){var s,n;return null===a||isNaN(+a)||(et(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),n=i,i=a,a=n),i="string"==typeof i?+i:i,s=Jt(i,a),ee(this,s,t),this}}function ee(e,i,a,s){var n=i._milliseconds,o=i._days,r=i._months;s=null==s?!0:s,n&&e._d.setTime(+e._d+n*a),o&&I(e,"Date",P(e,"Date")+o*a),r&&X(e,P(e,"Month")+r*a),s&&t.updateOffset(e,o||r)}function ie(t,e){var i=t||Pt(),a=Lt(i,this).startOf("day"),s=this.diff(a,"days",!0),n=-6>s?"sameElse":-1>s?"lastWeek":0>s?"lastDay":1>s?"sameDay":2>s?"nextDay":7>s?"nextWeek":"sameElse";return this.format(e&&e[n]||this.localeData().calendar(n,this,Pt(i)))}function ae(){return new f(this)}function se(t,e){var i;return e=S("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:Pt(t),+this>+t):(i=m(t)?+t:+Pt(t),i<+this.clone().startOf(e))}function ne(t,e){var i;return e=S("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=m(t)?t:Pt(t),+t>+this):(i=m(t)?+t:+Pt(t),+this.clone().endOf(e)<i)}function oe(t,e,i){return this.isAfter(t,i)&&this.isBefore(e,i)}function re(t,e){var i;return e=S(e||"millisecond"),"millisecond"===e?(t=m(t)?t:Pt(t),+this===+t):(i=+Pt(t),+this.clone().startOf(e)<=i&&i<=+this.clone().endOf(e))}function he(t,e,i){var a,s,n=Lt(t,this),o=6e4*(n.utcOffset()-this.utcOffset());return e=S(e),"year"===e||"month"===e||"quarter"===e?(s=le(this,n),"quarter"===e?s/=3:"year"===e&&(s/=12)):(a=this-n,s="second"===e?a/1e3:"minute"===e?a/6e4:"hour"===e?a/36e5:"day"===e?(a-o)/864e5:"week"===e?(a-o)/6048e5:a),i?s:g(s)}function le(t,e){var i,a,s=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(s,"months");return 0>e-n?(i=t.clone().add(s-1,"months"),a=(e-n)/(n-i)):(i=t.clone().add(s+1,"months"),a=(e-n)/(i-n)),-(s+a)}function ce(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ue(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():Y(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Y(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function de(e){var i=Y(this,e||t.defaultFormat);return this.localeData().postformat(i)}function fe(t,e){return this.isValid()?Jt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function me(t){return this.from(Pt(),t)}function ge(t,e){return this.isValid()?Jt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function pe(t){return this.to(Pt(),t)}function ve(t){var e;return void 0===t?this._locale._abbr:(e=k(t),null!=e&&(this._locale=e),this)}function be(){return this._locale}function ye(t){switch(t=S(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function xe(t){return t=S(t),void 0===t||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")}function _e(){return+this._d-6e4*(this._offset||0)}function we(){return Math.floor(+this/1e3)}function De(){return this._offset?new Date(+this):this._d}function ke(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Ce(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Se(){return c(this)}function Me(){return o({},l(this))}function Ae(){return l(this).overflow}function Pe(t,e){W(0,[t,t.length],0,e)}function Ie(t,e,i){return lt(Pt([t,11,31+e-i]),e,i).week}function Te(t){var e=lt(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==t?e:this.add(t-e,"y")}function Oe(t){var e=lt(this,1,4).year;return null==t?e:this.add(t-e,"y")}function We(){return Ie(this.year(),1,4)}function Re(){var t=this.localeData()._week;return Ie(this.year(),t.dow,t.doy)}function Fe(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Ye(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Le(t){return this._weekdays[t.day()]}function ze(t){return this._weekdaysShort[t.day()]}function Ve(t){return this._weekdaysMin[t.day()]}function Be(t){var e,i,a;for(this._weekdaysParse=this._weekdaysParse||[],e=0;7>e;e++)if(this._weekdaysParse[e]||(i=Pt([2e3,1]).day(e),a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[e]=new RegExp(a.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e}function He(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ye(t,this.localeData()),this.add(t-e,"d")):e}function Ee(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ne(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)}function Ue(t,e){W(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function je(t,e){return e._meridiemParse}function Ge(t){return"p"===(t+"").toLowerCase().charAt(0)}function qe(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}function Ze(t,e){e[ua]=p(1e3*("0."+t))}function Xe(){return this._isUTC?"UTC":""}function Je(){return this._isUTC?"Coordinated Universal Time":""}function Qe(t){return Pt(1e3*t)}function $e(){return Pt.apply(null,arguments).parseZone()}function Ke(t,e,i){var a=this._calendar[t];return"function"==typeof a?a.call(e,i):a}function ti(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function ei(){return this._invalidDate}function ii(t){return this._ordinal.replace("%d",t)}function ai(t){return t}function si(t,e,i,a){var s=this._relativeTime[i];return"function"==typeof s?s(t,e,i,a):s.replace(/%d/i,t)}function ni(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)}function oi(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ri(t,e,i,a){var s=k(),n=r().set(a,e);return s[i](n,t)}function hi(t,e,i,a,s){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ri(t,e,i,s);var n,o=[];for(n=0;a>n;n++)o[n]=ri(t,n,i,s);return o}function li(t,e){return hi(t,e,"months",12,"month")}function ci(t,e){return hi(t,e,"monthsShort",12,"month")}function ui(t,e){return hi(t,e,"weekdays",7,"day")}function di(t,e){return hi(t,e,"weekdaysShort",7,"day")}function fi(t,e){return hi(t,e,"weekdaysMin",7,"day")}function mi(){var t=this._data;return this._milliseconds=Za(this._milliseconds),this._days=Za(this._days),this._months=Za(this._months),t.milliseconds=Za(t.milliseconds),t.seconds=Za(t.seconds),t.minutes=Za(t.minutes),t.hours=Za(t.hours),t.months=Za(t.months),t.years=Za(t.years),this}function gi(t,e,i,a){var s=Jt(e,i);return t._milliseconds+=a*s._milliseconds,t._days+=a*s._days,t._months+=a*s._months,t._bubble()}function pi(t,e){return gi(this,t,e,1)}function vi(t,e){return gi(this,t,e,-1)}function bi(t){return 0>t?Math.floor(t):Math.ceil(t)}function yi(){var t,e,i,a,s,n=this._milliseconds,o=this._days,r=this._months,h=this._data;return n>=0&&o>=0&&r>=0||0>=n&&0>=o&&0>=r||(n+=864e5*bi(_i(r)+o),o=0,r=0),h.milliseconds=n%1e3,t=g(n/1e3),h.seconds=t%60,e=g(t/60),h.minutes=e%60,i=g(e/60),h.hours=i%24,o+=g(i/24),s=g(xi(o)),r+=s,o-=bi(_i(s)),a=g(r/12),r%=12,h.days=o,h.months=r,h.years=a,this}function xi(t){return 4800*t/146097}function _i(t){return 146097*t/4800}function wi(t){var e,i,a=this._milliseconds;if(t=S(t),"month"===t||"year"===t)return e=this._days+a/864e5,i=this._months+xi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(_i(this._months)),t){case"week":return e/7+a/6048e5;case"day":return e+a/864e5;case"hour":return 24*e+a/36e5;case"minute":return 1440*e+a/6e4;case"second":return 86400*e+a/1e3;case"millisecond":return Math.floor(864e5*e)+a;default:throw new Error("Unknown unit "+t)}}function Di(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)}function ki(t){return function(){return this.as(t)}}function Ci(t){return t=S(t),this[t+"s"]()}function Si(t){return function(){return this._data[t]}}function Mi(){return g(this.days()/7)}function Ai(t,e,i,a,s){return s.relativeTime(e||1,!!i,t,a)}function Pi(t,e,i){var a=Jt(t).abs(),s=cs(a.as("s")),n=cs(a.as("m")),o=cs(a.as("h")),r=cs(a.as("d")),h=cs(a.as("M")),l=cs(a.as("y")),c=s<us.s&&["s",s]||1===n&&["m"]||n<us.m&&["mm",n]||1===o&&["h"]||o<us.h&&["hh",o]||1===r&&["d"]||r<us.d&&["dd",r]||1===h&&["M"]||h<us.M&&["MM",h]||1===l&&["y"]||["yy",l];return c[2]=e,c[3]=+t>0,c[4]=i,Ai.apply(null,c)}function Ii(t,e){return void 0===us[t]?!1:void 0===e?us[t]:(us[t]=e,!0)}function Ti(t){var e=this.localeData(),i=Pi(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)}function Oi(){var t,e,i,a=ds(this._milliseconds)/1e3,s=ds(this._days),n=ds(this._months);t=g(a/60),e=g(t/60),a%=60,t%=60,i=g(n/12),n%=12;var o=i,r=n,h=s,l=e,c=t,u=a,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(o?o+"Y":"")+(r?r+"M":"")+(h?h+"D":"")+(l||c||u?"T":"")+(l?l+"H":"")+(c?c+"M":"")+(u?u+"S":""):"P0D"}var Wi,Ri,Fi=t.momentProperties=[],Yi=!1,Li={},zi={},Vi=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Bi=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hi={},Ei={},Ni=/\d/,Ui=/\d\d/,ji=/\d{3}/,Gi=/\d{4}/,qi=/[+-]?\d{6}/,Zi=/\d\d?/,Xi=/\d{1,3}/,Ji=/\d{1,4}/,Qi=/[+-]?\d{1,6}/,$i=/\d+/,Ki=/[+-]?\d+/,ta=/Z|[+-]\d\d:?\d\d/gi,ea=/[+-]?\d+(\.\d{1,3})?/,ia=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,aa={},sa={},na=0,oa=1,ra=2,ha=3,la=4,ca=5,ua=6;W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),W("MMMM",0,0,function(t){return this.localeData().months(this,t)}),C("month","M"),V("M",Zi),V("MM",Zi,Ui),V("MMM",ia),V("MMMM",ia),E(["M","MM"],function(t,e){e[oa]=p(t)-1}),E(["MMM","MMMM"],function(t,e,i,a){var s=i._locale.monthsParse(t,a,i._strict);null!=s?e[oa]=s:l(i).invalidMonth=t});var da="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),fa="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ma={};t.suppressDeprecationWarnings=!1;var ga=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],va=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ba=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=tt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),C("year","y"),V("Y",Ki),V("YY",Zi,Ui),V("YYYY",Ji,Gi),V("YYYYY",Qi,qi),V("YYYYYY",Qi,qi),E(["YYYYY","YYYYYY"],na),E("YYYY",function(e,i){i[na]=2===e.length?t.parseTwoDigitYear(e):p(e)}),E("YY",function(e,i){i[na]=t.parseTwoDigitYear(e)}),t.parseTwoDigitYear=function(t){return p(t)+(p(t)>68?1900:2e3)};var ya=A("FullYear",!1);W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),V("w",Zi),V("ww",Zi,Ui),V("W",Zi),V("WW",Zi,Ui),N(["w","ww","W","WW"],function(t,e,i,a){e[a.substr(0,1)]=p(t)});var xa={dow:0,doy:6};W("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),V("DDD",Xi),V("DDDD",ji),E(["DDD","DDDD"],function(t,e,i){i._dayOfYear=p(t)}),t.ISO_8601=function(){};var _a=tt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return this>t?this:t}),wa=tt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Pt.apply(null,arguments);return t>this?this:t});Ft("Z",":"),Ft("ZZ",""),V("Z",ta),V("ZZ",ta),E(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Yt(t)});var Da=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var ka=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ca=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Jt.fn=Wt.prototype;var Sa=te(1,"add"),Ma=te(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Aa=tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pe("gggg","weekYear"),Pe("ggggg","weekYear"),Pe("GGGG","isoWeekYear"),Pe("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),V("G",Ki),V("g",Ki),V("GG",Zi,Ui),V("gg",Zi,Ui),V("GGGG",Ji,Gi),V("gggg",Ji,Gi),V("GGGGG",Qi,qi),V("ggggg",Qi,qi),N(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,a){e[a.substr(0,2)]=p(t)}),N(["gg","GG"],function(e,i,a,s){i[s]=t.parseTwoDigitYear(e)}),W("Q",0,0,"quarter"),C("quarter","Q"),V("Q",Ni),E("Q",function(t,e){e[oa]=3*(p(t)-1)}),W("D",["DD",2],"Do","date"),C("date","D"),V("D",Zi),V("DD",Zi,Ui),V("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),E(["D","DD"],ra),E("Do",function(t,e){e[ra]=p(t.match(Zi)[0],10)});var Pa=A("Date",!0);W("d",0,"do","day"),W("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),W("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),W("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),V("d",Zi),V("e",Zi),V("E",Zi),V("dd",ia),V("ddd",ia),V("dddd",ia),N(["dd","ddd","dddd"],function(t,e,i){var a=i._locale.weekdaysParse(t);null!=a?e.d=a:l(i).invalidWeekday=t}),N(["d","e","E"],function(t,e,i,a){e[a]=p(t)});var Ia="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ta="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Oa="Su_Mo_Tu_We_Th_Fr_Sa".split("_");W("H",["HH",2],0,"hour"),W("h",["hh",2],0,function(){return this.hours()%12||12}),Ue("a",!0),Ue("A",!1),C("hour","h"),V("a",je),V("A",je),V("H",Zi),V("h",Zi),V("HH",Zi,Ui),V("hh",Zi,Ui),E(["H","HH"],ha),E(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),E(["h","hh"],function(t,e,i){e[ha]=p(t),l(i).bigHour=!0});var Wa=/[ap]\.?m?\.?/i,Ra=A("Hours",!0);W("m",["mm",2],0,"minute"),C("minute","m"),V("m",Zi),V("mm",Zi,Ui),E(["m","mm"],la);var Fa=A("Minutes",!1);W("s",["ss",2],0,"second"),C("second","s"),V("s",Zi),V("ss",Zi,Ui),E(["s","ss"],ca);var Ya=A("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),V("S",Xi,Ni),V("SS",Xi,Ui),V("SSS",Xi,ji);var La;for(La="SSSS";La.length<=9;La+="S")V(La,$i);for(La="S";La.length<=9;La+="S")E(La,Ze);var za=A("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var Va=f.prototype;Va.add=Sa,Va.calendar=ie,Va.clone=ae,Va.diff=he,Va.endOf=xe,Va.format=de,Va.from=fe,Va.fromNow=me,Va.to=ge,Va.toNow=pe,Va.get=T,Va.invalidAt=Ae,Va.isAfter=se,Va.isBefore=ne,Va.isBetween=oe,Va.isSame=re,Va.isValid=Se,Va.lang=Aa,Va.locale=ve,Va.localeData=be,Va.max=wa,Va.min=_a,Va.parsingFlags=Me,Va.set=T,Va.startOf=ye,Va.subtract=Ma,Va.toArray=ke,Va.toObject=Ce,Va.toDate=De,Va.toISOString=ue,Va.toJSON=ue,Va.toString=ce,Va.unix=we,Va.valueOf=_e,Va.year=ya,Va.isLeapYear=ht,Va.weekYear=Te,Va.isoWeekYear=Oe,Va.quarter=Va.quarters=Fe,Va.month=J,Va.daysInMonth=Q,Va.week=Va.weeks=ft,Va.isoWeek=Va.isoWeeks=mt,Va.weeksInYear=Re,Va.isoWeeksInYear=We,Va.date=Pa,Va.day=Va.days=He,Va.weekday=Ee,Va.isoWeekday=Ne,Va.dayOfYear=pt,Va.hour=Va.hours=Ra,Va.minute=Va.minutes=Fa,Va.second=Va.seconds=Ya,
++Va.millisecond=Va.milliseconds=za,Va.utcOffset=Vt,Va.utc=Ht,Va.local=Et,Va.parseZone=Nt,Va.hasAlignedHourOffset=Ut,Va.isDST=jt,Va.isDSTShifted=Gt,Va.isLocal=qt,Va.isUtcOffset=Zt,Va.isUtc=Xt,Va.isUTC=Xt,Va.zoneAbbr=Xe,Va.zoneName=Je,Va.dates=tt("dates accessor is deprecated. Use date instead.",Pa),Va.months=tt("months accessor is deprecated. Use month instead",J),Va.years=tt("years accessor is deprecated. Use year instead",ya),Va.zone=tt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Bt);var Ba=Va,Ha={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ea={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Na="Invalid date",Ua="%d",ja=/\d{1,2}/,Ga={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"},qa=b.prototype;qa._calendar=Ha,qa.calendar=Ke,qa._longDateFormat=Ea,qa.longDateFormat=ti,qa._invalidDate=Na,qa.invalidDate=ei,qa._ordinal=Ua,qa.ordinal=ii,qa._ordinalParse=ja,qa.preparse=ai,qa.postformat=ai,qa._relativeTime=Ga,qa.relativeTime=si,qa.pastFuture=ni,qa.set=oi,qa.months=G,qa._months=da,qa.monthsShort=q,qa._monthsShort=fa,qa.monthsParse=Z,qa.week=ct,qa._week=xa,qa.firstDayOfYear=dt,qa.firstDayOfWeek=ut,qa.weekdays=Le,qa._weekdays=Ia,qa.weekdaysMin=Ve,qa._weekdaysMin=Oa,qa.weekdaysShort=ze,qa._weekdaysShort=Ta,qa.weekdaysParse=Be,qa.isPM=Ge,qa._meridiemParse=Wa,qa.meridiem=qe,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===p(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),t.lang=tt("moment.lang is deprecated. Use moment.locale instead.",w),t.langData=tt("moment.langData is deprecated. Use moment.localeData instead.",k);var Za=Math.abs,Xa=ki("ms"),Ja=ki("s"),Qa=ki("m"),$a=ki("h"),Ka=ki("d"),ts=ki("w"),es=ki("M"),is=ki("y"),as=Si("milliseconds"),ss=Si("seconds"),ns=Si("minutes"),os=Si("hours"),rs=Si("days"),hs=Si("months"),ls=Si("years"),cs=Math.round,us={s:45,m:45,h:22,d:26,M:11},ds=Math.abs,fs=Wt.prototype;fs.abs=mi,fs.add=pi,fs.subtract=vi,fs.as=wi,fs.asMilliseconds=Xa,fs.asSeconds=Ja,fs.asMinutes=Qa,fs.asHours=$a,fs.asDays=Ka,fs.asWeeks=ts,fs.asMonths=es,fs.asYears=is,fs.valueOf=Di,fs._bubble=yi,fs.get=Ci,fs.milliseconds=as,fs.seconds=ss,fs.minutes=ns,fs.hours=os,fs.days=rs,fs.weeks=Mi,fs.months=hs,fs.years=ls,fs.humanize=Ti,fs.toISOString=Oi,fs.toString=Oi,fs.toJSON=Oi,fs.locale=ve,fs.localeData=be,fs.toIsoString=tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Oi),fs.lang=Aa,W("X",0,0,"unix"),W("x",0,0,"valueOf"),V("x",Ki),V("X",ea),E("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),E("x",function(t,e,i){i._d=new Date(p(t))}),t.version="2.10.6",e(Pt),t.fn=Ba,t.min=Tt,t.max=Ot,t.utc=r,t.unix=Qe,t.months=li,t.isDate=a,t.locale=w,t.invalid=u,t.duration=Jt,t.isMoment=m,t.weekdays=ui,t.parseZone=$e,t.localeData=k,t.isDuration=Rt,t.monthsShort=ci,t.weekdaysMin=fi,t.defineLocale=D,t.weekdaysShort=di,t.normalizeUnits=S,t.relativeTimeThreshold=Ii;var ms=t;return ms});
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
<script>
- var randomScalingFactor = function() {
- return Math.round(Math.random() * 50 * (Math.random() > 0.5 ? 1 : 1)) + 50;
- };
- var randomColorFactor = function() {
- return Math.round(Math.random() * 255);
- };
- var randomColor = function(opacity) {
- return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
- };
-
- var config = {
- type: 'line',
- data: {
- labels: ["January", "February", "March", "April", "May", "June", "July"],
- datasets: [{
- label: "My First dataset",
- data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
- fill: false,
- borderDash: [5, 5],
- }, {
- label: "My Second dataset",
- data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
- }]
- },
- options: {
- responsive: true,
- scales: {
- xAxes: [{
- display: true,
- labels: {
- userCallback: function(dataLabel, index) {
- return index % 2 === 0 ? dataLabel : null;
- }
- }
- }],
- yAxes: [{
- display: true,
- beginAtZero: false
+ var randomScalingFactor = function() {
+ return Math.round(Math.random() * 50 * (Math.random() > 0.5 ? 1 : 1)) + 50;
+ };
+ var randomColorFactor = function() {
+ return Math.round(Math.random() * 255);
+ };
+ var randomColor = function(opacity) {
+ return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
+ };
+
+ var config = {
+ type: 'line',
+ data: {
+ labels: ["January is a long month", "February", "March", "April", "May", "June", "July"],
+ datasets: [{
+ label: "My First dataset",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
+ fill: false,
+ borderDash: [5, 5],
+ }, {
+ label: "My Second dataset",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
}]
+ },
+ options: {
+ responsive: true,
+ scales: {
+ xAxes: [{
+ display: true,
+ ticks: {
+ callback: function(dataLabel, index) {
+ return dataLabel;
+ }
+ }
+ }],
+ yAxes: [{
+ display: true,
+ beginAtZero: false
+ }]
+ }
}
- }
- };
+ };
- $.each(config.data.datasets, function(i, dataset) {
- dataset.borderColor = randomColor(0.4);
- dataset.backgroundColor = randomColor(0.5);
- dataset.pointBorderColor = randomColor(0.7);
- dataset.pointBackgroundColor = randomColor(0.5);
- dataset.pointBorderWidth = 1;
- });
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.borderColor = randomColor(0.4);
+ dataset.backgroundColor = randomColor(0.5);
+ dataset.pointBorderColor = randomColor(0.7);
+ dataset.pointBackgroundColor = randomColor(0.5);
+ dataset.pointBorderWidth = 1;
+ });
- console.log(config.data);
+ console.log(config.data);
- window.onload = function() {
- var ctx = document.getElementById("canvas").getContext("2d");
- window.myLine = new Chart(ctx, config);
- };
+ window.onload = function() {
+ var ctx = document.getElementById("canvas").getContext("2d");
+ window.myLine = new Chart(ctx, config);
+ };
+
+ $('#randomizeData').click(function() {
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.data = dataset.data.map(function() {
+ return randomScalingFactor();
+ });
- $('#randomizeData').click(function() {
- $.each(config.data.datasets, function(i, dataset) {
- dataset.data = dataset.data.map(function() {
- return randomScalingFactor();
});
+ window.myLine.update();
});
- window.myLine.update();
- });
-
- $('#addDataset').click(function() {
- var newDataset = {
- label: 'Dataset ' + config.data.datasets.length,
- borderColor: randomColor(0.4),
- backgroundColor: randomColor(0.5),
- pointBorderColor: randomColor(0.7),
- pointBackgroundColor: randomColor(0.5),
- pointBorderWidth: 1,
- data: [],
- };
+ $('#addDataset').click(function() {
+ var newDataset = {
+ label: 'Dataset ' + config.data.datasets.length,
+ borderColor: randomColor(0.4),
+ backgroundColor: randomColor(0.5),
+ pointBorderColor: randomColor(0.7),
+ pointBackgroundColor: randomColor(0.5),
+ pointBorderWidth: 1,
+ data: [],
+ };
+
+ for (var index = 0; index < config.data.labels.length; ++index) {
+ newDataset.data.push(randomScalingFactor());
+ }
- window.myLine.addDataset(newDataset);
- for (var index = 0; index < config.data.labels.length; ++index) {
- newDataset.data.push(randomScalingFactor());
- }
++ config.data.datasets.push(newDataset);
++ window.myLine.update();
+ });
- config.data.datasets.push(newDataset);
- window.myLine.update();
- });
+ $('#addData').click(function() {
+ if (config.data.datasets.length > 0) {
+ config.data.labels.push('dataset #' + config.data.labels.length);
- $('#addData').click(function() {
- if (config.data.datasets.length > 0) {
- config.data.labels.push('dataset #' + config.data.labels.length);
+ for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
++ config.data.datasets[index].data.push(randomScalingFactor());
+ }
+
- for (var index = 0; index < config.data.datasets.length; ++index) {
- config.data.datasets[index].data.push(randomScalingFactor());
++ window.myLine.update();
}
+ });
- window.myLine.removeDataset(0);
+ $('#removeDataset').click(function() {
- }
- });
++ config.data.datasets.splice(0, 1);
+ window.myLine.update();
+ });
- $('#removeDataset').click(function() {
- config.data.datasets.splice(0, 1);
- window.myLine.update();
- });
+ $('#removeData').click(function() {
+ config.data.labels.splice(-1, 1); // remove the label first
- $('#removeData').click(function() {
- config.data.labels.splice(-1, 1); // remove the label first
+ config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myLine.removeData(datasetIndex, -1);
++ dataset.data.pop();
+ });
+
- config.data.datasets.forEach(function(dataset, datasetIndex) {
- dataset.data.pop();
++ window.myLine.update();
});
-
- window.myLine.update();
- });
</script>
</body>
</div>
</div>
<script>
- var randomScalingFactor = function() {
- return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
- };
- var randomColorFactor = function() {
- return Math.round(Math.random() * 255);
- };
- var randomColor = function(opacity) {
- return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
- };
-
- var config = {
- type: 'line',
- data: {
- labels: ["January", "February", "March", "April", "May", "June", "July"],
- datasets: [{
- label: "My First dataset",
- data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
- fill: false,
- borderDash: [5, 5],
- }, {
- label: "My Second dataset",
- data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
- }]
- },
- options: {
- responsive: true,
- scales: {
- xAxes: [{
- display: true,
- scaleLabel: {
- show: true,
- labelString: 'Month'
- }
- }],
- yAxes: [{
- display: true,
- scaleLabel: {
- show: true,
- labelString: 'Value'
- }
+ var randomScalingFactor = function() {
+ return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
+ };
+ var randomColorFactor = function() {
+ return Math.round(Math.random() * 255);
+ };
+ var randomColor = function(opacity) {
+ return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
+ };
+
+ var config = {
+ type: 'line',
+ data: {
+ labels: ["January", "February", "March", "April", "May", "June", "July"],
+ datasets: [{
+ label: "My First dataset",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
+ fill: false,
+ borderDash: [5, 5],
+ }, {
+ label: "My Second dataset",
+ data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
}]
+ },
+ options: {
+ responsive: true,
+ scales: {
+ xAxes: [{
+ display: true,
+ scaleLabel: {
+ show: true,
+ labelString: 'Month'
+ }
+ }],
+ yAxes: [{
+ display: true,
+ scaleLabel: {
+ show: true,
+ labelString: 'Value'
+ }
+ }]
+ }
}
- }
- };
+ };
- $.each(config.data.datasets, function(i, dataset) {
- dataset.borderColor = randomColor(0.4);
- dataset.backgroundColor = randomColor(0.5);
- dataset.pointBorderColor = randomColor(0.7);
- dataset.pointBackgroundColor = randomColor(0.5);
- dataset.pointBorderWidth = 1;
- });
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.borderColor = randomColor(0.4);
+ dataset.backgroundColor = randomColor(0.5);
+ dataset.pointBorderColor = randomColor(0.7);
+ dataset.pointBackgroundColor = randomColor(0.5);
+ dataset.pointBorderWidth = 1;
+ });
- console.log(config.data);
+ console.log(config.data);
- window.onload = function() {
- var ctx = document.getElementById("canvas").getContext("2d");
- window.myLine = new Chart(ctx, config);
+ window.onload = function() {
+ var ctx = document.getElementById("canvas").getContext("2d");
+ window.myLine = new Chart(ctx, config);
- updateLegend();
- };
+ updateLegend();
+ };
- function updateLegend() {
- $legendContainer = $('#legendContainer');
- $legendContainer.empty();
- $legendContainer.append(window.myLine.generateLegend());
- }
+ function updateLegend() {
+ $legendContainer = $('#legendContainer');
+ $legendContainer.empty();
+ $legendContainer.append(window.myLine.generateLegend());
+ }
+
+ $('#randomizeData').click(function() {
+ $.each(config.data.datasets, function(i, dataset) {
+ dataset.data = dataset.data.map(function() {
+ return randomScalingFactor();
+ });
- $('#randomizeData').click(function() {
- $.each(config.data.datasets, function(i, dataset) {
- dataset.data = dataset.data.map(function() {
- return randomScalingFactor();
});
+ window.myLine.update();
+ updateLegend();
});
- window.myLine.update();
- updateLegend();
- });
-
- $('#addDataset').click(function() {
- var newDataset = {
- label: 'Dataset ' + config.data.datasets.length,
- borderColor: randomColor(0.4),
- backgroundColor: randomColor(0.5),
- pointBorderColor: randomColor(0.7),
- pointBackgroundColor: randomColor(0.5),
- pointBorderWidth: 1,
- data: [],
- };
+ $('#addDataset').click(function() {
+ var newDataset = {
+ label: 'Dataset ' + config.data.datasets.length,
+ borderColor: randomColor(0.4),
+ backgroundColor: randomColor(0.5),
+ pointBorderColor: randomColor(0.7),
+ pointBackgroundColor: randomColor(0.5),
+ pointBorderWidth: 1,
+ data: [],
+ };
+
+ for (var index = 0; index < config.data.labels.length; ++index) {
+ newDataset.data.push(randomScalingFactor());
+ }
- window.myLine.addDataset(newDataset);
- for (var index = 0; index < config.data.labels.length; ++index) {
- newDataset.data.push(randomScalingFactor());
- }
++ config.data.datasets.push(newDataset);
++ window.myLine.update();
+ updateLegend();
+ });
- config.data.datasets.push(newDataset);
- window.myLine.update();
- updateLegend();
- });
+ $('#addData').click(function() {
+ if (config.data.datasets.length > 0) {
+ config.data.labels.push('dataset #' + config.data.labels.length);
- for (var index = 0; index < config.data.datasets.length; ++index) {
- window.myLine.addData(randomScalingFactor(), index);
- }
- $('#addData').click(function() {
- if (config.data.datasets.length > 0) {
- config.data.labels.push('dataset #' + config.data.labels.length);
++ $.each(config.data.datasets, function(i, dataset) {
++ dataset.data.push(randomScalingFactor());
++ });
- $.each(config.data.datasets, function(i, dataset) {
- dataset.data.push(randomScalingFactor());
- });
++ window.myLine.update();
+ updateLegend();
+ }
+ });
- window.myLine.removeDataset(0);
+ $('#removeDataset').click(function() {
++ config.data.datasets.splice(0, 1);
+ window.myLine.update();
updateLegend();
- }
- });
+ });
- $('#removeDataset').click(function() {
- config.data.datasets.splice(0, 1);
- window.myLine.update();
- updateLegend();
- });
+ $('#removeData').click(function() {
+ config.data.labels.splice(-1, 1); // remove the label first
- $('#removeData').click(function() {
- config.data.labels.splice(-1, 1); // remove the label first
+ config.data.datasets.forEach(function(dataset, datasetIndex) {
- window.myLine.removeData(datasetIndex, -1);
++ dataset.data.pop();
+ });
- config.data.datasets.forEach(function(dataset, datasetIndex) {
- dataset.data.pop();
++ window.myLine.update();
+ updateLegend();
});
-
- window.myLine.update();
- updateLegend();
- });
</script>
</body>
this.update(true);
},
- update: function(reset) {
+ buildOrUpdateElements: function buildOrUpdateElements() {
+ // Handle the number of data points changing
+ var numData = this.getDataset().data.length;
+ var numPoints = this.getDataset().metaData.length;
+
+ // Make sure that we handle number of datapoints changing
+ if (numData < numPoints) {
+ // Remove excess bars for data points that have been removed
+ this.getDataset().metaData.splice(numData, numPoints - numData)
+ } else if (numData > numPoints) {
+ // Add new elements
+ for (var index = numPoints; index < numData; ++index) {
+ this.addElementAndReset(index);
+ }
+ }
+ },
+
+ update: function update(reset) {
- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
+ Chart.scaleService.update(this, this.chart.width, this.chart.height);
//this.chart.scale.setScaleSize();
this.chart.scale.calculateRange();
this.chart.scale.generateTicks();
this.scale = scale;
}
- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
+ Chart.scaleService.update(this, this.chart.width, this.chart.height);
},
- buildOrUpdateControllers: function() {
+ buildOrUpdateControllers: function buildOrUpdateControllers(resetNewControllers) {
+ var types = [];
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
- var type = dataset.type || this.config.type;
+ if (!dataset.type) {
+ dataset.type = this.config.type;
+ }
+ var type = dataset.type;
+ types.push(type);
if (dataset.controller) {
dataset.controller.updateIndex(datasetIndex);
return;
}
dataset.controller = new Chart.controllers[type](this, datasetIndex);
+
+ if (resetNewControllers) {
+ dataset.controller.reset();
+ }
}, this);
+ if (types.length > 1) {
+ for (var i = 1; i < types.length; i++) {
+ if (types[i] != types[i - 1]) {
+ this.isCombo = true;
+ break;
+ }
+ }
+ }
},
resetElements: function resetElements() {
}, this);
},
-
update: function update(animationDuration, lazy) {
- // This will loop through any data and do the appropriate element update for the type
- Chart.scaleService.fitScalesForChart(this, this.chart.width, this.chart.height);
+ Chart.scaleService.update(this, this.chart.width, this.chart.height);
+
+ // Make sure dataset controllers are updated and new controllers are reset
+ this.buildOrUpdateControllers(true);
+
+ // Make sure all dataset controllers have correct meta data counts
+ helpers.each(this.data.datasets, function(dataset, datasetIndex) {
+ dataset.controller.buildOrUpdateElements();
+ }, this);
+
+ // This will loop through any data and do the appropriate element update for the type
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.update();
}, this);
Chart = root.Chart,
helpers = Chart.helpers;
- // The scale service is used to resize charts along with all of their axes. We make this as
- // a service where scales are registered with their respective charts so that changing the
- // scales does not require
- Chart.scaleService = {
- // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
- // use the new chart options to grab the correct scale
- constructors: {},
- // Use a registration function so that we can move to an ES6 map when we no longer need to support
- // old browsers
- // Scale config defaults
- defaults: {},
- registerScaleType: function(type, scaleConstructor, defaults) {
- this.constructors[type] = scaleConstructor;
- this.defaults[type] = defaults;
+ Chart.defaults.scale = {
+ display: true,
+
+ // grid line settings
+ gridLines: {
+ show: true,
+ color: "rgba(0, 0, 0, 0.1)",
+ lineWidth: 1,
+ drawOnChartArea: true,
+ drawTicks: true,
+ zeroLineWidth: 1,
+ zeroLineColor: "rgba(0,0,0,0.25)",
+ offsetGridLines: false,
},
- getScaleConstructor: function(type) {
- return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
+
+ // label settings
+ ticks: {
+ show: true,
+ minRotation: 20,
+ maxRotation: 90,
+ template: "<%=value%>",
+ fontSize: 12,
+ fontStyle: "normal",
+ fontColor: "#666",
+ fontFamily: "Helvetica Neue",
},
- getScaleDefaults: function(type) {
- return this.defaults.hasOwnProperty(type) ? this.defaults[type] : {};
+ };
+
+ Chart.Scale = Chart.Element.extend({
+
+ // These methods are ordered by lifecyle. Utilities then follow.
+ // Any function defined here is inherited by all scale types.
+ // Any function can be extended by the scale type
+
+ beforeUpdate: helpers.noop,
+ update: function(maxWidth, maxHeight, margins) {
+
+ // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
+ this.beforeUpdate();
+
+ // Absorb the master measurements
+ this.maxWidth = maxWidth;
+ this.maxHeight = maxHeight;
+ this.margins = margins;
+
+ // Dimensions
+ this.beforeSetDimensions();
+ this.setDimensions();
+ this.afterSetDimensions();
+ // Ticks
+ this.beforeBuildTicks();
+ this.buildTicks();
+ this.afterBuildTicks();
+ // Tick Rotation
+ this.beforeCalculateTickRotation();
+ this.calculateTickRotation();
+ this.afterCalculateTickRotation();
+ // Fit
+ this.beforeFit();
+ this.fit();
+ this.afterFit();
+ //
+ this.afterUpdate();
+
+ return this.minSize;
+
},
- // The interesting function
- fitScalesForChart: function(chartInstance, width, height) {
- var xPadding = width > 30 ? 5 : 2;
- var yPadding = height > 30 ? 5 : 2;
-
- if (chartInstance) {
- var leftScales = helpers.where(chartInstance.scales, function(scaleInstance) {
- return scaleInstance.options.position == "left";
- });
- var rightScales = helpers.where(chartInstance.scales, function(scaleInstance) {
- return scaleInstance.options.position == "right";
- });
- var topScales = helpers.where(chartInstance.scales, function(scaleInstance) {
- return scaleInstance.options.position == "top";
- });
- var bottomScales = helpers.where(chartInstance.scales, function(scaleInstance) {
- return scaleInstance.options.position == "bottom";
- });
-
- // Essentially we now have any number of scales on each of the 4 sides.
- // Our canvas looks like the following.
- // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
- // B1 is the bottom axis
- // |------------------------------------------------------|
- // | | T1 | |
- // |----|-----|-------------------------------------|-----|
- // | | | | |
- // | L1 | L2 | Chart area | R1 |
- // | | | | |
- // | | | | |
- // |----|-----|-------------------------------------|-----|
- // | | B1 | |
- // | | | |
- // |------------------------------------------------------|
-
- // What we do to find the best sizing, we do the following
- // 1. Determine the minimum size of the chart area.
- // 2. Split the remaining width equally between each vertical axis
- // 3. Split the remaining height equally between each horizontal axis
- // 4. Give each scale the maximum size it can be. The scale will return it's minimum size
- // 5. Adjust the sizes of each axis based on it's minimum reported size.
- // 6. Refit each axis
- // 7. Position each axis in the final location
- // 8. Tell the chart the final location of the chart area
-
- // Step 1
- var chartWidth = width / 2; // min 50%
- var chartHeight = height / 2; // min 50%
-
- chartWidth -= (2 * xPadding);
- chartHeight -= (2 * yPadding);
-
-
- // Step 2
- var verticalScaleWidth = (width - chartWidth) / (leftScales.length + rightScales.length);
-
- // Step 3
- var horizontalScaleHeight = (height - chartHeight) / (topScales.length + bottomScales.length);
-
- // Step 4;
- var minimumScaleSizes = [];
-
- var verticalScaleMinSizeFunction = function(scaleInstance) {
- var minSize = scaleInstance.fit(verticalScaleWidth, chartHeight);
- minimumScaleSizes.push({
- horizontal: false,
- minSize: minSize,
- scale: scaleInstance,
- });
- };
-
- var horizontalScaleMinSizeFunction = function(scaleInstance) {
- var minSize = scaleInstance.fit(chartWidth, horizontalScaleHeight);
- minimumScaleSizes.push({
- horizontal: true,
- minSize: minSize,
- scale: scaleInstance,
- });
- };
-
- // vertical scales
- helpers.each(leftScales, verticalScaleMinSizeFunction);
- helpers.each(rightScales, verticalScaleMinSizeFunction);
-
- // horizontal scales
- helpers.each(topScales, horizontalScaleMinSizeFunction);
- helpers.each(bottomScales, horizontalScaleMinSizeFunction);
-
- // Step 5
- var maxChartHeight = height - (2 * yPadding);
- var maxChartWidth = width - (2 * xPadding);
-
- helpers.each(minimumScaleSizes, function(wrapper) {
- if (wrapper.horizontal) {
- maxChartHeight -= wrapper.minSize.height;
- } else {
- maxChartWidth -= wrapper.minSize.width;
+ afterUpdate: helpers.noop,
+
+ //
+
+ beforeSetDimensions: helpers.noop,
+ setDimensions: function() {
+ // Set the unconstrained dimension before label rotation
+ if (this.isHorizontal()) {
+ this.width = this.maxWidth;
+ } else {
+ this.height = this.maxHeight;
+ }
+ },
+ afterSetDimensions: helpers.noop,
+
+ //
+
+ beforeBuildTicks: helpers.noop,
+ buildTicks: helpers.noop,
+ afterBuildTicks: helpers.noop,
+
+ //
+
+ beforeCalculateTickRotation: helpers.noop,
+ calculateTickRotation: function() {
+ //Get the width of each grid by calculating the difference
+ //between x offsets between 0 and 1.
+ var labelFont = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily);
+ this.ctx.font = labelFont;
+
+ var firstWidth = this.ctx.measureText(this.ticks[0]).width;
+ var lastWidth = this.ctx.measureText(this.ticks[this.ticks.length - 1]).width;
+ var firstRotated;
+ var lastRotated;
+
+ this.paddingRight = lastWidth / 2 + 3;
+ this.paddingLeft = firstWidth / 2 + 3;
+
+ this.labelRotation = 0;
+
+ if (this.options.display && this.isHorizontal()) {
+ var originalLabelWidth = helpers.longestText(this.ctx, labelFont, this.ticks);
+ var cosRotation;
+ var sinRotation;
+ var firstRotatedWidth;
+
+ this.labelWidth = originalLabelWidth;
+
+ // Allow 3 pixels x2 padding either side for label readability
+ // only the index matters for a dataset scale, but we want a consistent interface between scales
+
+ var tickWidth = this.getPixelForTick(1) - this.getPixelForTick(0) - 6;
+
+ //Max label rotation can be set or default to 90 - also act as a loop counter
+ while (this.labelWidth > tickWidth && this.labelRotation <= this.options.ticks.maxRotation) {
+ cosRotation = Math.cos(helpers.toRadians(this.labelRotation));
+ sinRotation = Math.sin(helpers.toRadians(this.labelRotation));
+
+ firstRotated = cosRotation * firstWidth;
+ lastRotated = cosRotation * lastWidth;
+
+ // We're right aligning the text now.
+ if (firstRotated + this.options.ticks.fontSize / 2 > this.yLabelWidth) {
+ this.paddingLeft = firstRotated + this.options.ticks.fontSize / 2;
}
- });
- // At this point, maxChartHeight and maxChartWidth are the size the chart area could
- // be if the axes are drawn at their minimum sizes.
+ this.paddingRight = this.options.ticks.fontSize / 2;
+
+ if (sinRotation * originalLabelWidth > this.maxHeight) {
+ // go back one step
+ this.labelRotation--;
+ break;
+ }
+
+ this.labelRotation++;
+ this.labelWidth = cosRotation * originalLabelWidth;
+
+ }
+ } else {
+ this.labelWidth = 0;
+ this.paddingRight = 0;
+ this.paddingLeft = 0;
+ }
+
+ if (this.margins) {
+ this.paddingLeft -= this.margins.left;
+ this.paddingRight -= this.margins.right;
+
+ this.paddingLeft = Math.max(this.paddingLeft, 0);
+ this.paddingRight = Math.max(this.paddingRight, 0);
+ }
+ },
+ afterCalculateTickRotation: helpers.noop,
+
+ //
+
+ beforeFit: helpers.noop,
+ fit: function() {
+
+ this.minSize = {
+ width: 0,
+ height: 0,
+ };
- // Step 6
- var verticalScaleFitFunction = function(scaleInstance) {
- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
- return wrapper.scale === scaleInstance;
- });
+ // Width
+ if (this.isHorizontal()) {
+ this.minSize.width = this.maxWidth; // fill all the width
+ } else {
+ this.minSize.width = this.options.gridLines.show && this.options.display ? 10 : 0;
+ }
+
+ // height
+ if (this.isHorizontal()) {
+ this.minSize.height = this.options.gridLines.show && this.options.display ? 10 : 0;
+ } else {
+ this.minSize.height = this.maxHeight; // fill all the height
+ }
- if (wrapper) {
- scaleInstance.fit(wrapper.minSize.width, maxChartHeight);
+ this.paddingLeft = 0;
+ this.paddingRight = 0;
+ this.paddingTop = 0;
+ this.paddingBottom = 0;
+
+ if (this.options.ticks.show && this.options.display) {
+ // Don't bother fitting the ticks if we are not showing them
+ var labelFont = helpers.fontString(this.options.ticks.fontSize,
+ this.options.ticks.fontStyle, this.options.ticks.fontFamily);
+
+ if (this.isHorizontal()) {
+ // A horizontal axis is more constrained by the height.
+ var maxLabelHeight = this.maxHeight - this.minSize.height;
+ var labelHeight = 1.5 * this.options.ticks.fontSize;
+ this.minSize.height = Math.min(this.maxHeight, this.minSize.height + labelHeight);
+
+ labelFont = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily);
+ this.ctx.font = labelFont;
+
+ var firstLabelWidth = this.ctx.measureText(this.ticks[0]).width;
+ var lastLabelWidth = this.ctx.measureText(this.ticks[this.ticks.length - 1]).width;
+
+ // Ensure that our ticks are always inside the canvas
+ this.paddingLeft = firstLabelWidth / 2;
+ this.paddingRight = lastLabelWidth / 2;
+ } else {
+ // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
+ var maxLabelWidth = this.maxWidth - this.minSize.width;
+ var largestTextWidth = helpers.longestText(this.ctx, labelFont, this.ticks);
+
+ if (largestTextWidth < maxLabelWidth) {
+ // We don't need all the room
+ this.minSize.width += largestTextWidth;
+ } else {
+ // Expand to max size
+ this.minSize.width = this.maxWidth;
}
- };
-
- var horizontalScaleFitFunction = function(scaleInstance) {
- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
- return wrapper.scale === scaleInstance;
- });
-
- var scaleMargin = {
- left: totalLeftWidth,
- right: totalRightWidth,
- top: 0,
- bottom: 0,
- };
-
- if (wrapper) {
- scaleInstance.fit(maxChartWidth, wrapper.minSize.height, scaleMargin);
+
+ this.paddingTop = this.options.ticks.fontSize / 2;
+ this.paddingBottom = this.options.ticks.fontSize / 2;
+ }
+ }
+
+ if (this.margins) {
+ this.paddingLeft -= this.margins.left;
+ this.paddingTop -= this.margins.top;
+ this.paddingRight -= this.margins.right;
+ this.paddingBottom -= this.margins.bottom;
+
+ this.paddingLeft = Math.max(this.paddingLeft, 0);
+ this.paddingTop = Math.max(this.paddingTop, 0);
+ this.paddingRight = Math.max(this.paddingRight, 0);
+ this.paddingBottom = Math.max(this.paddingBottom, 0);
+ }
+
+ this.width = this.minSize.width;
+ this.height = this.minSize.height;
+
+ },
+ afterFit: helpers.noop,
+
+
+
+
+
+
+ // Shared Methods
+ isHorizontal: function() {
+ return this.options.position == "top" || this.options.position == "bottom";
+ },
+
+ // Used to get data value locations. Value can either be an index or a numerical value
+ getPixelForValue: helpers.noop,
+
+ // Used for tick location, should
+ getPixelForTick: function(index, includeOffset) {
+ if (this.isHorizontal()) {
+ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
+ var tickWidth = innerWidth / Math.max((this.ticks.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
+ var pixel = (tickWidth * index) + this.paddingLeft;
+
+ if (includeOffset) {
+ pixel += tickWidth / 2;
+ }
+ return this.left + Math.round(pixel);
+ } else {
+ var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
+ return this.top + (index * (innerHeight / (this.ticks.length - 1)));
+ }
+ },
+
+ // Utility for getting the pixel location of a percentage of scale
+ getPixelForDecimal: function(decimal, includeOffset) {
+ if (this.isHorizontal()) {
+ var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
+ var valueOffset = (innerWidth * decimal) + this.paddingLeft;
+
+ return this.left + Math.round(valueOffset);
+ } else {
+ return this.top + (decimal * (this.height / this.ticks.length));
+ }
+ },
+
+ // Actualy draw the scale on the canvas
+ // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
+ draw: function(chartArea) {
+ if (this.options.display) {
+
+ var setContextLineSettings;
+ var isRotated;
+ var skipRatio;
++ var scaleLabelX;
++ var scaleLabelY;
+
+ // Make sure we draw text in the correct color
+ this.ctx.fillStyle = this.options.ticks.fontColor;
+
+ if (this.isHorizontal()) {
+ setContextLineSettings = true;
+ var yTickStart = this.options.position == "bottom" ? this.top : this.bottom - 10;
+ var yTickEnd = this.options.position == "bottom" ? this.top + 10 : this.bottom;
+ isRotated = this.labelRotation !== 0;
+ skipRatio = false;
+
+ if ((this.options.ticks.fontSize + 4) * this.ticks.length > (this.width - (this.paddingLeft + this.paddingRight))) {
+ skipRatio = 1 + Math.floor(((this.options.ticks.fontSize + 4) * this.ticks.length) / (this.width - (this.paddingLeft + this.paddingRight)));
}
- };
-
- var totalLeftWidth = xPadding;
- var totalRightWidth = xPadding;
- var totalTopHeight = yPadding;
- var totalBottomHeight = yPadding;
-
- helpers.each(leftScales, verticalScaleFitFunction);
- helpers.each(rightScales, verticalScaleFitFunction);
-
- // Figure out how much margin is on the left and right of the horizontal axes
- helpers.each(leftScales, function(scaleInstance) {
- totalLeftWidth += scaleInstance.width;
- });
-
- helpers.each(rightScales, function(scaleInstance) {
- totalRightWidth += scaleInstance.width;
- });
-
- helpers.each(topScales, horizontalScaleFitFunction);
- helpers.each(bottomScales, horizontalScaleFitFunction);
-
- helpers.each(topScales, function(scaleInstance) {
- totalTopHeight += scaleInstance.height;
- });
- helpers.each(bottomScales, function(scaleInstance) {
- totalBottomHeight += scaleInstance.height;
- });
-
- // Let the left scale know the final margin
- helpers.each(leftScales, function(scaleInstance) {
- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
- return wrapper.scale === scaleInstance;
- });
-
- var scaleMargin = {
- left: 0,
- right: 0,
- top: totalTopHeight,
- bottom: totalBottomHeight
- };
-
- if (wrapper) {
- scaleInstance.fit(wrapper.minSize.width, maxChartHeight, scaleMargin);
+
+ helpers.each(this.ticks, function(label, index) {
+ // Blank ticks
+ if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
+ return;
+ }
+ var xLineValue = this.getPixelForTick(index); // xvalues for grid lines
+ var xLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
+
+ if (this.options.gridLines.show) {
+ if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
+ // Draw the first index specially
+ this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
+ this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
+ setContextLineSettings = true; // reset next time
+ } else if (setContextLineSettings) {
+ this.ctx.lineWidth = this.options.gridLines.lineWidth;
+ this.ctx.strokeStyle = this.options.gridLines.color;
+ setContextLineSettings = false;
+ }
+
+ xLineValue += helpers.aliasPixel(this.ctx.lineWidth);
+
+ // Draw the label area
+ this.ctx.beginPath();
+
+ if (this.options.gridLines.drawTicks) {
+ this.ctx.moveTo(xLineValue, yTickStart);
+ this.ctx.lineTo(xLineValue, yTickEnd);
+ }
+
+ // Draw the chart area
+ if (this.options.gridLines.drawOnChartArea) {
+ this.ctx.moveTo(xLineValue, chartArea.top);
+ this.ctx.lineTo(xLineValue, chartArea.bottom);
+ }
+
+ // Need to stroke in the loop because we are potentially changing line widths & colours
+ this.ctx.stroke();
+ }
+
+ if (this.options.ticks.show) {
+ this.ctx.save();
+ this.ctx.translate(xLabelValue, (isRotated) ? this.top + 12 : this.top + 8);
+ this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
+ this.ctx.font = this.font;
+ this.ctx.textAlign = (isRotated) ? "right" : "center";
+ this.ctx.textBaseline = (isRotated) ? "middle" : "top";
+ this.ctx.fillText(label, 0, 0);
+ this.ctx.restore();
+ }
+ }, this);
++
++ if (this.options.scaleLabel.show) {
++ // Draw the scale label
++ this.ctx.textAlign = "center";
++ this.ctx.textBaseline = 'middle';
++ this.ctx.font = helpers.fontString(this.options.scaleLabel.fontSize, this.options.scaleLabel.fontStyle, this.options.scaleLabel.fontFamily);
++
++ scaleLabelX = this.left + ((this.right - this.left) / 2); // midpoint of the width
++ scaleLabelY = this.options.position == 'bottom' ? this.bottom - (this.options.scaleLabel.fontSize / 2) : this.top + (this.options.scaleLabel.fontSize / 2);
++
++ this.ctx.fillText(this.options.scaleLabel.labelString, scaleLabelX, scaleLabelY);
+ }
- });
-
- helpers.each(rightScales, function(scaleInstance) {
- var wrapper = helpers.findNextWhere(minimumScaleSizes, function(wrapper) {
- return wrapper.scale === scaleInstance;
- });
-
- var scaleMargin = {
- left: 0,
- right: 0,
- top: totalTopHeight,
- bottom: totalBottomHeight
- };
-
- if (wrapper) {
- scaleInstance.fit(wrapper.minSize.width, maxChartHeight, scaleMargin);
++
+ } else {
+ setContextLineSettings = true;
+ var xTickStart = this.options.position == "left" ? this.right : this.left - 10;
+ var xTickEnd = this.options.position == "left" ? this.right + 10 : this.left;
+ isRotated = this.labelRotation !== 0;
+ //skipRatio = false;
+
+ // if ((this.options.ticks.fontSize + 4) * this.ticks.length > (this.width - (this.paddingLeft + this.paddingRight))) {
+ // skipRatio = 1 + Math.floor(((this.options.ticks.fontSize + 4) * this.ticks.length) / (this.width - (this.paddingLeft + this.paddingRight)));
+ // }
+
+ helpers.each(this.ticks, function(label, index) {
+ // Blank ticks
+ // if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
+ // return;
+ // }
+ var yLineValue = this.getPixelForTick(index); // xvalues for grid lines
+ var yLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
+ var xLabelValue = this.left + (this.width / 2);
+
+ if (this.options.gridLines.show) {
+ if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
+ // Draw the first index specially
+ this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
+ this.ctx.strokeStyle = this.options.gridLines.zeroLineColor;
+ setContextLineSettings = true; // reset next time
+ } else if (setContextLineSettings) {
+ this.ctx.lineWidth = this.options.gridLines.lineWidth;
+ this.ctx.strokeStyle = this.options.gridLines.color;
+ setContextLineSettings = false;
+ }
+
+ yLineValue += helpers.aliasPixel(this.ctx.lineWidth);
+
+ // Draw the label area
+ this.ctx.beginPath();
+
+ if (this.options.gridLines.drawTicks) {
+ this.ctx.moveTo(xTickStart, yLineValue);
+ this.ctx.lineTo(xTickEnd, yLineValue);
+ }
+
+ // Draw the chart area
+ if (this.options.gridLines.drawOnChartArea) {
+ this.ctx.moveTo(chartArea.left, yLineValue);
+ this.ctx.lineTo(chartArea.right, yLineValue);
+ }
+
+ // Need to stroke in the loop because we are potentially changing line widths & colours
+ this.ctx.stroke();
+ }
+
+ if (this.options.ticks.show) {
+ this.ctx.save();
+ this.ctx.translate(xLabelValue, yLabelValue);
+ this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
+ this.ctx.font = this.font;
+ this.ctx.textAlign = 'center';
+ this.ctx.textBaseline = "middle";
+ this.ctx.fillText(label, 0, 0);
+ this.ctx.restore();
+ }
+ }, this);
++
++ if (this.options.scaleLabel.show) {
++ // Draw the scale label
++ scaleLabelX = this.options.position == 'left' ? this.left + (this.options.scaleLabel.fontSize / 2) : this.right - (this.options.scaleLabel.fontSize / 2);
++ scaleLabelY = this.top + ((this.bottom - this.top) / 2);
++ var rotation = this.options.position == 'left' ? -0.5 * Math.PI : 0.5 * Math.PI;
++
++ this.ctx.save();
++ this.ctx.translate(scaleLabelX, scaleLabelY);
++ this.ctx.rotate(rotation);
++ this.ctx.textAlign = "center";
++ this.ctx.font = helpers.fontString(this.options.scaleLabel.fontSize, this.options.scaleLabel.fontStyle, this.options.scaleLabel.fontFamily);
++ this.ctx.textBaseline = 'middle';
++ this.ctx.fillText(this.options.scaleLabel.labelString, 0, 0);
++ this.ctx.restore();
+ }
- });
-
- // Recalculate because the size of each scale might have changed slightly due to the margins (label rotation for instance)
- totalLeftWidth = xPadding;
- totalRightWidth = xPadding;
- totalTopHeight = yPadding;
- totalBottomHeight = yPadding;
-
- helpers.each(leftScales, function(scaleInstance) {
- totalLeftWidth += scaleInstance.width;
- });
-
- helpers.each(rightScales, function(scaleInstance) {
- totalRightWidth += scaleInstance.width;
- });
-
- helpers.each(topScales, function(scaleInstance) {
- totalTopHeight += scaleInstance.height;
- });
- helpers.each(bottomScales, function(scaleInstance) {
- totalBottomHeight += scaleInstance.height;
- });
-
- // Figure out if our chart area changed. This would occur if the dataset scale label rotation
- // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
- // without calling `fit` again
- var newMaxChartHeight = height - totalTopHeight - totalBottomHeight;
- var newMaxChartWidth = width - totalLeftWidth - totalRightWidth;
-
- if (newMaxChartWidth !== maxChartWidth || newMaxChartHeight !== maxChartHeight) {
- helpers.each(leftScales, function(scale) {
- scale.height = newMaxChartHeight;
- });
-
- helpers.each(rightScales, function(scale) {
- scale.height = newMaxChartHeight;
- });
-
- helpers.each(topScales, function(scale) {
- scale.width = newMaxChartWidth;
- });
-
- helpers.each(bottomScales, function(scale) {
- scale.width = newMaxChartWidth;
- });
-
- maxChartHeight = newMaxChartHeight;
- maxChartWidth = newMaxChartWidth;
}
-
- // Step 7
- // Position the scales
- var left = xPadding;
- var top = yPadding;
- var right = 0;
- var bottom = 0;
-
- var verticalScalePlacer = function(scaleInstance) {
- scaleInstance.left = left;
- scaleInstance.right = left + scaleInstance.width;
- scaleInstance.top = totalTopHeight;
- scaleInstance.bottom = totalTopHeight + maxChartHeight;
-
- // Move to next point
- left = scaleInstance.right;
- };
-
- var horizontalScalePlacer = function(scaleInstance) {
- scaleInstance.left = totalLeftWidth;
- scaleInstance.right = totalLeftWidth + maxChartWidth;
- scaleInstance.top = top;
- scaleInstance.bottom = top + scaleInstance.height;
-
- // Move to next point
- top = scaleInstance.bottom;
- };
-
- helpers.each(leftScales, verticalScalePlacer);
- helpers.each(topScales, horizontalScalePlacer);
-
- // Account for chart width and height
- left += maxChartWidth;
- top += maxChartHeight;
-
- helpers.each(rightScales, verticalScalePlacer);
- helpers.each(bottomScales, horizontalScalePlacer);
-
- // Step 8
- chartInstance.chartArea = {
- left: totalLeftWidth,
- top: totalTopHeight,
- right: totalLeftWidth + maxChartWidth,
- bottom: totalTopHeight + maxChartHeight,
- };
}
}
- };
+ });
+
}).call(this);