diff --git a/customization.html b/customization.html index 1e129b8..898935b 100644 --- a/customization.html +++ b/customization.html @@ -29,8 +29,8 @@ - - + + @@ -97,6 +97,22 @@

Column Metadata

bool - Determines whether or not the user can sort this column (defaults to true, so specify false to disable sort)
+
+
customCompareFn
+
function
+
with 1 argument specifies a function that defines the sort order of the column data. Passed to _.sortBy method, invoked with 1 argument.
+
with 2 arguments specifies a function that defines the sort order of the column data. Passed to standard JS sort method, invoked ith 2 arguments. Useful, for example, wih naturalSort(a, b) from javascript-natural-sort
+
+ +
+
multiSort
+
object - allows to specify multiple sorting when sorting current column. Specified columns will be sorted after current
+ multiSort: { + columns: ['name'], + orders: ['asc'] + } +
+
order
int - The order that this column should appear in Griddle.
@@ -112,6 +128,11 @@

Column Metadata

string - The css class name to apply to this column.
+
+
titleStyles
+
object - collection of styles applied to column header
+
+
displayName
string - The display name for the column. This is used when the name in the column heading and settings should be different from the data passed in to the Griddle component.
@@ -416,6 +437,96 @@
Example:
+
+ +

Custom sorting

+
Example:
+

In this example we are going to sort Employee Name column by last name, followed by first name:

+
var exampleMetadata = [
+  {
+  "columnName": "id",
+  "order": 1,
+  "locked": false,
+  "visible": false,
+  "displayName": "ID"
+  },
+  {
+  "columnName": "name",
+  "order": 9,
+  "locked": false,
+  "visible": true,
+  "displayName": "Employee Name",
+  "compare": function(name) {
+      var a = name.split(" ");
+      return a[1] + " " + a[0];
+    }
+  },
+  ...
+]
+

Then, like in first example, but specify initialSort column:

+
React.render(
+  <Griddle results={fakeData} columnMetadata={exampleMetadata} showFilter={true}
+    showSettings={true} columns={["name", "city", "state", "country"]} initialSort="name"/>,
+    document.getElementById('griddle-metadata')
+
+ + +

Row Metadata

@@ -601,8 +712,7 @@

Custom Filtering and Filter Compo

Griddle supports custom filtering and custom filter components. In order to use a custom filter function set the property useCustomFilterer to true and pass in a function to the customFilterer property. To use a custom filter component set useCustomFilterComponent to true and pass a component to customFilterComponent.

Example:

This example shows how to make a custom filter component with a custom filter function that does a case-insensitive search through the items. The component must call this.props.changeFilter(val) when the filter should be updated. In the example below we pass a string but any variable type can be used as long as the filter function is expecting it, for example an advanced query could be passed in using an object. The filter function signature takes the items to be filtered and the query to filter them by.

-
  var _ = require('underscore'),
-      squish = require('object-squish');
+
      squish = require('object-squish');
 
   var customFilterFunction = function(items, query) {
     return _.filter(items, (item) => {
@@ -658,6 +768,11 @@ 

Custom Paging Component

object - The custom pagination component. default: {}
+
+
customPagerComponentOptions
+
object - Any options to be passed to the custom pagination component. default: {}
+
+
Example
var OtherPager = React.createClass({
     getDefaultProps: function(){
diff --git a/externalData.html b/externalData.html
index b531774..0fb1dec 100644
--- a/externalData.html
+++ b/externalData.html
@@ -29,8 +29,8 @@
 
 	
-  
-  
+  
+  
 	
 	
 	
diff --git a/index.html b/index.html
index 7cb2950..e1988f2 100644
--- a/index.html
+++ b/index.html
@@ -238,8 +238,8 @@ 

From Source

- - + + diff --git a/infiniteScroll.html b/infiniteScroll.html index 7191e65..e7f9c17 100644 --- a/infiniteScroll.html +++ b/infiniteScroll.html @@ -29,8 +29,8 @@ - - + + diff --git a/properties.html b/properties.html index b74cdb3..f6f8de4 100644 --- a/properties.html +++ b/properties.html @@ -29,8 +29,8 @@ - - + + @@ -526,6 +526,30 @@

Properties

"description": "A function that should be called when a row has been clicked. The 'gridRow' and event will be passed in as arguments.", "type": "function", "default": "null" + }, + { + "property": "onRowMouseEnter", + "description": "A function that should be called when a mouse entered a row. The 'gridRow' and event will be passed in as arguments.", + "type": "function", + "default": "null" + }, + { + "property": "onRowMouseLeave", + "description": "A function that should be called when a mouse left a row. The 'gridRow' and event will be passed in as arguments.", + "type": "function", + "default": "null" + }, + { + "property": "onRowWillMount", + "description": "A function that should be called before a row was mounted. The 'gridRow' will be passed in as argument.", + "type": "function", + "default": "null" + }, + { + "property": "onRowWillUnmount", + "description": "A function that should be called before a row was unmounted. The 'gridRow' will be passed in as argument.", + "type": "function", + "default": "null" } ]; var DefinitionItem = React.createClass({ diff --git a/quickstart.html b/quickstart.html index 10c2384..31c2ad9 100644 --- a/quickstart.html +++ b/quickstart.html @@ -29,8 +29,8 @@ - - + + diff --git a/scripts/ChartistGraph.js b/scripts/ChartistGraph.js index fe484df..c4ad6e3 100644 --- a/scripts/ChartistGraph.js +++ b/scripts/ChartistGraph.js @@ -63,2292 +63,1587 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var React = __webpack_require__(2); - var Chartist = __webpack_require__(3); - - var ChartistGraph = React.createClass({ - - displayName: 'ChartistGraph', - - propTypes: { - type: React.PropTypes.string.isRequired, - data: React.PropTypes.object.isRequired, - options: React.PropTypes.object, - responsiveOptions: React.PropTypes.array - }, - - componentWillReceiveProps: function componentWillReceiveProps(newProps) { - return this.updateChart(newProps); - }, - - updateChart: function updateChart(config) { - var type = config.type; - var data = config.data; - var options = config.options || {}; - var responsiveOptions = config.responsiveOptions || []; - return new Chartist[type](this.getDOMNode(), data, options, responsiveOptions); - }, - - componentDidMount: function componentDidMount() { - return this.updateChart(this.props); - }, - - render: function render() { - return React.DOM.div({ className: 'ct-chart' }); - } - - }); - - module.exports = ChartistGraph; - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - (function (root, factory) { - if (true) { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define([], factory); - } else { - root['Chartist'] = factory(); - } - })(undefined, function () { - - /* Chartist.js 0.3.1 - * Copyright © 2014 Gion Kunz - * Free to use under the WTFPL license. - * http://www.wtfpl.net/ - */ - /** - * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. - * - * @module Chartist.Core - */ - var Chartist = {}; - Chartist.version = '0.3.1'; - - (function (window, document, Chartist) { - 'use strict'; - - /** - * Helps to simplify functional style code - * - * @memberof Chartist.Core - * @param {*} n This exact value will be returned by the noop function - * @return {*} The same value that was provided to the n parameter - */ - Chartist.noop = function (n) { - return n; - }; - - /** - * Generates a-z from a number 0 to 26 - * - * @memberof Chartist.Core - * @param {Number} n A number from 0 to 26 that will result in a letter a-z - * @return {String} A character from a-z based on the input number n - */ - Chartist.alphaNumerate = function (n) { - // Limit to a-z - return String.fromCharCode(97 + n % 26); - }; - - // TODO: Make it possible to call extend with var args - /** - * Simple recursive object extend - * - * @memberof Chartist.Core - * @param {Object} target Target object where the source will be merged into - * @param {Object} source This object will be merged into target and then target is returned - * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source - */ - Chartist.extend = function (target, source) { - target = target || {}; - for (var prop in source) { - if (typeof source[prop] === 'object') { - target[prop] = Chartist.extend(target[prop], source[prop]); - } else { - target[prop] = source[prop]; - } - } - return target; - }; - - /** - * Converts a string to a number while removing the unit px if present. If a number is passed then this will be returned unmodified. - * - * @param {String|Number} length - * @returns {Number} Returns the pixel as number or NaN if the passed length could not be converted to pixel - */ - Chartist.getPixelLength = function (length) { - if (typeof length === 'string') { - length = length.replace(/px/i, ''); - } - - return +length; - }; - - /** - * This is a wrapper around document.querySelector that will return the query if it's already of type Node - * - * @memberof Chartist.Core - * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly - * @return {Node} - */ - Chartist.querySelector = function (query) { - return query instanceof Node ? query : document.querySelector(query); - }; - - /** - * Create or reinitialize the SVG element for the chart - * - * @memberof Chartist.Core - * @param {Node} container The containing DOM Node object that will be used to plant the SVG element - * @param {String} width Set the width of the SVG element. Default is 100% - * @param {String} height Set the height of the SVG element. Default is 100% - * @param {String} className Specify a class to be added to the SVG element - * @return {Object} The created/reinitialized SVG element - */ - Chartist.createSvg = function (container, width, height, className) { - var svg; - - width = width || '100%'; - height = height || '100%'; - - // If already contains our svg object we clear it, set width / height and return - if (container.chartistSvg !== undefined) { - svg = container.chartistSvg.attr({ - width: width, - height: height - }).removeAllClasses().addClass(className).attr({ - style: 'width: ' + width + '; height: ' + height + ';' - }); - // Clear the draw if its already used before so we start fresh - svg.empty(); - } else { - // Create svg object with width and height or use 100% as default - svg = Chartist.Svg('svg').attr({ - width: width, - height: height - }).addClass(className).attr({ - style: 'width: ' + width + '; height: ' + height + ';' - }); - - // Add the DOM node to our container - container.appendChild(svg._node); - container.chartistSvg = svg; - } - - return svg; - }; - - /** - * Convert data series into plain array - * - * @memberof Chartist.Core - * @param {Object} data The series object that contains the data to be visualized in the chart - * @return {Array} A plain array that contains the data to be visualized in the chart - */ - Chartist.getDataArray = function (data) { - var array = []; - - for (var i = 0; i < data.series.length; i++) { - // If the series array contains an object with a data property we will use the property - // otherwise the value directly (array or number) - array[i] = typeof data.series[i] === 'object' && data.series[i].data !== undefined ? data.series[i].data : data.series[i]; - - // Convert values to number - for (var j = 0; j < array[i].length; j++) { - array[i][j] = +array[i][j]; - } - } - - return array; - }; - - /** - * Adds missing values at the end of the array. This array contains the data, that will be visualized in the chart - * - * @memberof Chartist.Core - * @param {Array} dataArray The array that contains the data to be visualized in the chart. The array in this parameter will be modified by function. - * @param {Number} length The length of the x-axis data array. - * @return {Array} The array that got updated with missing values. - */ - Chartist.normalizeDataArray = function (dataArray, length) { - for (var i = 0; i < dataArray.length; i++) { - if (dataArray[i].length === length) { - continue; - } - - for (var j = dataArray[i].length; j < length; j++) { - dataArray[i][j] = 0; - } - } - - return dataArray; - }; - - /** - * Calculate the order of magnitude for the chart scale - * - * @memberof Chartist.Core - * @param {Number} value The value Range of the chart - * @return {Number} The order of magnitude - */ - Chartist.orderOfMagnitude = function (value) { - return Math.floor(Math.log(Math.abs(value)) / Math.LN10); - }; - - /** - * Project a data length into screen coordinates (pixels) - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Number} length Single data value from a series array - * @param {Object} bounds All the values to set the bounds of the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @return {Number} The projected data length in pixels - */ - Chartist.projectLength = function (svg, length, bounds, options) { - var availableHeight = Chartist.getAvailableHeight(svg, options); - return length / bounds.range * availableHeight; - }; - - /** - * Get the height of the area in the chart for the data series - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @return {Number} The height of the area in the chart for the data series - */ - Chartist.getAvailableHeight = function (svg, options) { - return Math.max((Chartist.getPixelLength(options.height) || svg.height()) - options.chartPadding * 2 - options.axisX.offset, 0); - }; - - /** - * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. - * - * @memberof Chartist.Core - * @param {Array} dataArray The array that contains the data to be visualized in the chart - * @return {Array} The array that contains the highest and lowest value that will be visualized on the chart. - */ - Chartist.getHighLow = function (dataArray) { - var i, - j, - highLow = { - high: -Number.MAX_VALUE, - low: Number.MAX_VALUE - }; - - for (i = 0; i < dataArray.length; i++) { - for (j = 0; j < dataArray[i].length; j++) { - if (dataArray[i][j] > highLow.high) { - highLow.high = dataArray[i][j]; - } - - if (dataArray[i][j] < highLow.low) { - highLow.low = dataArray[i][j]; - } - } - } - - return highLow; - }; - - // Find the highest and lowest values in a two dimensional array and calculate scale based on order of magnitude - /** - * Calculate and retrieve all the bounds for the chart and return them in one array - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Array} normalizedData The array that got updated with missing values. - * @param {Object} options The Object that contains all the optional values for the chart - * @param {Number} referenceValue The reference value for the chart. - * @return {Object} All the values to set the bounds of the chart - */ - Chartist.getBounds = function (svg, normalizedData, options, referenceValue) { - var i, - newMin, - newMax, - bounds = Chartist.getHighLow(normalizedData); - - // Overrides of high / low from settings - bounds.high = +options.high || (options.high === 0 ? 0 : bounds.high); - bounds.low = +options.low || (options.low === 0 ? 0 : bounds.low); - - // If high and low are the same because of misconfiguration or flat data (only the same value) we need - // to set the high or low to 0 depending on the polarity - if (bounds.high === bounds.low) { - // If both values are 0 we set high to 1 - if (bounds.low === 0) { - bounds.high = 1; - } else if (bounds.low < 0) { - // If we have the same negative value for the bounds we set bounds.high to 0 - bounds.high = 0; - } else { - // If we have the same positive value for the bounds we set bounds.low to 0 - bounds.low = 0; - } - } - - // Overrides of high / low based on reference value, it will make sure that the invisible reference value is - // used to generate the chart. This is useful when the chart always needs to contain the position of the - // invisible reference value in the view i.e. for bipolar scales. - if (referenceValue || referenceValue === 0) { - bounds.high = Math.max(referenceValue, bounds.high); - bounds.low = Math.min(referenceValue, bounds.low); - } - - bounds.valueRange = bounds.high - bounds.low; - bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange); - bounds.min = Math.floor(bounds.low / Math.pow(10, bounds.oom)) * Math.pow(10, bounds.oom); - bounds.max = Math.ceil(bounds.high / Math.pow(10, bounds.oom)) * Math.pow(10, bounds.oom); - bounds.range = bounds.max - bounds.min; - bounds.step = Math.pow(10, bounds.oom); - bounds.numberOfSteps = Math.round(bounds.range / bounds.step); - - // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace - // If we are already below the scaleMinSpace value we will scale up - var length = Chartist.projectLength(svg, bounds.step, bounds, options), - scaleUp = length < options.axisY.scaleMinSpace; - - while (true) { - if (scaleUp && Chartist.projectLength(svg, bounds.step, bounds, options) <= options.axisY.scaleMinSpace) { - bounds.step *= 2; - } else if (!scaleUp && Chartist.projectLength(svg, bounds.step / 2, bounds, options) >= options.axisY.scaleMinSpace) { - bounds.step /= 2; - } else { - break; - } - } - - // Narrow min and max based on new step - newMin = bounds.min; - newMax = bounds.max; - for (i = bounds.min; i <= bounds.max; i += bounds.step) { - if (i + bounds.step < bounds.low) { - newMin += bounds.step; - } - - if (i - bounds.step > bounds.high) { - newMax -= bounds.step; - } - } - bounds.min = newMin; - bounds.max = newMax; - bounds.range = bounds.max - bounds.min; - - bounds.values = []; - for (i = bounds.min; i <= bounds.max; i += bounds.step) { - bounds.values.push(i); - } - - return bounds; - }; - - /** - * Calculate cartesian coordinates of polar coordinates - * - * @memberof Chartist.Core - * @param {Number} centerX X-axis coordinates of center point of circle segment - * @param {Number} centerY X-axis coordinates of center point of circle segment - * @param {Number} radius Radius of circle segment - * @param {Number} angleInDegrees Angle of circle segment in degrees - * @return {Number} Coordinates of point on circumference - */ - Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) { - var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; - - return { - x: centerX + radius * Math.cos(angleInRadians), - y: centerY + radius * Math.sin(angleInRadians) - }; - }; - - /** - * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements - */ - Chartist.createChartRect = function (svg, options) { - var yOffset = options.axisY ? options.axisY.offset : 0, - xOffset = options.axisX ? options.axisX.offset : 0; - - return { - x1: options.chartPadding + yOffset, - y1: Math.max((Chartist.getPixelLength(options.height) || svg.height()) - options.chartPadding - xOffset, options.chartPadding), - x2: Math.max((Chartist.getPixelLength(options.width) || svg.width()) - options.chartPadding, options.chartPadding + yOffset), - y2: options.chartPadding, - width: function width() { - return this.x2 - this.x1; - }, - height: function height() { - return this.y1 - this.y2; - } - }; - }; - - /** - * Creates a label with text and based on support of SVG1.1 extensibility will use a foreignObject with a SPAN element or a fallback to a regular SVG text element. - * - * @param {Object} parent The SVG element where the label should be created as a child - * @param {String} text The label text - * @param {Object} attributes An object with all attributes that should be set on the label element - * @param {String} className The class names that should be set for this element - * @param {Boolean} supportsForeignObject If this is true then a foreignObject will be used instead of a text element - * @returns {Object} The newly created SVG element - */ - Chartist.createLabel = function (parent, text, attributes, className, supportsForeignObject) { - if (supportsForeignObject) { - var content = '' + text + ''; - return parent.foreignObject(content, attributes); - } else { - return parent.elem('text', attributes, className).text(text); - } - }; - - /** - * Generate grid lines and labels for the x-axis into grid and labels group SVG elements - * - * @memberof Chartist.Core - * @param {Object} chartRect The rectangle that sets the bounds for the chart in the svg element - * @param {Object} data The Object that contains the data to be visualized in the chart - * @param {Object} grid Chartist.Svg wrapper object to be filled with the grid lines of the chart - * @param {Object} labels Chartist.Svg wrapper object to be filled with the lables of the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @param {Object} eventEmitter The passed event emitter will be used to emit draw events for labels and gridlines - * @param {Boolean} supportsForeignObject If this is true then a foreignObject will be used instead of a text element - */ - Chartist.createXAxis = function (chartRect, data, grid, labels, options, eventEmitter, supportsForeignObject) { - // Create X-Axis - data.labels.forEach(function (value, index) { - var interpolatedValue = options.axisX.labelInterpolationFnc(value, index), - width = chartRect.width() / data.labels.length, - height = options.axisX.offset, - pos = chartRect.x1 + width * index; - - // If interpolated value returns falsey (except 0) we don't draw the grid line - if (!interpolatedValue && interpolatedValue !== 0) { - return; - } - - if (options.axisX.showGrid) { - var gridElement = grid.elem('line', { - x1: pos, - y1: chartRect.y1, - x2: pos, - y2: chartRect.y2 - }, [options.classNames.grid, options.classNames.horizontal].join(' ')); - - // Event for grid draw - eventEmitter.emit('draw', { - type: 'grid', - axis: 'x', - index: index, - group: grid, - element: gridElement, - x1: pos, - y1: chartRect.y1, - x2: pos, - y2: chartRect.y2 - }); - } - - if (options.axisX.showLabel) { - var labelPosition = { - x: pos + options.axisX.labelOffset.x, - y: chartRect.y1 + options.axisX.labelOffset.y + (supportsForeignObject ? 5 : 20) - }; - - var labelElement = Chartist.createLabel(labels, '' + interpolatedValue, { - x: labelPosition.x, - y: labelPosition.y, - width: width, - height: height, - style: 'overflow: visible;' - }, [options.classNames.label, options.classNames.horizontal].join(' '), supportsForeignObject); - - eventEmitter.emit('draw', Object.defineProperties({ - type: 'label', - axis: 'x', - index: index, - group: labels, - element: labelElement, - text: '' + interpolatedValue, - x: labelPosition.x, - y: labelPosition.y, - width: width, - height: height - }, { - space: { // TODO: Remove in next major release - - get: function get() { - window.console.warn('EventEmitter: space is deprecated, use width or height instead.'); - return this.width; - }, - configurable: true, - enumerable: true - } - })); - } - }); - }; - - /** - * Generate grid lines and labels for the y-axis into grid and labels group SVG elements - * - * @memberof Chartist.Core - * @param {Object} chartRect The rectangle that sets the bounds for the chart in the svg element - * @param {Object} bounds All the values to set the bounds of the chart - * @param {Object} grid Chartist.Svg wrapper object to be filled with the grid lines of the chart - * @param {Object} labels Chartist.Svg wrapper object to be filled with the lables of the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @param {Object} eventEmitter The passed event emitter will be used to emit draw events for labels and gridlines - * @param {Boolean} supportsForeignObject If this is true then a foreignObject will be used instead of a text element - */ - Chartist.createYAxis = function (chartRect, bounds, grid, labels, options, eventEmitter, supportsForeignObject) { - // Create Y-Axis - bounds.values.forEach(function (value, index) { - var interpolatedValue = options.axisY.labelInterpolationFnc(value, index), - width = options.axisY.offset, - height = chartRect.height() / bounds.values.length, - pos = chartRect.y1 - height * index; - - // If interpolated value returns falsey (except 0) we don't draw the grid line - if (!interpolatedValue && interpolatedValue !== 0) { - return; - } - - if (options.axisY.showGrid) { - var gridElement = grid.elem('line', { - x1: chartRect.x1, - y1: pos, - x2: chartRect.x2, - y2: pos - }, [options.classNames.grid, options.classNames.vertical].join(' ')); - - // Event for grid draw - eventEmitter.emit('draw', { - type: 'grid', - axis: 'y', - index: index, - group: grid, - element: gridElement, - x1: chartRect.x1, - y1: pos, - x2: chartRect.x2, - y2: pos - }); - } - - if (options.axisY.showLabel) { - var labelPosition = { - x: options.chartPadding + options.axisY.labelOffset.x + (supportsForeignObject ? -10 : 0), - y: pos + options.axisY.labelOffset.y + (supportsForeignObject ? -15 : 0) - }; - - var labelElement = Chartist.createLabel(labels, '' + interpolatedValue, { - x: labelPosition.x, - y: labelPosition.y, - width: width, - height: height, - style: 'overflow: visible;' - }, [options.classNames.label, options.classNames.vertical].join(' '), supportsForeignObject); - - eventEmitter.emit('draw', Object.defineProperties({ - type: 'label', - axis: 'y', - index: index, - group: labels, - element: labelElement, - text: '' + interpolatedValue, - x: labelPosition.x, - y: labelPosition.y, - width: width, - height: height - }, { - space: { // TODO: Remove in next major release - - get: function get() { - window.console.warn('EventEmitter: space is deprecated, use width or height instead.'); - return this.height; - }, - configurable: true, - enumerable: true - } - })); - } - }); - }; - - /** - * Determine the current point on the svg element to draw the data series - * - * @memberof Chartist.Core - * @param {Object} chartRect The rectangle that sets the bounds for the chart in the svg element - * @param {Object} bounds All the values to set the bounds of the chart - * @param {Array} data The array that contains the data to be visualized in the chart - * @param {Number} index The index of the current project point - * @return {Object} The coordinates object of the current project point containing an x and y number property - */ - Chartist.projectPoint = function (chartRect, bounds, data, index) { - return { - x: chartRect.x1 + chartRect.width() / data.length * index, - y: chartRect.y1 - chartRect.height() * (data[index] - bounds.min) / (bounds.range + bounds.step) - }; - }; - - // TODO: With multiple media queries the handleMediaChange function is triggered too many times, only need one - /** - * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches - * - * @memberof Chartist.Core - * @param {Object} defaultOptions Default options from Chartist - * @param {Object} options Options set by user - * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart - * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events - * @return {Object} The consolidated options object from the defaults, base and matching responsive options - */ - Chartist.optionsProvider = function (defaultOptions, options, responsiveOptions, eventEmitter) { - var baseOptions = Chartist.extend(Chartist.extend({}, defaultOptions), options), - currentOptions, - mediaQueryListeners = [], - i; - - function updateCurrentOptions() { - var previousOptions = currentOptions; - currentOptions = Chartist.extend({}, baseOptions); - - if (responsiveOptions) { - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - if (mql.matches) { - currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]); - } - } - } - - if (eventEmitter) { - eventEmitter.emit('optionsChanged', { - previousOptions: previousOptions, - currentOptions: currentOptions - }); - } - } - - function removeMediaQueryListeners() { - mediaQueryListeners.forEach(function (mql) { - mql.removeListener(updateCurrentOptions); - }); - } - - if (!window.matchMedia) { - throw 'window.matchMedia not found! Make sure you\'re using a polyfill.'; - } else if (responsiveOptions) { - - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - mql.addListener(updateCurrentOptions); - mediaQueryListeners.push(mql); - } - } - // Execute initially so we get the correct options - updateCurrentOptions(); - - return Object.defineProperties({ - removeMediaQueryListeners: removeMediaQueryListeners - }, { - currentOptions: { - get: function get() { - return Chartist.extend({}, currentOptions); - }, - configurable: true, - enumerable: true - } - }); - }; - - //http://schepers.cc/getting-to-the-point - Chartist.catmullRom2bezier = function (crp, z) { - var d = []; - for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) { - var p = [{ x: +crp[i - 2], y: +crp[i - 1] }, { x: +crp[i], y: +crp[i + 1] }, { x: +crp[i + 2], y: +crp[i + 3] }, { x: +crp[i + 4], y: +crp[i + 5] }]; - if (z) { - if (!i) { - p[0] = { x: +crp[iLen - 2], y: +crp[iLen - 1] }; - } else if (iLen - 4 === i) { - p[3] = { x: +crp[0], y: +crp[1] }; - } else if (iLen - 2 === i) { - p[2] = { x: +crp[0], y: +crp[1] }; - p[3] = { x: +crp[2], y: +crp[3] }; - } - } else { - if (iLen - 4 === i) { - p[3] = p[2]; - } else if (!i) { - p[0] = { x: +crp[i], y: +crp[i + 1] }; - } - } - d.push([(-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6, p[2].x, p[2].y]); - } - - return d; - }; - })(window, document, Chartist);; /** - * A very basic event module that helps to generate and catch events. - * - * @module Chartist.Event - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - Chartist.EventEmitter = function () { - var handlers = []; - - /** - * Add an event handler for a specific event - * - * @memberof Chartist.Event - * @param {String} event The event name - * @param {Function} handler A event handler function - */ - function addEventHandler(event, handler) { - handlers[event] = handlers[event] || []; - handlers[event].push(handler); - } - - /** - * Remove an event handler of a specific event name or remove all event handlers for a specific event. - * - * @memberof Chartist.Event - * @param {String} event The event name where a specific or all handlers should be removed - * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. - */ - function removeEventHandler(event, handler) { - // Only do something if there are event handlers with this name existing - if (handlers[event]) { - // If handler is set we will look for a specific handler and only remove this - if (handler) { - handlers[event].splice(handlers[event].indexOf(handler), 1); - if (handlers[event].length === 0) { - delete handlers[event]; - } - } else { - // If no handler is specified we remove all handlers for this event - delete handlers[event]; - } - } - } - - /** - * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. - * - * @memberof Chartist.Event - * @param {String} event The event name that should be triggered - * @param {*} data Arbitrary data that will be passed to the event handler callback functions - */ - function emit(event, data) { - // Only do something if there are event handlers with this name existing - if (handlers[event]) { - handlers[event].forEach(function (handler) { - handler(data); - }); - } - } - - return { - addEventHandler: addEventHandler, - removeEventHandler: removeEventHandler, - emit: emit - }; - }; - })(window, document, Chartist);; /** - * This module provides some basic prototype inheritance utilities. - * - * @module Chartist.Class - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - function listToArray(list) { - var arr = []; - if (list.length) { - for (var i = 0; i < list.length; i++) { - arr.push(list[i]); - } - } - return arr; - } - - /** - * Method to extend from current prototype. - * - * @memberof Chartist.Class - * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. - * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. - * @returns {Function} Constructor function of the new class - * - * @example - * var Fruit = Class.extend({ - * color: undefined, - * sugar: undefined, - * - * constructor: function(color, sugar) { - * this.color = color; - * this.sugar = sugar; - * }, - * - * eat: function() { - * this.sugar = 0; - * return this; - * } - * }); - * - * var Banana = Fruit.extend({ - * length: undefined, - * - * constructor: function(length, sugar) { - * Banana.super.constructor.call(this, 'Yellow', sugar); - * this.length = length; - * } - * }); - * - * var banana = new Banana(20, 40); - * console.log('banana instanceof Fruit', banana instanceof Fruit); - * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); - * console.log('bananas\'s prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); - * console.log(banana.sugar); - * console.log(banana.eat().sugar); - * console.log(banana.color); - */ - function extend(properties, superProtoOverride) { - var superProto = superProtoOverride || this.prototype || Chartist.Class; - var proto = Object.create(superProto); - - Chartist.Class.cloneDefinitions(proto, properties); - - var constr = function constr() { - var fn = proto.constructor || function () {}, - instance; - - // If this is linked to the Chartist namespace the constructor was not called with new - // To provide a fallback we will instantiate here and return the instance - instance = this === Chartist ? Object.create(proto) : this; - fn.apply(instance, Array.prototype.slice.call(arguments, 0)); - - // If this constructor was not called with new we need to return the instance - // This will not harm when the constructor has been called with new as the returned value is ignored - return instance; - }; - - constr.prototype = proto; - constr['super'] = superProto; - constr.extend = this.extend; - - return constr; - } - - /** - * Creates a mixin from multiple super prototypes. - * - * @memberof Chartist.Class - * @param {Array} mixProtoArr An array of super prototypes or an array of super prototype constructors. - * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. - * @returns {Function} Constructor function of the newly created mixin class - * - * @example - * var Fruit = Class.extend({ - * color: undefined, - * sugar: undefined, - * - * constructor: function(color, sugar) { - * this.color = color; - * this.sugar = sugar; - * }, - * - * eat: function() { - * this.sugar = 0; - * return this; - * } - * }); - * - * var Banana = Fruit.extend({ - * length: undefined, - * - * constructor: function(length, sugar) { - * Banana.super.constructor.call(this, 'Yellow', sugar); - * this.length = length; - * } - * }); - * - * var banana = new Banana(20, 40); - * console.log('banana instanceof Fruit', banana instanceof Fruit); - * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); - * console.log('bananas\'s prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); - * console.log(banana.sugar); - * console.log(banana.eat().sugar); - * console.log(banana.color); - * - * - * var KCal = Class.extend({ - * sugar: 0, - * - * constructor: function(sugar) { - * this.sugar = sugar; - * }, - * - * get kcal() { - * return [this.sugar * 4, 'kcal'].join(''); - * } - * }); - * - * var Nameable = Class.extend({ - * name: undefined, - * - * constructor: function(name) { - * this.name = name; - * } - * }); - * - * var NameableKCalBanana = Class.mix([Banana, KCal, Nameable], { - * constructor: function(name, length, sugar) { - * Nameable.prototype.constructor.call(this, name); - * Banana.prototype.constructor.call(this, length, sugar); - * }, - * - * toString: function() { - * return [this.name, 'with', this.length + 'cm', 'and', this.kcal].join(' '); - * } - * }); - * - * - * - * var banana = new Banana(20, 40); - * console.log('banana instanceof Fruit', banana instanceof Fruit); - * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); - * console.log('bananas\'s prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); - * console.log(banana.sugar); - * console.log(banana.eat().sugar); - * console.log(banana.color); - * - * var superBanana = new NameableKCalBanana('Super Mixin Banana', 30, 80); - * console.log(superBanana.toString()); - * - */ - function mix(mixProtoArr, properties) { - if (this !== Chartist.Class) { - throw new Error('Chartist.Class.mix should only be called on the type and never on an instance!'); - } - - // Make sure our mixin prototypes are the class objects and not the constructors - var superPrototypes = [{}].concat(mixProtoArr).map(function (prototype) { - return prototype instanceof Function ? prototype.prototype : prototype; - }); - - var mixedSuperProto = Chartist.Class.cloneDefinitions.apply(undefined, superPrototypes); - // Delete the constructor if present because we don't want to invoke a constructor on a mixed prototype - delete mixedSuperProto.constructor; - return this.extend(properties, mixedSuperProto); - } - - // Variable argument list clones args > 0 into args[0] and retruns modified args[0] - function cloneDefinitions() { - var args = listToArray(arguments); - var target = args[0]; - - args.splice(1, args.length - 1).forEach(function (source) { - Object.getOwnPropertyNames(source).forEach(function (propName) { - // If this property already exist in target we delete it first - delete target[propName]; - // Define the property with the descriptor from source - Object.defineProperty(target, propName, Object.getOwnPropertyDescriptor(source, propName)); - }); - }); - - return target; - } - - Chartist.Class = { - extend: extend, - mix: mix, - cloneDefinitions: cloneDefinitions - }; - })(window, document, Chartist);; /** - * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. - * - * @module Chartist.Base - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. - // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not - // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. - // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html - // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj - // The problem is with the label offsets that can't be converted into percentage and affecting the chart container - /** - * Updates the chart which currently does a full reconstruction of the SVG DOM - * - * @memberof Chartist.Base - */ - function update() { - this.createChart(this.optionsProvider.currentOptions); - } - - /** - * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. - * - * @memberof Chartist.Base - */ - function detach() { - window.removeEventListener('resize', this.update); - this.optionsProvider.removeMediaQueryListeners(); - } - - /** - * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. - * - * @memberof Chartist.Base - * @param {String} event Name of the event. Check the examples for supported events. - * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. - */ - function on(event, handler) { - this.eventEmitter.addEventHandler(event, handler); - } - - /** - * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. - * - * @memberof Chartist.Base - * @param {String} event Name of the event for which a handler should be removed - * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. - */ - function off(event, handler) { - this.eventEmitter.removeEventHandler(event, handler); - } - - /** - * Constructor of chart base class. - * - * @param query - * @param data - * @param options - * @param responsiveOptions - * @constructor - */ - function Base(query, data, options, responsiveOptions) { - this.container = Chartist.querySelector(query); - this.data = data; - this.options = options; - this.responsiveOptions = responsiveOptions; - this.eventEmitter = Chartist.EventEmitter(); - this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility'); - - window.addEventListener('resize', this.update.bind(this)); - - // Using event loop for first draw to make it possible to register event listeners in the same call stack where - // the chart was created. - setTimeout((function () { - // Obtain current options based on matching media queries (if responsive options are given) - // This will also register a listener that is re-creating the chart based on media changes - // TODO: Remove default options parameter from optionsProvider - this.optionsProvider = Chartist.optionsProvider({}, this.options, this.responsiveOptions, this.eventEmitter); - this.createChart(this.optionsProvider.currentOptions); - }).bind(this), 0); - } - - // Creating the chart base class - Chartist.Base = Chartist.Class.extend({ - constructor: Base, - optionsProvider: undefined, - container: undefined, - svg: undefined, - eventEmitter: undefined, - createChart: function createChart() { - throw new Error('Base chart type can\'t be instantiated!'); - }, - update: update, - detach: detach, - on: on, - off: off, - version: Chartist.version, - supportsForeignObject: false - }); - })(window, document, Chartist);; /** - * Chartist SVG module for simple SVG DOM abstraction - * - * @module Chartist.Svg - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - Chartist.xmlNs = { - qualifiedName: 'xmlns:ct', - prefix: 'ct', - uri: 'http://gionkunz.github.com/chartist-js/ct' - }; - - /** - * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. - * - * @memberof Chartist.Svg - * @param {String} name The name of the SVG element to create - * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} className This class or class list will be added to the SVG element - * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child - * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - * @returns {Object} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data - */ - Chartist.Svg = function (name, attributes, className, parent, insertFirst) { - - var svgNs = 'http://www.w3.org/2000/svg', - xmlNs = 'http://www.w3.org/2000/xmlns/', - xhtmlNs = 'http://www.w3.org/1999/xhtml'; - - /** - * Set attributes on the current SVG element of the wrapper you're currently working on. - * - * @memberof Chartist.Svg - * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} ns If specified, the attributes will be set as namespace attributes with ns as prefix. - * @returns {Object} The current wrapper object will be returned so it can be used for chaining. - */ - function _attr(node, attributes, ns) { - Object.keys(attributes).forEach(function (key) { - // If the attribute value is undefined we can skip this one - if (attributes[key] === undefined) { - return; - } - - if (ns) { - node.setAttributeNS(ns, [Chartist.xmlNs.prefix, ':', key].join(''), attributes[key]); - } else { - node.setAttribute(key, attributes[key]); - } - }); - - return node; - } - - /** - * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. - * - * @memberof Chartist.Svg - * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper - * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - * @returns {Object} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data - */ - function elem(name, attributes, className, parentNode, insertFirst) { - var node = document.createElementNS(svgNs, name); - - // If this is an SVG element created then custom namespace - if (name === 'svg') { - node.setAttributeNS(xmlNs, Chartist.xmlNs.qualifiedName, Chartist.xmlNs.uri); - } - - if (parentNode) { - if (insertFirst && parentNode.firstChild) { - parentNode.insertBefore(node, parentNode.firstChild); - } else { - parentNode.appendChild(node); - } - } - - if (attributes) { - _attr(node, attributes); - } - - if (className) { - _addClass(node, className); - } - - return node; - } - - /** - * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. - * - * @memberof Chartist.Svg - * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject - * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child - * @returns {Object} New wrapper object that wraps the foreignObject element - */ - function _foreignObject(content, attributes, className, parent, insertFirst) { - // If content is string then we convert it to DOM - // TODO: Handle case where content is not a string nor a DOM Node - if (typeof content === 'string') { - var container = document.createElement('div'); - container.innerHTML = content; - content = container.firstChild; - } - - // Adding namespace to content element - content.setAttribute('xmlns', xhtmlNs); - - // Creating the foreignObject without required extension attribute (as described here - // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) - var fnObj = parent.elem('foreignObject', attributes, className, insertFirst); - - // Add content to foreignObjectElement - fnObj._node.appendChild(content); - - return fnObj; - } - - /** - * This method adds a new text element to the current Chartist.Svg wrapper. - * - * @memberof Chartist.Svg - * @param {String} t The text that should be added to the text element that is created - * @returns {Object} The same wrapper object that was used to add the newly created element - */ - function _text(node, t) { - node.appendChild(document.createTextNode(t)); - } - - /** - * This method will clear all child nodes of the current wrapper object. - * - * @memberof Chartist.Svg - * @returns {Object} The same wrapper object that got emptied - */ - function _empty(node) { - while (node.firstChild) { - node.removeChild(node.firstChild); - } - } - - /** - * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. - * - * @memberof Chartist.Svg - * @returns {Object} The parent wrapper object of the element that got removed - */ - function _remove(node) { - node.parentNode.removeChild(node); - } - - /** - * This method will replace the element with a new element that can be created outside of the current DOM. - * - * @memberof Chartist.Svg - * @param {Object} newElement The new wrapper object that will be used to replace the current wrapper object - * @returns {Object} The wrapper of the new element - */ - function _replace(node, newChild) { - node.parentNode.replaceChild(newChild, node); - } - - /** - * This method will append an element to the current element as a child. - * - * @memberof Chartist.Svg - * @param {Object} element The element that should be added as a child - * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child - * @returns {Object} The wrapper of the appended object - */ - function _append(node, child, insertFirst) { - if (insertFirst && node.firstChild) { - node.insertBefore(child, node.firstChild); - } else { - node.appendChild(child); - } - } - - /** - * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. - * - * @memberof Chartist.Svg - * @returns {Array} A list of classes or an empty array if there are no classes on the current element - */ - function _classes(node) { - return node.getAttribute('class') ? node.getAttribute('class').trim().split(/\s+/) : []; - } - - /** - * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @returns {Object} The wrapper of the current element - */ - function _addClass(node, names) { - node.setAttribute('class', _classes(node).concat(names.trim().split(/\s+/)).filter(function (elem, pos, self) { - return self.indexOf(elem) === pos; - }).join(' ')); - } - - /** - * Removes one or a space separated list of classes from the current element. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @returns {Object} The wrapper of the current element - */ - function _removeClass(node, names) { - var removedClasses = names.trim().split(/\s+/); - - node.setAttribute('class', _classes(node).filter(function (name) { - return removedClasses.indexOf(name) === -1; - }).join(' ')); - } - - /** - * Removes all classes from the current element. - * - * @memberof Chartist.Svg - * @returns {Object} The wrapper of the current element - */ - function _removeAllClasses(node) { - node.setAttribute('class', ''); - } - - /** - * Get element height with fallback to svg BoundingBox or parent container dimensions: - * See [bugzilla.mozilla.org](https://bugzilla.mozilla.org/show_bug.cgi?id=530985) - * - * @memberof Chartist.Svg - * @return {Number} The elements height in pixels - */ - function _height(node) { - return node.clientHeight || Math.round(node.getBBox().height) || node.parentNode.clientHeight; - } - - /** - * Get element width with fallback to svg BoundingBox or parent container dimensions: - * See [bugzilla.mozilla.org](https://bugzilla.mozilla.org/show_bug.cgi?id=530985) - * - * @memberof Chartist.Core - * @return {Number} The elements width in pixels - */ - function _width(node) { - return node.clientWidth || Math.round(node.getBBox().width) || node.parentNode.clientWidth; - } - - return { - _node: elem(name, attributes, className, parent ? parent._node : undefined, insertFirst), - _parent: parent, - parent: function parent() { - return this._parent; - }, - attr: function attr(attributes, ns) { - _attr(this._node, attributes, ns); - return this; - }, - empty: function empty() { - _empty(this._node); - return this; - }, - remove: function remove() { - _remove(this._node); - return this.parent(); - }, - replace: function replace(newElement) { - newElement._parent = this._parent; - _replace(this._node, newElement._node); - return newElement; - }, - append: function append(element, insertFirst) { - element._parent = this; - _append(this._node, element._node, insertFirst); - return element; - }, - elem: function elem(name, attributes, className, insertFirst) { - return Chartist.Svg(name, attributes, className, this, insertFirst); - }, - foreignObject: function foreignObject(content, attributes, className, insertFirst) { - return _foreignObject(content, attributes, className, this, insertFirst); - }, - text: function text(t) { - _text(this._node, t); - return this; - }, - addClass: function addClass(names) { - _addClass(this._node, names); - return this; - }, - removeClass: function removeClass(names) { - _removeClass(this._node, names); - return this; - }, - removeAllClasses: function removeAllClasses() { - _removeAllClasses(this._node); - return this; - }, - classes: function classes() { - return _classes(this._node); - }, - height: function height() { - return _height(this._node); - }, - width: function width() { - return _width(this._node); - } - }; - }; - - /** - * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. - * - * @memberof Chartist.Svg - * @param {String} feature The SVG 1.1 feature that should be checked for support. - * @returns {Boolean} True of false if the feature is supported or not - */ - Chartist.Svg.isSupported = function (feature) { - return document.implementation.hasFeature('www.http://w3.org/TR/SVG11/feature#' + feature, '1.1'); - }; - })(window, document, Chartist);; /** - * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. - * - * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. - * - * @module Chartist.Line - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - var defaultOptions = { - axisX: { - offset: 30, - labelOffset: { - x: 0, - y: 0 - }, - showLabel: true, - showGrid: true, - labelInterpolationFnc: Chartist.noop - }, - axisY: { - offset: 40, - labelOffset: { - x: 0, - y: 0 - }, - showLabel: true, - showGrid: true, - labelInterpolationFnc: Chartist.noop, - scaleMinSpace: 30 - }, - width: undefined, - height: undefined, - showLine: true, - showPoint: true, - showArea: false, - areaBase: 0, - lineSmooth: true, - low: undefined, - high: undefined, - chartPadding: 5, - classNames: { - chart: 'ct-chart-line', - label: 'ct-label', - series: 'ct-series', - line: 'ct-line', - point: 'ct-point', - area: 'ct-area', - grid: 'ct-grid', - vertical: 'ct-vertical', - horizontal: 'ct-horizontal' - } - }; - - function createChart(options) { - var seriesGroups = [], - bounds, - normalizedData = Chartist.normalizeDataArray(Chartist.getDataArray(this.data), this.data.labels.length); - - // Create new svg object - this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); - - // initialize bounds - bounds = Chartist.getBounds(this.svg, normalizedData, options); - - var chartRect = Chartist.createChartRect(this.svg, options); - // Start drawing - var labels = this.svg.elem('g'), - grid = this.svg.elem('g'); - - Chartist.createXAxis(chartRect, this.data, grid, labels, options, this.eventEmitter, this.supportsForeignObject); - Chartist.createYAxis(chartRect, bounds, grid, labels, options, this.eventEmitter, this.supportsForeignObject); - - // Draw the series - // initialize series groups - for (var i = 0; i < this.data.series.length; i++) { - seriesGroups[i] = this.svg.elem('g'); - - // If the series is an object and contains a name we add a custom attribute - if (this.data.series[i].name) { - seriesGroups[i].attr({ - 'series-name': this.data.series[i].name - }, Chartist.xmlNs.uri); - } - - // Use series class from series data or if not set generate one - seriesGroups[i].addClass([options.classNames.series, this.data.series[i].className || options.classNames.series + '-' + Chartist.alphaNumerate(i)].join(' ')); - - var p, - pathCoordinates = [], - point; + Object.defineProperty(exports, '__esModule', { + value: true + }); - for (var j = 0; j < normalizedData[i].length; j++) { - p = Chartist.projectPoint(chartRect, bounds, normalizedData[i], j); - pathCoordinates.push(p.x, p.y); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - //If we should show points we need to create them now to avoid secondary loop - // Small offset for Firefox to render squares correctly - if (options.showPoint) { - point = seriesGroups[i].elem('line', { - x1: p.x, - y1: p.y, - x2: p.x + 0.01, - y2: p.y - }, options.classNames.point).attr({ - 'value': normalizedData[i][j] - }, Chartist.xmlNs.uri); + var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - this.eventEmitter.emit('draw', { - type: 'point', - value: normalizedData[i][j], - index: j, - group: seriesGroups[i], - element: point, - x: p.x, - y: p.y - }); - } - } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - // TODO: Nicer handling of conditions, maybe composition? - if (options.showLine || options.showArea) { - // TODO: We should add a path API in the SVG library for easier path creation - var pathElements = ['M' + pathCoordinates[0] + ',' + pathCoordinates[1]]; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - // If smoothed path and path has more than two points then use catmull rom to bezier algorithm - if (options.lineSmooth && pathCoordinates.length > 4) { + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var cr = Chartist.catmullRom2bezier(pathCoordinates); - for (var k = 0; k < cr.length; k++) { - pathElements.push('C' + cr[k].join()); - } - } else { - for (var l = 3; l < pathCoordinates.length; l += 2) { - pathElements.push('L' + pathCoordinates[l - 1] + ',' + pathCoordinates[l]); - } - } + var _react = __webpack_require__(2); - if (options.showArea) { - // If areaBase is outside the chart area (< low or > high) we need to set it respectively so that - // the area is not drawn outside the chart area. - var areaBase = Math.max(Math.min(options.areaBase, bounds.high), bounds.low); + var _react2 = _interopRequireDefault(_react); - // If we need to draw area shapes we just make a copy of our pathElements SVG path array - var areaPathElements = pathElements.slice(); + var ChartistGraph = (function (_Component) { + _inherits(ChartistGraph, _Component); - // We project the areaBase value into screen coordinates - var areaBaseProjected = Chartist.projectPoint(chartRect, bounds, [areaBase], 0); - // And splice our new area path array to add the missing path elements to close the area shape - areaPathElements.splice(0, 0, 'M' + areaBaseProjected.x + ',' + areaBaseProjected.y); - areaPathElements[1] = 'L' + pathCoordinates[0] + ',' + pathCoordinates[1]; - areaPathElements.push('L' + pathCoordinates[pathCoordinates.length - 2] + ',' + areaBaseProjected.y); + function ChartistGraph() { + _classCallCheck(this, ChartistGraph); - // Create the new path for the area shape with the area class from the options - seriesGroups[i].elem('path', { - d: areaPathElements.join('') - }, options.classNames.area, true).attr({ - 'values': normalizedData[i] - }, Chartist.xmlNs.uri); - } + _get(Object.getPrototypeOf(ChartistGraph.prototype), 'constructor', this).apply(this, arguments); + } - if (options.showLine) { - seriesGroups[i].elem('path', { - d: pathElements.join('') - }, options.classNames.line, true).attr({ - 'values': normalizedData[i] - }, Chartist.xmlNs.uri); - } + _createClass(ChartistGraph, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(newProps) { + this.updateChart(newProps); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this.chartist) { + try { + this.chartist.detach(); + } catch (err) { + throw new Error('Internal chartist error', err); } } } - - /** - * This method creates a new line chart. - * - * @memberof Chartist.Line - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // These are the default options of the line chart - * var options = { - * // Options for X-Axis - * axisX: { - * // The offset of the labels to the chart area - * offset: 30, - * // Allows you to correct label positioning on this axis by positive or negative x and y offset. - * labelOffset: { - * x: 0, - * y: 0 - * }, - * // If labels should be shown or not - * showLabel: true, - * // If the axis grid should be drawn or not - * showGrid: true, - * // Interpolation function that allows you to intercept the value from the axis label - * labelInterpolationFnc: function(value){return value;} - * }, - * // Options for Y-Axis - * axisY: { - * // The offset of the labels to the chart area - * offset: 40, - * // Allows you to correct label positioning on this axis by positive or negative x and y offset. - * labelOffset: { - * x: 0, - * y: 0 - * }, - * // If labels should be shown or not - * showLabel: true, - * // If the axis grid should be drawn or not - * showGrid: true, - * // Interpolation function that allows you to intercept the value from the axis label - * labelInterpolationFnc: function(value){return value;}, - * // This value specifies the minimum height in pixel of the scale steps - * scaleMinSpace: 30 - * }, - * // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - * width: undefined, - * // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - * height: undefined, - * // If the line should be drawn or not - * showLine: true, - * // If dots should be drawn or not - * showPoint: true, - * // If the line chart should draw an area - * showArea: false, - * // The base for the area chart that will be used to close the area shape (is normally 0) - * areaBase: 0, - * // Specify if the lines should be smoothed (Catmull-Rom-Splines will be used) - * lineSmooth: true, - * // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - * low: undefined, - * // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - * high: undefined, - * // Padding of the chart drawing area to the container element and labels - * chartPadding: 5, - * // Override the class names that get used to generate the SVG structure of the chart - * classNames: { - * chart: 'ct-chart-line', - * label: 'ct-label', - * series: 'ct-series', - * line: 'ct-line', - * point: 'ct-point', - * area: 'ct-area', - * grid: 'ct-grid', - * vertical: 'ct-vertical', - * horizontal: 'ct-horizontal' - * } - * }; - * - * @example - * // Create a simple line chart - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // As options we currently only set a static size of 300x200 px - * var options = { - * width: '300px', - * height: '200px' - * }; - * - * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options - * new Chartist.Line('.ct-chart', data, options); - * - * @example - * // Create a line chart with responsive options - * - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In adition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. - * var responsiveOptions = [ - * ['screen and (min-width: 641px) and (max-width: 1024px)', { - * showPoint: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return Mon, Tue, Wed etc. on medium screens - * return value.slice(0, 3); - * } - * } - * }], - * ['screen and (max-width: 640px)', { - * showLine: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return M, T, W etc. on small screens - * return value[0]; - * } - * } - * }] - * ]; - * - * new Chartist.Line('.ct-chart', data, null, responsiveOptions); - * - */ - function Line(query, data, options, responsiveOptions) { - Chartist.Line['super'].constructor.call(this, query, data, Chartist.extend(Chartist.extend({}, defaultOptions), options), responsiveOptions); + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.updateChart(this.props); } + }, { + key: 'updateChart', + value: function updateChart(config) { + var Chartist = __webpack_require__(3); - // Creating line chart type in Chartist namespace - Chartist.Line = Chartist.Base.extend({ - constructor: Line, - createChart: createChart - }); - })(window, document, Chartist); - ; /** - * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. - * - * @module Chartist.Bar - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - var defaultOptions = { - axisX: { - offset: 30, - labelOffset: { - x: 0, - y: 0 - }, - showLabel: true, - showGrid: true, - labelInterpolationFnc: Chartist.noop - }, - axisY: { - offset: 40, - labelOffset: { - x: 0, - y: 0 - }, - showLabel: true, - showGrid: true, - labelInterpolationFnc: Chartist.noop, - scaleMinSpace: 30 - }, - width: undefined, - height: undefined, - high: undefined, - low: undefined, - chartPadding: 5, - seriesBarDistance: 15, - classNames: { - chart: 'ct-chart-bar', - label: 'ct-label', - series: 'ct-series', - bar: 'ct-bar', - grid: 'ct-grid', - vertical: 'ct-vertical', - horizontal: 'ct-horizontal' - } - }; - - function createChart(options) { - var seriesGroups = [], - bounds, - normalizedData = Chartist.normalizeDataArray(Chartist.getDataArray(this.data), this.data.labels.length); - - // Create new svg element - this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); - - // initialize bounds - bounds = Chartist.getBounds(this.svg, normalizedData, options, 0); - - var chartRect = Chartist.createChartRect(this.svg, options); - // Start drawing - var labels = this.svg.elem('g'), - grid = this.svg.elem('g'), - - // Projected 0 point - zeroPoint = Chartist.projectPoint(chartRect, bounds, [0], 0); + var type = config.type; + var data = config.data; - Chartist.createXAxis(chartRect, this.data, grid, labels, options, this.eventEmitter, this.supportsForeignObject); - Chartist.createYAxis(chartRect, bounds, grid, labels, options, this.eventEmitter, this.supportsForeignObject); + var options = config.options || {}; + var responsiveOptions = config.responsiveOptions || []; + var event = undefined; - // Draw the series - // initialize series groups - for (var i = 0; i < this.data.series.length; i++) { - // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. - var biPol = i - (this.data.series.length - 1) / 2, - - // Half of the period with between vertical grid lines used to position bars - periodHalfWidth = chartRect.width() / normalizedData[i].length / 2; - - seriesGroups[i] = this.svg.elem('g'); - - // If the series is an object and contains a name we add a custom attribute - if (this.data.series[i].name) { - seriesGroups[i].attr({ - 'series-name': this.data.series[i].name - }, Chartist.xmlNs.uri); - } - - // Use series class from series data or if not set generate one - seriesGroups[i].addClass([options.classNames.series, this.data.series[i].className || options.classNames.series + '-' + Chartist.alphaNumerate(i)].join(' ')); - - for (var j = 0; j < normalizedData[i].length; j++) { - var p = Chartist.projectPoint(chartRect, bounds, normalizedData[i], j), - bar; - - // Offset to center bar between grid lines and using bi-polar offset for multiple series - // TODO: Check if we should really be able to add classes to the series. Should be handles with Sass and semantic / specific selectors - p.x += periodHalfWidth + biPol * options.seriesBarDistance; - - bar = seriesGroups[i].elem('line', { - x1: p.x, - y1: zeroPoint.y, - x2: p.x, - y2: p.y - }, options.classNames.bar).attr({ - 'value': normalizedData[i][j] - }, Chartist.xmlNs.uri); + if (this.chartist) { + this.chartist.update(data, options, responsiveOptions); + } else { + this.chartist = new Chartist[type](this.refs.chart, data, options, responsiveOptions); - this.eventEmitter.emit('draw', { - type: 'bar', - value: normalizedData[i][j], - index: j, - group: seriesGroups[i], - element: bar, - x1: p.x, - y1: zeroPoint.y, - x2: p.x, - y2: p.y - }); + if (config.listener) { + for (event in config.listener) { + if (config.listener.hasOwnProperty(event)) { + this.chartist.on(event, config.listener[event]); + } + } } } - } - /** - * This method creates a new bar chart and returns API object that you can use for later changes. - * - * @memberof Chartist.Bar - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // These are the default options of the bar chart - * var options = { - * // Options for X-Axis - * axisX: { - * // The offset of the chart drawing area to the border of the container - * offset: 30, - * // Allows you to correct label positioning on this axis by positive or negative x and y offset. - * labelOffset: { - * x: 0, - * y: 0 - * }, - * // If labels should be shown or not - * showLabel: true, - * // If the axis grid should be drawn or not - * showGrid: true, - * // Interpolation function that allows you to intercept the value from the axis label - * labelInterpolationFnc: function(value){return value;} - * }, - * // Options for Y-Axis - * axisY: { - * // The offset of the chart drawing area to the border of the container - * offset: 40, - * // Allows you to correct label positioning on this axis by positive or negative x and y offset. - * labelOffset: { - * x: 0, - * y: 0 - * }, - * // If labels should be shown or not - * showLabel: true, - * // If the axis grid should be drawn or not - * showGrid: true, - * // Interpolation function that allows you to intercept the value from the axis label - * labelInterpolationFnc: function(value){return value;}, - * // This value specifies the minimum height in pixel of the scale steps - * scaleMinSpace: 30 - * }, - * // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - * width: undefined, - * // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - * height: undefined, - * // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - * low: undefined, - * // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - * high: undefined, - * // Padding of the chart drawing area to the container element and labels - * chartPadding: 5, - * // Specify the distance in pixel of bars in a group - * seriesBarDistance: 15, - * // Override the class names that get used to generate the SVG structure of the chart - * classNames: { - * chart: 'ct-chart-bar', - * label: 'ct-label', - * series: 'ct-series', - * bar: 'ct-bar', - * grid: 'ct-grid', - * vertical: 'ct-vertical', - * horizontal: 'ct-horizontal' - * } - * }; - * - * @example - * // Create a simple bar chart - * var data = { - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. - * new Chartist.Bar('.ct-chart', data); - * - * @example - * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 - * new Chartist.Bar('.ct-chart', { - * labels: [1, 2, 3, 4, 5, 6, 7], - * series: [ - * [1, 3, 2, -5, -3, 1, -6], - * [-5, -2, -4, -1, 2, -3, 1] - * ] - * }, { - * seriesBarDistance: 12, - * low: -10, - * high: 10 - * }); - * - */ - function Bar(query, data, options, responsiveOptions) { - Chartist.Bar['super'].constructor.call(this, query, data, Chartist.extend(Chartist.extend({}, defaultOptions), options), responsiveOptions); + return this.chartist; } - - // Creating bar chart type in Chartist namespace - Chartist.Bar = Chartist.Base.extend({ - constructor: Bar, - createChart: createChart - }); - })(window, document, Chartist); - ; /** - * The pie chart module of Chartist that can be used to draw pie, donut or gauge charts - * - * @module Chartist.Pie - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - var defaultOptions = { - width: undefined, - height: undefined, - chartPadding: 5, - classNames: { - chart: 'ct-chart-pie', - series: 'ct-series', - slice: 'ct-slice', - donut: 'ct-donut', - label: 'ct-label' - }, - startAngle: 0, - total: undefined, - donut: false, - donutWidth: 60, - showLabel: true, - labelOffset: 0, - labelInterpolationFnc: Chartist.noop, - labelOverflow: false, - labelDirection: 'neutral' - }; - - function determineAnchorPosition(center, label, direction) { - var toTheRight = label.x > center.x; - - if (toTheRight && direction === 'explode' || !toTheRight && direction === 'implode') { - return 'start'; - } else if (toTheRight && direction === 'implode' || !toTheRight && direction === 'explode') { - return 'end'; - } else { - return 'middle'; - } + }, { + key: 'render', + value: function render() { + var className = this.props.className ? ' ' + this.props.className : ''; + var style = this.props.style ? this.props.style : {}; + return _react2['default'].createElement('div', { className: 'ct-chart' + className, ref: 'chart', style: style }); } + }]); - function createChart(options) { - var seriesGroups = [], - chartRect, - radius, - labelRadius, - totalDataSum, - startAngle = options.startAngle, - dataArray = Chartist.getDataArray(this.data); - - // Create SVG.js draw - this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); - // Calculate charting rect - chartRect = Chartist.createChartRect(this.svg, options, 0, 0); - // Get biggest circle radius possible within chartRect - radius = Math.min(chartRect.width() / 2, chartRect.height() / 2); - // Calculate total of all series to get reference value or use total reference from optional options - totalDataSum = options.total || dataArray.reduce(function (previousValue, currentValue) { - return previousValue + currentValue; - }, 0); - - // If this is a donut chart we need to adjust our radius to enable strokes to be drawn inside - // Unfortunately this is not possible with the current SVG Spec - // See this proposal for more details: http://lists.w3.org/Archives/Public/www-svg/2003Oct/0000.html - radius -= options.donut ? options.donutWidth / 2 : 0; - - // If a donut chart then the label position is at the radius, if regular pie chart it's half of the radius - // see https://github.com/gionkunz/chartist-js/issues/21 - labelRadius = options.donut ? radius : radius / 2; - // Add the offset to the labelRadius where a negative offset means closed to the center of the chart - labelRadius += options.labelOffset; - - // Calculate end angle based on total sum and current data value and offset with padding - var center = { - x: chartRect.x1 + chartRect.width() / 2, - y: chartRect.y2 + chartRect.height() / 2 - }; + return ChartistGraph; + })(_react.Component); - // Check if there is only one non-zero value in the series array. - var hasSingleValInSeries = this.data.series.filter(function (val) { - return val !== 0; - }).length === 1; + ChartistGraph.propTypes = { + type: _react2['default'].PropTypes.string.isRequired, + data: _react2['default'].PropTypes.object.isRequired, + className: _react2['default'].PropTypes.string, + options: _react2['default'].PropTypes.object, + responsiveOptions: _react2['default'].PropTypes.array, + style: _react2['default'].PropTypes.object + }; - // Draw the series - // initialize series groups - for (var i = 0; i < this.data.series.length; i++) { - seriesGroups[i] = this.svg.elem('g', null, null, true); + exports['default'] = ChartistGraph; + module.exports = exports['default']; - // If the series is an object and contains a name we add a custom attribute - if (this.data.series[i].name) { - seriesGroups[i].attr({ - 'series-name': this.data.series[i].name - }, Chartist.xmlNs.uri); - } - - // Use series class from series data or if not set generate one - seriesGroups[i].addClass([options.classNames.series, this.data.series[i].className || options.classNames.series + '-' + Chartist.alphaNumerate(i)].join(' ')); - - var endAngle = startAngle + dataArray[i] / totalDataSum * 360; - // If we need to draw the arc for all 360 degrees we need to add a hack where we close the circle - // with Z and use 359.99 degrees - if (endAngle - startAngle === 360) { - endAngle -= 0.01; - } - - var start = Chartist.polarToCartesian(center.x, center.y, radius, startAngle - (i === 0 || hasSingleValInSeries ? 0 : 0.2)), - end = Chartist.polarToCartesian(center.x, center.y, radius, endAngle), - arcSweep = endAngle - startAngle <= 180 ? '0' : '1', - d = [ - // Start at the end point from the cartesian coordinates - 'M', end.x, end.y, - // Draw arc - 'A', radius, radius, 0, arcSweep, 0, start.x, start.y]; - - // If regular pie chart (no donut) we add a line to the center of the circle for completing the pie - if (options.donut === false) { - d.push('L', center.x, center.y); - } - - // Create the SVG path - // If this is a donut chart we add the donut class, otherwise just a regular slice - var path = seriesGroups[i].elem('path', { - d: d.join(' ') - }, options.classNames.slice + (options.donut ? ' ' + options.classNames.donut : '')); - - // Adding the pie series value to the path - path.attr({ - 'value': dataArray[i] - }, Chartist.xmlNs.uri); - - // If this is a donut, we add the stroke-width as style attribute - if (options.donut === true) { - path.attr({ - 'style': 'stroke-width: ' + +options.donutWidth + 'px' - }); - } - - // Fire off draw event - this.eventEmitter.emit('draw', { - type: 'slice', - value: dataArray[i], - totalDataSum: totalDataSum, - index: i, - group: seriesGroups[i], - element: path, - center: center, - radius: radius, - startAngle: startAngle, - endAngle: endAngle - }); - - // If we need to show labels we need to add the label for this slice now - if (options.showLabel) { - // Position at the labelRadius distance from center and between start and end angle - var labelPosition = Chartist.polarToCartesian(center.x, center.y, labelRadius, startAngle + (endAngle - startAngle) / 2), - interpolatedValue = options.labelInterpolationFnc(this.data.labels ? this.data.labels[i] : dataArray[i], i); - - var labelElement = seriesGroups[i].elem('text', { - dx: labelPosition.x, - dy: labelPosition.y, - 'text-anchor': determineAnchorPosition(center, labelPosition, options.labelDirection) - }, options.classNames.label).text('' + interpolatedValue); +/***/ }, +/* 2 */ +/***/ function(module, exports) { - // Fire off draw event - this.eventEmitter.emit('draw', { - type: 'label', - index: i, - group: seriesGroups[i], - element: labelElement, - text: '' + interpolatedValue, - x: labelPosition.x, - y: labelPosition.y - }); - } + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - // Set next startAngle to current endAngle. Use slight offset so there are no transparent hairline issues - // (except for last slice) - startAngle = endAngle; - } - } +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { - /** - * This method creates a new pie chart and returns an object that can be used to redraw the chart. - * - * @memberof Chartist.Pie - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object in the pie chart needs to have a series property with a one dimensional data array. The values will be normalized against each other and don't necessarily need to be in percentage. - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object with a version and an update method to manually redraw the chart - * - * @example - * // Default options of the pie chart - * var defaultOptions = { - * // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - * width: undefined, - * // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - * height: undefined, - * // Padding of the chart drawing area to the container element and labels - * chartPadding: 5, - * // Override the class names that get used to generate the SVG structure of the chart - * classNames: { - * chart: 'ct-chart-pie', - * series: 'ct-series', - * slice: 'ct-slice', - * donut: 'ct-donut', - label: 'ct-label' + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict';(function(root,factory){if(true){ // AMD. Register as an anonymous module unless amdModuleId is set + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function(){return root['Chartist'] = factory();}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}else if(typeof exports === 'object'){ // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory();}else {root['Chartist'] = factory();}})(undefined,function(){ /* Chartist.js 0.9.8 + * Copyright © 2016 Gion Kunz + * Free to use under either the WTFPL license or the MIT license. + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT + */ /** + * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. + * + * @module Chartist.Core + */var Chartist={version:'0.9.8'};(function(window,document,Chartist){'use strict'; /** + * This object contains all namespaces used within Chartist. + * + * @memberof Chartist.Core + * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}} + */Chartist.namespaces = {svg:'http://www.w3.org/2000/svg',xmlns:'http://www.w3.org/2000/xmlns/',xhtml:'http://www.w3.org/1999/xhtml',xlink:'http://www.w3.org/1999/xlink',ct:'http://gionkunz.github.com/chartist-js/ct'}; /** + * Helps to simplify functional style code + * + * @memberof Chartist.Core + * @param {*} n This exact value will be returned by the noop function + * @return {*} The same value that was provided to the n parameter + */Chartist.noop = function(n){return n;}; /** + * Generates a-z from a number 0 to 26 + * + * @memberof Chartist.Core + * @param {Number} n A number from 0 to 26 that will result in a letter a-z + * @return {String} A character from a-z based on the input number n + */Chartist.alphaNumerate = function(n){ // Limit to a-z + return String.fromCharCode(97 + n % 26);}; /** + * Simple recursive object extend + * + * @memberof Chartist.Core + * @param {Object} target Target object where the source will be merged into + * @param {Object...} sources This object (objects) will be merged into target and then target is returned + * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source + */Chartist.extend = function(target){target = target || {};var sources=Array.prototype.slice.call(arguments,1);sources.forEach(function(source){for(var prop in source) {if(typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)){target[prop] = Chartist.extend({},target[prop],source[prop]);}else {target[prop] = source[prop];}}});return target;}; /** + * Replaces all occurrences of subStr in str with newSubStr and returns a new string. + * + * @memberof Chartist.Core + * @param {String} str + * @param {String} subStr + * @param {String} newSubStr + * @return {String} + */Chartist.replaceAll = function(str,subStr,newSubStr){return str.replace(new RegExp(subStr,'g'),newSubStr);}; /** + * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified. + * + * @memberof Chartist.Core + * @param {Number} value + * @param {String} unit + * @return {String} Returns the passed number value with unit. + */Chartist.ensureUnit = function(value,unit){if(typeof value === 'number'){value = value + unit;}return value;}; /** + * Converts a number or string to a quantity object. + * + * @memberof Chartist.Core + * @param {String|Number} input + * @return {Object} Returns an object containing the value as number and the unit as string. + */Chartist.quantity = function(input){if(typeof input === 'string'){var match=/^(\d+)\s*(.*)$/g.exec(input);return {value:+match[1],unit:match[2] || undefined};}return {value:input};}; /** + * This is a wrapper around document.querySelector that will return the query if it's already of type Node + * + * @memberof Chartist.Core + * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly + * @return {Node} + */Chartist.querySelector = function(query){return query instanceof Node?query:document.querySelector(query);}; /** + * Functional style helper to produce array with given length initialized with undefined values + * + * @memberof Chartist.Core + * @param length + * @return {Array} + */Chartist.times = function(length){return Array.apply(null,new Array(length));}; /** + * Sum helper to be used in reduce functions + * + * @memberof Chartist.Core + * @param previous + * @param current + * @return {*} + */Chartist.sum = function(previous,current){return previous + (current?current:0);}; /** + * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor. + * + * @memberof Chartist.Core + * @param {Number} factor + * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array + */Chartist.mapMultiply = function(factor){return function(num){return num * factor;};}; /** + * Add helper to be used in `Array.map` for adding a addend to each value of an array. + * + * @memberof Chartist.Core + * @param {Number} addend + * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array + */Chartist.mapAdd = function(addend){return function(num){return num + addend;};}; /** + * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values). + * + * @memberof Chartist.Core + * @param arr + * @param cb + * @return {Array} + */Chartist.serialMap = function(arr,cb){var result=[],length=Math.max.apply(null,arr.map(function(e){return e.length;}));Chartist.times(length).forEach(function(e,index){var args=arr.map(function(e){return e[index];});result[index] = cb.apply(null,args);});return result;}; /** + * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit. + * + * @memberof Chartist.Core + * @param {Number} value The value that should be rounded with precision + * @param {Number} [digits] The number of digits after decimal used to do the rounding + * @returns {number} Rounded value + */Chartist.roundWithPrecision = function(value,digits){var precision=Math.pow(10,digits || Chartist.precision);return Math.round(value * precision) / precision;}; /** + * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. + * + * @memberof Chartist.Core + * @type {number} + */Chartist.precision = 8; /** + * A map with characters to escape for strings to be safely used as attribute values. + * + * @memberof Chartist.Core + * @type {Object} + */Chartist.escapingMap = {'&':'&','<':'<','>':'>','"':'"','\'':'''}; /** + * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap. + * If called with null or undefined the function will return immediately with null or undefined. + * + * @memberof Chartist.Core + * @param {Number|String|Object} data + * @return {String} + */Chartist.serialize = function(data){if(data === null || data === undefined){return data;}else if(typeof data === 'number'){data = '' + data;}else if(typeof data === 'object'){data = JSON.stringify({data:data});}return Object.keys(Chartist.escapingMap).reduce(function(result,key){return Chartist.replaceAll(result,key,Chartist.escapingMap[key]);},data);}; /** + * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success. + * + * @memberof Chartist.Core + * @param {String} data + * @return {String|Number|Object} + */Chartist.deserialize = function(data){if(typeof data !== 'string'){return data;}data = Object.keys(Chartist.escapingMap).reduce(function(result,key){return Chartist.replaceAll(result,Chartist.escapingMap[key],key);},data);try{data = JSON.parse(data);data = data.data !== undefined?data.data:data;}catch(e) {}return data;}; /** + * Create or reinitialize the SVG element for the chart + * + * @memberof Chartist.Core + * @param {Node} container The containing DOM Node object that will be used to plant the SVG element + * @param {String} width Set the width of the SVG element. Default is 100% + * @param {String} height Set the height of the SVG element. Default is 100% + * @param {String} className Specify a class to be added to the SVG element + * @return {Object} The created/reinitialized SVG element + */Chartist.createSvg = function(container,width,height,className){var svg;width = width || '100%';height = height || '100%'; // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it + // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/ + Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg){return svg.getAttributeNS(Chartist.namespaces.xmlns,'ct');}).forEach(function removePreviousElement(svg){container.removeChild(svg);}); // Create svg object with width and height or use 100% as default + svg = new Chartist.Svg('svg').attr({width:width,height:height}).addClass(className).attr({style:'width: ' + width + '; height: ' + height + ';'}); // Add the DOM node to our container + container.appendChild(svg._node);return svg;}; /** + * Ensures that the data object passed as second argument to the charts is present and correctly initialized. + * + * @param {Object} data The data object that is passed as second argument to the charts + * @return {Object} The normalized data object + */Chartist.normalizeData = function(data){ // Ensure data is present otherwise enforce + data = data || {series:[],labels:[]};data.series = data.series || [];data.labels = data.labels || []; // Check if we should generate some labels based on existing series data + if(data.series.length > 0 && data.labels.length === 0){var normalized=Chartist.getDataArray(data),labelCount; // If all elements of the normalized data array are arrays we're dealing with + // data from Bar or Line charts and we need to find the largest series if they are un-even + if(normalized.every(function(value){return value instanceof Array;})){ // Getting the series with the the most elements + labelCount = Math.max.apply(null,normalized.map(function(series){return series.length;}));}else { // We're dealing with Pie data so we just take the normalized array length + labelCount = normalized.length;} // Setting labels to an array with emptry strings using our labelCount estimated above + data.labels = Chartist.times(labelCount).map(function(){return '';});}return data;}; /** + * Reverses the series, labels and series data arrays. + * + * @memberof Chartist.Core + * @param data + */Chartist.reverseData = function(data){data.labels.reverse();data.series.reverse();for(var i=0;i < data.series.length;i++) {if(typeof data.series[i] === 'object' && data.series[i].data !== undefined){data.series[i].data.reverse();}else if(data.series[i] instanceof Array){data.series[i].reverse();}}}; /** + * Convert data series into plain array + * + * @memberof Chartist.Core + * @param {Object} data The series object that contains the data to be visualized in the chart + * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too. + * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created. + * @return {Array} A plain array that contains the data to be visualized in the chart + */Chartist.getDataArray = function(data,reverse,multi){ // If the data should be reversed but isn't we need to reverse it + // If it's reversed but it shouldn't we need to reverse it back + // That's required to handle data updates correctly and to reflect the responsive configurations + if(reverse && !data.reversed || !reverse && data.reversed){Chartist.reverseData(data);data.reversed = !data.reversed;} // Recursively walks through nested arrays and convert string values to numbers and objects with value properties + // to values. Check the tests in data core -> data normalization for a detailed specification of expected values + function recursiveConvert(_x){var _again=true;_function: while(_again) {var value=_x;_again = false;if(Chartist.isFalseyButZero(value)){ // This is a hole in data and we should return undefined + return undefined;}else if((value.data || value) instanceof Array){return (value.data || value).map(recursiveConvert);}else if(value.hasOwnProperty('value')){_x = value.value;_again = true;continue _function;}else {if(multi){var multiValue={}; // Single series value arrays are assumed to specify the Y-Axis value + // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}] + // If multi is a string then it's assumed that it specified which dimension should be filled as default + if(typeof multi === 'string'){multiValue[multi] = Chartist.getNumberOrUndefined(value);}else {multiValue.y = Chartist.getNumberOrUndefined(value);}multiValue.x = value.hasOwnProperty('x')?Chartist.getNumberOrUndefined(value.x):multiValue.x;multiValue.y = value.hasOwnProperty('y')?Chartist.getNumberOrUndefined(value.y):multiValue.y;return multiValue;}else {return Chartist.getNumberOrUndefined(value);}}}}return data.series.map(recursiveConvert);}; /** + * Converts a number into a padding object. + * + * @memberof Chartist.Core + * @param {Object|Number} padding + * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed + * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned. + */Chartist.normalizePadding = function(padding,fallback){fallback = fallback || 0;return typeof padding === 'number'?{top:padding,right:padding,bottom:padding,left:padding}:{top:typeof padding.top === 'number'?padding.top:fallback,right:typeof padding.right === 'number'?padding.right:fallback,bottom:typeof padding.bottom === 'number'?padding.bottom:fallback,left:typeof padding.left === 'number'?padding.left:fallback};};Chartist.getMetaData = function(series,index){var value=series.data?series.data[index]:series[index];return value?Chartist.serialize(value.meta):undefined;}; /** + * Calculate the order of magnitude for the chart scale + * + * @memberof Chartist.Core + * @param {Number} value The value Range of the chart + * @return {Number} The order of magnitude + */Chartist.orderOfMagnitude = function(value){return Math.floor(Math.log(Math.abs(value)) / Math.LN10);}; /** + * Project a data length into screen coordinates (pixels) + * + * @memberof Chartist.Core + * @param {Object} axisLength The svg element for the chart + * @param {Number} length Single data value from a series array + * @param {Object} bounds All the values to set the bounds of the chart + * @return {Number} The projected data length in pixels + */Chartist.projectLength = function(axisLength,length,bounds){return length / bounds.range * axisLength;}; /** + * Get the height of the area in the chart for the data series + * + * @memberof Chartist.Core + * @param {Object} svg The svg element for the chart + * @param {Object} options The Object that contains all the optional values for the chart + * @return {Number} The height of the area in the chart for the data series + */Chartist.getAvailableHeight = function(svg,options){return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset,0);}; /** + * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. + * + * @memberof Chartist.Core + * @param {Array} data The array that contains the data to be visualized in the chart + * @param {Object} options The Object that contains the chart options + * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration + * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart. + */Chartist.getHighLow = function(data,options,dimension){ // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred + options = Chartist.extend({},options,dimension?options['axis' + dimension.toUpperCase()]:{});var highLow={high:options.high === undefined?-Number.MAX_VALUE:+options.high,low:options.low === undefined?Number.MAX_VALUE:+options.low};var findHigh=options.high === undefined;var findLow=options.low === undefined; // Function to recursively walk through arrays and find highest and lowest number + function recursiveHighLow(data){if(data === undefined){return undefined;}else if(data instanceof Array){for(var i=0;i < data.length;i++) {recursiveHighLow(data[i]);}}else {var value=dimension?+data[dimension]:+data;if(findHigh && value > highLow.high){highLow.high = value;}if(findLow && value < highLow.low){highLow.low = value;}}} // Start to find highest and lowest number recursively + if(findHigh || findLow){recursiveHighLow(data);} // Overrides of high / low based on reference value, it will make sure that the invisible reference value is + // used to generate the chart. This is useful when the chart always needs to contain the position of the + // invisible reference value in the view i.e. for bipolar scales. + if(options.referenceValue || options.referenceValue === 0){highLow.high = Math.max(options.referenceValue,highLow.high);highLow.low = Math.min(options.referenceValue,highLow.low);} // If high and low are the same because of misconfiguration or flat data (only the same value) we need + // to set the high or low to 0 depending on the polarity + if(highLow.high <= highLow.low){ // If both values are 0 we set high to 1 + if(highLow.low === 0){highLow.high = 1;}else if(highLow.low < 0){ // If we have the same negative value for the bounds we set bounds.high to 0 + highLow.high = 0;}else if(highLow.high > 0){ // If we have the same positive value for the bounds we set bounds.low to 0 + highLow.low = 0;}else { // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors + highLow.high = 1;highLow.low = 0;}}return highLow;}; /** + * Checks if the value is a valid number or string with a number. + * + * @memberof Chartist.Core + * @param value + * @returns {Boolean} + */Chartist.isNum = function(value){return !isNaN(value) && isFinite(value);}; /** + * Returns true on all falsey values except the numeric value 0. + * + * @memberof Chartist.Core + * @param value + * @returns {boolean} + */Chartist.isFalseyButZero = function(value){return !value && value !== 0;}; /** + * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined. + * + * @memberof Chartist.Core + * @param value + * @returns {*} + */Chartist.getNumberOrUndefined = function(value){return isNaN(+value)?undefined:+value;}; /** + * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined. + * + * @param value + * @param dimension + * @returns {*} + */Chartist.getMultiValue = function(value,dimension){if(Chartist.isNum(value)){return +value;}else if(value){return value[dimension || 'y'] || 0;}else {return 0;}}; /** + * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex. + * + * @memberof Chartist.Core + * @param {Number} num An integer number where the smallest factor should be searched for + * @returns {Number} The smallest integer factor of the parameter num. + */Chartist.rho = function(num){if(num === 1){return num;}function gcd(_x2,_x3){var _again2=true;_function2: while(_again2) {var p=_x2,q=_x3;_again2 = false;if(p % q === 0){return q;}else {_x2 = q;_x3 = p % q;_again2 = true;continue _function2;}}}function f(x){return x * x + 1;}var x1=2,x2=2,divisor;if(num % 2 === 0){return 2;}do {x1 = f(x1) % num;x2 = f(f(x2)) % num;divisor = gcd(Math.abs(x1 - x2),num);}while(divisor === 1);return divisor;}; /** + * Calculate and retrieve all the bounds for the chart and return them in one array + * + * @memberof Chartist.Core + * @param {Number} axisLength The length of the Axis used for + * @param {Object} highLow An object containing a high and low property indicating the value range of the chart. + * @param {Number} scaleMinSpace The minimum projected length a step should result in + * @param {Boolean} onlyInteger + * @return {Object} All the values to set the bounds of the chart + */Chartist.getBounds = function(axisLength,highLow,scaleMinSpace,onlyInteger){var i,optimizationCounter=0,newMin,newMax,bounds={high:highLow.high,low:highLow.low};bounds.valueRange = bounds.high - bounds.low;bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);bounds.step = Math.pow(10,bounds.oom);bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;bounds.range = bounds.max - bounds.min;bounds.numberOfSteps = Math.round(bounds.range / bounds.step); // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace + // If we are already below the scaleMinSpace value we will scale up + var length=Chartist.projectLength(axisLength,bounds.step,bounds);var scaleUp=length < scaleMinSpace;var smallestFactor=onlyInteger?Chartist.rho(bounds.range):0; // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1 + if(onlyInteger && Chartist.projectLength(axisLength,1,bounds) >= scaleMinSpace){bounds.step = 1;}else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength,smallestFactor,bounds) >= scaleMinSpace){ // If step 1 was too small, we can try the smallest factor of range + // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor + // is larger than the scaleMinSpace we should go for it. + bounds.step = smallestFactor;}else { // Trying to divide or multiply by 2 and find the best step value + while(true) {if(scaleUp && Chartist.projectLength(axisLength,bounds.step,bounds) <= scaleMinSpace){bounds.step *= 2;}else if(!scaleUp && Chartist.projectLength(axisLength,bounds.step / 2,bounds) >= scaleMinSpace){bounds.step /= 2;if(onlyInteger && bounds.step % 1 !== 0){bounds.step *= 2;break;}}else {break;}if(optimizationCounter++ > 1000){throw new Error('Exceeded maximum number of iterations while optimizing scale step!');}}} // step must not be less than EPSILON to create values that can be represented as floating number. + var EPSILON=2.221E-16;bounds.step = Math.max(bounds.step,EPSILON); // Narrow min and max based on new step + newMin = bounds.min;newMax = bounds.max;while(newMin + bounds.step <= bounds.low) {newMin += bounds.step;}while(newMax - bounds.step >= bounds.high) {newMax -= bounds.step;}bounds.min = newMin;bounds.max = newMax;bounds.range = bounds.max - bounds.min;var values=[];for(i = bounds.min;i <= bounds.max;i += bounds.step) {var value=Chartist.roundWithPrecision(i);if(value !== values[values.length - 1]){values.push(i);}}bounds.values = values;return bounds;}; /** + * Calculate cartesian coordinates of polar coordinates + * + * @memberof Chartist.Core + * @param {Number} centerX X-axis coordinates of center point of circle segment + * @param {Number} centerY X-axis coordinates of center point of circle segment + * @param {Number} radius Radius of circle segment + * @param {Number} angleInDegrees Angle of circle segment in degrees + * @return {{x:Number, y:Number}} Coordinates of point on circumference + */Chartist.polarToCartesian = function(centerX,centerY,radius,angleInDegrees){var angleInRadians=(angleInDegrees - 90) * Math.PI / 180.0;return {x:centerX + radius * Math.cos(angleInRadians),y:centerY + radius * Math.sin(angleInRadians)};}; /** + * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right + * + * @memberof Chartist.Core + * @param {Object} svg The svg element for the chart + * @param {Object} options The Object that contains all the optional values for the chart + * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used + * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements + */Chartist.createChartRect = function(svg,options,fallbackPadding){var hasAxis=!!(options.axisX || options.axisY);var yAxisOffset=hasAxis?options.axisY.offset:0;var xAxisOffset=hasAxis?options.axisX.offset:0; // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0 + var width=svg.width() || Chartist.quantity(options.width).value || 0;var height=svg.height() || Chartist.quantity(options.height).value || 0;var normalizedPadding=Chartist.normalizePadding(options.chartPadding,fallbackPadding); // If settings were to small to cope with offset (legacy) and padding, we'll adjust + width = Math.max(width,yAxisOffset + normalizedPadding.left + normalizedPadding.right);height = Math.max(height,xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);var chartRect={padding:normalizedPadding,width:function width(){return this.x2 - this.x1;},height:function height(){return this.y1 - this.y2;}};if(hasAxis){if(options.axisX.position === 'start'){chartRect.y2 = normalizedPadding.top + xAxisOffset;chartRect.y1 = Math.max(height - normalizedPadding.bottom,chartRect.y2 + 1);}else {chartRect.y2 = normalizedPadding.top;chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset,chartRect.y2 + 1);}if(options.axisY.position === 'start'){chartRect.x1 = normalizedPadding.left + yAxisOffset;chartRect.x2 = Math.max(width - normalizedPadding.right,chartRect.x1 + 1);}else {chartRect.x1 = normalizedPadding.left;chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset,chartRect.x1 + 1);}}else {chartRect.x1 = normalizedPadding.left;chartRect.x2 = Math.max(width - normalizedPadding.right,chartRect.x1 + 1);chartRect.y2 = normalizedPadding.top;chartRect.y1 = Math.max(height - normalizedPadding.bottom,chartRect.y2 + 1);}return chartRect;}; /** + * Creates a grid line based on a projected value. + * + * @memberof Chartist.Core + * @param position + * @param index + * @param axis + * @param offset + * @param length + * @param group + * @param classes + * @param eventEmitter + */Chartist.createGrid = function(position,index,axis,offset,length,group,classes,eventEmitter){var positionalData={};positionalData[axis.units.pos + '1'] = position;positionalData[axis.units.pos + '2'] = position;positionalData[axis.counterUnits.pos + '1'] = offset;positionalData[axis.counterUnits.pos + '2'] = offset + length;var gridElement=group.elem('line',positionalData,classes.join(' ')); // Event for grid draw + eventEmitter.emit('draw',Chartist.extend({type:'grid',axis:axis,index:index,group:group,element:gridElement},positionalData));}; /** + * Creates a label based on a projected value and an axis. + * + * @memberof Chartist.Core + * @param position + * @param length + * @param index + * @param labels + * @param axis + * @param axisOffset + * @param labelOffset + * @param group + * @param classes + * @param useForeignObject + * @param eventEmitter + */Chartist.createLabel = function(position,length,index,labels,axis,axisOffset,labelOffset,group,classes,useForeignObject,eventEmitter){var labelElement;var positionalData={};positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];positionalData[axis.units.len] = length;positionalData[axis.counterUnits.len] = Math.max(0,axisOffset - 10);if(useForeignObject){ // We need to set width and height explicitly to px as span will not expand with width and height being + // 100% in all browsers + var content='' + labels[index] + '';labelElement = group.foreignObject(content,Chartist.extend({style:'overflow: visible;'},positionalData));}else {labelElement = group.elem('text',positionalData,classes.join(' ')).text(labels[index]);}eventEmitter.emit('draw',Chartist.extend({type:'label',axis:axis,index:index,group:group,element:labelElement,text:labels[index]},positionalData));}; /** + * Helper to read series specific options from options object. It automatically falls back to the global option if + * there is no option in the series options. + * + * @param {Object} series Series object + * @param {Object} options Chartist options object + * @param {string} key The options key that should be used to obtain the options + * @returns {*} + */Chartist.getSeriesOption = function(series,options,key){if(series.name && options.series && options.series[series.name]){var seriesOptions=options.series[series.name];return seriesOptions.hasOwnProperty(key)?seriesOptions[key]:options[key];}else {return options[key];}}; /** + * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches + * + * @memberof Chartist.Core + * @param {Object} options Options set by user + * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart + * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events + * @return {Object} The consolidated options object from the defaults, base and matching responsive options + */Chartist.optionsProvider = function(options,responsiveOptions,eventEmitter){var baseOptions=Chartist.extend({},options),currentOptions,mediaQueryListeners=[],i;function updateCurrentOptions(mediaEvent){var previousOptions=currentOptions;currentOptions = Chartist.extend({},baseOptions);if(responsiveOptions){for(i = 0;i < responsiveOptions.length;i++) {var mql=window.matchMedia(responsiveOptions[i][0]);if(mql.matches){currentOptions = Chartist.extend(currentOptions,responsiveOptions[i][1]);}}}if(eventEmitter && mediaEvent){eventEmitter.emit('optionsChanged',{previousOptions:previousOptions,currentOptions:currentOptions});}}function removeMediaQueryListeners(){mediaQueryListeners.forEach(function(mql){mql.removeListener(updateCurrentOptions);});}if(!window.matchMedia){throw 'window.matchMedia not found! Make sure you\'re using a polyfill.';}else if(responsiveOptions){for(i = 0;i < responsiveOptions.length;i++) {var mql=window.matchMedia(responsiveOptions[i][0]);mql.addListener(updateCurrentOptions);mediaQueryListeners.push(mql);}} // Execute initially without an event argument so we get the correct options + updateCurrentOptions();return {removeMediaQueryListeners:removeMediaQueryListeners,getCurrentOptions:function getCurrentOptions(){return Chartist.extend({},currentOptions);}};}; /** + * Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates + * valueData property describing the segment. + * + * With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any + * points with undefined values are discarded. + * + * **Options** + * The following options are used to determine how segments are formed + * ```javascript + * var options = { + * // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment. + * fillHoles: false, + * // If increasingX is true, the coordinates in all segments have strictly increasing x-values. + * increasingX: false + * }; + * ``` + * + * @memberof Chartist.Core + * @param {Array} pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn] + * @param {Array} values List of associated point values in the form [v1, v2 .. vn] + * @param {Object} options Options set by user + * @return {Array} List of segments, each containing a pathCoordinates and valueData property. + */Chartist.splitIntoSegments = function(pathCoordinates,valueData,options){var defaultOptions={increasingX:false,fillHoles:false};options = Chartist.extend({},defaultOptions,options);var segments=[];var hole=true;for(var i=0;i < pathCoordinates.length;i += 2) { // If this value is a "hole" we set the hole flag + if(valueData[i / 2].value === undefined){if(!options.fillHoles){hole = true;}}else {if(options.increasingX && i >= 2 && pathCoordinates[i] <= pathCoordinates[i - 2]){ // X is not increasing, so we need to make sure we start a new segment + hole = true;} // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment + if(hole){segments.push({pathCoordinates:[],valueData:[]}); // As we have a valid value now, we are not in a "hole" anymore + hole = false;} // Add to the segment pathCoordinates and valueData + segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i],pathCoordinates[i + 1]);segments[segments.length - 1].valueData.push(valueData[i / 2]);}}return segments;};})(window,document,Chartist);; /** + * Chartist path interpolation functions. + * + * @module Chartist.Interpolation + */ /* global Chartist */(function(window,document,Chartist){'use strict';Chartist.Interpolation = {}; /** + * This interpolation function does not smooth the path and the result is only containing lines and no curves. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.none({ + * fillHoles: false + * }) + * }); + * + * + * @memberof Chartist.Interpolation + * @return {Function} + */Chartist.Interpolation.none = function(options){var defaultOptions={fillHoles:false};options = Chartist.extend({},defaultOptions,options);return function none(pathCoordinates,valueData){var path=new Chartist.Svg.Path();var hole=true;for(var i=0;i < pathCoordinates.length;i += 2) {var currX=pathCoordinates[i];var currY=pathCoordinates[i + 1];var currData=valueData[i / 2];if(currData.value !== undefined){if(hole){path.move(currX,currY,false,currData);}else {path.line(currX,currY,false,currData);}hole = false;}else if(!options.fillHoles){hole = true;}}return path;};}; /** + * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. + * + * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.simple({ + * divisor: 2, + * fillHoles: false + * }) + * }); + * + * + * @memberof Chartist.Interpolation + * @param {Object} options The options of the simple interpolation factory function. + * @return {Function} + */Chartist.Interpolation.simple = function(options){var defaultOptions={divisor:2,fillHoles:false};options = Chartist.extend({},defaultOptions,options);var d=1 / Math.max(1,options.divisor);return function simple(pathCoordinates,valueData){var path=new Chartist.Svg.Path();var prevX,prevY,prevData;for(var i=0;i < pathCoordinates.length;i += 2) {var currX=pathCoordinates[i];var currY=pathCoordinates[i + 1];var length=(currX - prevX) * d;var currData=valueData[i / 2];if(currData.value !== undefined){if(prevData === undefined){path.move(currX,currY,false,currData);}else {path.curve(prevX + length,prevY,currX - length,currY,currX,currY,false,currData);}prevX = currX;prevY = currY;prevData = currData;}else if(!options.fillHoles){prevX = currX = prevData = undefined;}}return path;};}; /** + * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. + * + * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.cardinal({ + * tension: 1, + * fillHoles: false + * }) + * }); + * + * @memberof Chartist.Interpolation + * @param {Object} options The options of the cardinal factory function. + * @return {Function} + */Chartist.Interpolation.cardinal = function(options){var defaultOptions={tension:1,fillHoles:false};options = Chartist.extend({},defaultOptions,options);var t=Math.min(1,Math.max(0,options.tension)),c=1 - t;return function cardinal(pathCoordinates,valueData){ // First we try to split the coordinates into segments + // This is necessary to treat "holes" in line charts + var segments=Chartist.splitIntoSegments(pathCoordinates,valueData,{fillHoles:options.fillHoles});if(!segments.length){ // If there were no segments return 'Chartist.Interpolation.none' + return Chartist.Interpolation.none()([]);}else if(segments.length > 1){ // If the split resulted in more that one segment we need to interpolate each segment individually and join them + // afterwards together into a single path. + var paths=[]; // For each segment we will recurse the cardinal function + segments.forEach(function(segment){paths.push(cardinal(segment.pathCoordinates,segment.valueData));}); // Join the segment path data into a single path and return + return Chartist.Svg.Path.join(paths);}else { // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first + // segment + pathCoordinates = segments[0].pathCoordinates;valueData = segments[0].valueData; // If less than two points we need to fallback to no smoothing + if(pathCoordinates.length <= 4){return Chartist.Interpolation.none()(pathCoordinates,valueData);}var path=new Chartist.Svg.Path().move(pathCoordinates[0],pathCoordinates[1],false,valueData[0]),z;for(var i=0,iLen=pathCoordinates.length;iLen - 2 * !z > i;i += 2) {var p=[{x:+pathCoordinates[i - 2],y:+pathCoordinates[i - 1]},{x:+pathCoordinates[i],y:+pathCoordinates[i + 1]},{x:+pathCoordinates[i + 2],y:+pathCoordinates[i + 3]},{x:+pathCoordinates[i + 4],y:+pathCoordinates[i + 5]}];if(z){if(!i){p[0] = {x:+pathCoordinates[iLen - 2],y:+pathCoordinates[iLen - 1]};}else if(iLen - 4 === i){p[3] = {x:+pathCoordinates[0],y:+pathCoordinates[1]};}else if(iLen - 2 === i){p[2] = {x:+pathCoordinates[0],y:+pathCoordinates[1]};p[3] = {x:+pathCoordinates[2],y:+pathCoordinates[3]};}}else {if(iLen - 4 === i){p[3] = p[2];}else if(!i){p[0] = {x:+pathCoordinates[i],y:+pathCoordinates[i + 1]};}}path.curve(t * (-p[0].x + 6 * p[1].x + p[2].x) / 6 + c * p[2].x,t * (-p[0].y + 6 * p[1].y + p[2].y) / 6 + c * p[2].y,t * (p[1].x + 6 * p[2].x - p[3].x) / 6 + c * p[2].x,t * (p[1].y + 6 * p[2].y - p[3].y) / 6 + c * p[2].y,p[2].x,p[2].y,false,valueData[(i + 2) / 2]);}return path;}};}; /** + * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points. + * + * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. + * + * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.monotoneCubic({ + * fillHoles: false + * }) + * }); + * + * @memberof Chartist.Interpolation + * @param {Object} options The options of the monotoneCubic factory function. + * @return {Function} + */Chartist.Interpolation.monotoneCubic = function(options){var defaultOptions={fillHoles:false};options = Chartist.extend({},defaultOptions,options);return function monotoneCubic(pathCoordinates,valueData){ // First we try to split the coordinates into segments + // This is necessary to treat "holes" in line charts + var segments=Chartist.splitIntoSegments(pathCoordinates,valueData,{fillHoles:options.fillHoles,increasingX:true});if(!segments.length){ // If there were no segments return 'Chartist.Interpolation.none' + return Chartist.Interpolation.none()([]);}else if(segments.length > 1){ // If the split resulted in more that one segment we need to interpolate each segment individually and join them + // afterwards together into a single path. + var paths=[]; // For each segment we will recurse the monotoneCubic fn function + segments.forEach(function(segment){paths.push(monotoneCubic(segment.pathCoordinates,segment.valueData));}); // Join the segment path data into a single path and return + return Chartist.Svg.Path.join(paths);}else { // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first + // segment + pathCoordinates = segments[0].pathCoordinates;valueData = segments[0].valueData; // If less than three points we need to fallback to no smoothing + if(pathCoordinates.length <= 4){return Chartist.Interpolation.none()(pathCoordinates,valueData);}var xs=[],ys=[],i,n=pathCoordinates.length / 2,ms=[],ds=[],dys=[],dxs=[],path; // Populate x and y coordinates into separate arrays, for readability + for(i = 0;i < n;i++) {xs[i] = pathCoordinates[i * 2];ys[i] = pathCoordinates[i * 2 + 1];} // Calculate deltas and derivative + for(i = 0;i < n - 1;i++) {dys[i] = ys[i + 1] - ys[i];dxs[i] = xs[i + 1] - xs[i];ds[i] = dys[i] / dxs[i];} // Determine desired slope (m) at each point using Fritsch-Carlson method + // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation + ms[0] = ds[0];ms[n - 1] = ds[n - 2];for(i = 1;i < n - 1;i++) {if(ds[i] === 0 || ds[i - 1] === 0 || ds[i - 1] > 0 !== ds[i] > 0){ms[i] = 0;}else {ms[i] = 3 * (dxs[i - 1] + dxs[i]) / ((2 * dxs[i] + dxs[i - 1]) / ds[i - 1] + (dxs[i] + 2 * dxs[i - 1]) / ds[i]);if(!isFinite(ms[i])){ms[i] = 0;}}} // Now build a path from the slopes + path = new Chartist.Svg.Path().move(xs[0],ys[0],false,valueData[0]);for(i = 0;i < n - 1;i++) {path.curve( // First control point + xs[i] + dxs[i] / 3,ys[i] + ms[i] * dxs[i] / 3, // Second control point + xs[i + 1] - dxs[i] / 3,ys[i + 1] - ms[i + 1] * dxs[i] / 3, // End point + xs[i + 1],ys[i + 1],false,valueData[i + 1]);}return path;}};}; /** + * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled. + * + * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`. + * + * @example + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [[1, 2, 8, 1, 7]] + * }, { + * lineSmooth: Chartist.Interpolation.step({ + * postpone: true, + * fillHoles: false + * }) + * }); + * + * @memberof Chartist.Interpolation + * @param options + * @returns {Function} + */Chartist.Interpolation.step = function(options){var defaultOptions={postpone:true,fillHoles:false};options = Chartist.extend({},defaultOptions,options);return function step(pathCoordinates,valueData){var path=new Chartist.Svg.Path();var prevX,prevY,prevData;for(var i=0;i < pathCoordinates.length;i += 2) {var currX=pathCoordinates[i];var currY=pathCoordinates[i + 1];var currData=valueData[i / 2]; // If the current point is also not a hole we can draw the step lines + if(currData.value !== undefined){if(prevData === undefined){path.move(currX,currY,false,currData);}else {if(options.postpone){ // If postponed we should draw the step line with the value of the previous value + path.line(currX,prevY,false,prevData);}else { // If not postponed we should draw the step line with the value of the current value + path.line(prevX,currY,false,currData);} // Line to the actual point (this should only be a Y-Axis movement + path.line(currX,currY,false,currData);}prevX = currX;prevY = currY;prevData = currData;}else if(!options.fillHoles){prevX = prevY = prevData = undefined;}}return path;};};})(window,document,Chartist);; /** + * A very basic event module that helps to generate and catch events. + * + * @module Chartist.Event + */ /* global Chartist */(function(window,document,Chartist){'use strict';Chartist.EventEmitter = function(){var handlers=[]; /** + * Add an event handler for a specific event + * + * @memberof Chartist.Event + * @param {String} event The event name + * @param {Function} handler A event handler function + */function addEventHandler(event,handler){handlers[event] = handlers[event] || [];handlers[event].push(handler);} /** + * Remove an event handler of a specific event name or remove all event handlers for a specific event. + * + * @memberof Chartist.Event + * @param {String} event The event name where a specific or all handlers should be removed + * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. + */function removeEventHandler(event,handler){ // Only do something if there are event handlers with this name existing + if(handlers[event]){ // If handler is set we will look for a specific handler and only remove this + if(handler){handlers[event].splice(handlers[event].indexOf(handler),1);if(handlers[event].length === 0){delete handlers[event];}}else { // If no handler is specified we remove all handlers for this event + delete handlers[event];}}} /** + * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. + * + * @memberof Chartist.Event + * @param {String} event The event name that should be triggered + * @param {*} data Arbitrary data that will be passed to the event handler callback functions + */function emit(event,data){ // Only do something if there are event handlers with this name existing + if(handlers[event]){handlers[event].forEach(function(handler){handler(data);});} // Emit event to star event handlers + if(handlers['*']){handlers['*'].forEach(function(starHandler){starHandler(event,data);});}}return {addEventHandler:addEventHandler,removeEventHandler:removeEventHandler,emit:emit};};})(window,document,Chartist);; /** + * This module provides some basic prototype inheritance utilities. + * + * @module Chartist.Class + */ /* global Chartist */(function(window,document,Chartist){'use strict';function listToArray(list){var arr=[];if(list.length){for(var i=0;i < list.length;i++) {arr.push(list[i]);}}return arr;} /** + * Method to extend from current prototype. + * + * @memberof Chartist.Class + * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. + * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. + * @return {Function} Constructor function of the new class + * + * @example + * var Fruit = Class.extend({ + * color: undefined, + * sugar: undefined, + * + * constructor: function(color, sugar) { + * this.color = color; + * this.sugar = sugar; * }, - * // The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. - * startAngle: 0, - * // An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. - * total: undefined, - * // If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. - * donut: false, - * // Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. - * donutWidth: 60, - * // If a label should be shown or not - * showLabel: true, - * // Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. - * labelOffset: 0, - * // An interpolation function for the label value - * labelInterpolationFnc: function(value, index) {return value;}, - * // Label direction can be 'neutral', 'explode' or 'implode'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. - * labelDirection: 'neutral' - * }; - * - * @example - * // Simple pie chart example with four series - * new Chartist.Pie('.ct-chart', { - * series: [10, 2, 4, 3] - * }); * - * @example - * // Drawing a donut chart - * new Chartist.Pie('.ct-chart', { - * series: [10, 2, 4, 3] - * }, { - * donut: true - * }); - * - * @example - * // Using donut, startAngle and total to draw a gauge chart - * new Chartist.Pie('.ct-chart', { - * series: [20, 10, 30, 40] - * }, { - * donut: true, - * donutWidth: 20, - * startAngle: 270, - * total: 200 + * eat: function() { + * this.sugar = 0; + * return this; + * } * }); + * + * var Banana = Fruit.extend({ + * length: undefined, * - * @example - * // Drawing a pie chart with padding and labels that are outside the pie - * new Chartist.Pie('.ct-chart', { - * series: [20, 10, 30, 40] - * }, { - * chartPadding: 30, - * labelOffset: 50, - * labelDirection: 'explode' + * constructor: function(length, sugar) { + * Banana.super.constructor.call(this, 'Yellow', sugar); + * this.length = length; + * } * }); - */ - function Pie(query, data, options, responsiveOptions) { - Chartist.Pie['super'].constructor.call(this, query, data, Chartist.extend(Chartist.extend({}, defaultOptions), options), responsiveOptions); - } - - // Creating pie chart type in Chartist namespace - Chartist.Pie = Chartist.Base.extend({ - constructor: Pie, - createChart: createChart, - determineAnchorPosition: determineAnchorPosition - }); - })(window, document, Chartist); - - return Chartist; - }); + * + * var banana = new Banana(20, 40); + * console.log('banana instanceof Fruit', banana instanceof Fruit); + * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); + * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); + * console.log(banana.sugar); + * console.log(banana.eat().sugar); + * console.log(banana.color); + */function extend(properties,superProtoOverride){var superProto=superProtoOverride || this.prototype || Chartist.Class;var proto=Object.create(superProto);Chartist.Class.cloneDefinitions(proto,properties);var constr=function constr(){var fn=proto.constructor || function(){},instance; // If this is linked to the Chartist namespace the constructor was not called with new + // To provide a fallback we will instantiate here and return the instance + instance = this === Chartist?Object.create(proto):this;fn.apply(instance,Array.prototype.slice.call(arguments,0)); // If this constructor was not called with new we need to return the instance + // This will not harm when the constructor has been called with new as the returned value is ignored + return instance;};constr.prototype = proto;constr['super'] = superProto;constr.extend = this.extend;return constr;} // Variable argument list clones args > 0 into args[0] and retruns modified args[0] + function cloneDefinitions(){var args=listToArray(arguments);var target=args[0];args.splice(1,args.length - 1).forEach(function(source){Object.getOwnPropertyNames(source).forEach(function(propName){ // If this property already exist in target we delete it first + delete target[propName]; // Define the property with the descriptor from source + Object.defineProperty(target,propName,Object.getOwnPropertyDescriptor(source,propName));});});return target;}Chartist.Class = {extend:extend,cloneDefinitions:cloneDefinitions};})(window,document,Chartist);; /** + * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. + * + * @module Chartist.Base + */ /* global Chartist */(function(window,document,Chartist){'use strict'; // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. + // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not + // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. + // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html + // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj + // The problem is with the label offsets that can't be converted into percentage and affecting the chart container + /** + * Updates the chart which currently does a full reconstruction of the SVG DOM + * + * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart. + * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart. + * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base + * @memberof Chartist.Base + */function update(data,options,override){if(data){this.data = data; // Event for data transformation that allows to manipulate the data before it gets rendered in the charts + this.eventEmitter.emit('data',{type:'update',data:this.data});}if(options){this.options = Chartist.extend({},override?this.options:this.defaultOptions,options); // If chartist was not initialized yet, we just set the options and leave the rest to the initialization + // Otherwise we re-create the optionsProvider at this point + if(!this.initializeTimeoutId){this.optionsProvider.removeMediaQueryListeners();this.optionsProvider = Chartist.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter);}} // Only re-created the chart if it has been initialized yet + if(!this.initializeTimeoutId){this.createChart(this.optionsProvider.getCurrentOptions());} // Return a reference to the chart object to chain up calls + return this;} /** + * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. + * + * @memberof Chartist.Base + */function detach(){ // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore + // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout + if(!this.initializeTimeoutId){window.removeEventListener('resize',this.resizeListener);this.optionsProvider.removeMediaQueryListeners();}else {window.clearTimeout(this.initializeTimeoutId);}return this;} /** + * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. + * + * @memberof Chartist.Base + * @param {String} event Name of the event. Check the examples for supported events. + * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. + */function on(event,handler){this.eventEmitter.addEventHandler(event,handler);return this;} /** + * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. + * + * @memberof Chartist.Base + * @param {String} event Name of the event for which a handler should be removed + * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. + */function off(event,handler){this.eventEmitter.removeEventHandler(event,handler);return this;}function initialize(){ // Add window resize listener that re-creates the chart + window.addEventListener('resize',this.resizeListener); // Obtain current options based on matching media queries (if responsive options are given) + // This will also register a listener that is re-creating the chart based on media changes + this.optionsProvider = Chartist.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter); // Register options change listener that will trigger a chart update + this.eventEmitter.addEventHandler('optionsChanged',(function(){this.update();}).bind(this)); // Before the first chart creation we need to register us with all plugins that are configured + // Initialize all relevant plugins with our chart object and the plugin options specified in the config + if(this.options.plugins){this.options.plugins.forEach((function(plugin){if(plugin instanceof Array){plugin[0](this,plugin[1]);}else {plugin(this);}}).bind(this));} // Event for data transformation that allows to manipulate the data before it gets rendered in the charts + this.eventEmitter.emit('data',{type:'initial',data:this.data}); // Create the first chart + this.createChart(this.optionsProvider.getCurrentOptions()); // As chart is initialized from the event loop now we can reset our timeout reference + // This is important if the chart gets initialized on the same element twice + this.initializeTimeoutId = undefined;} /** + * Constructor of chart base class. + * + * @param query + * @param data + * @param defaultOptions + * @param options + * @param responsiveOptions + * @constructor + */function Base(query,data,defaultOptions,options,responsiveOptions){this.container = Chartist.querySelector(query);this.data = data;this.defaultOptions = defaultOptions;this.options = options;this.responsiveOptions = responsiveOptions;this.eventEmitter = Chartist.EventEmitter();this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');this.resizeListener = (function resizeListener(){this.update();}).bind(this);if(this.container){ // If chartist was already initialized in this container we are detaching all event listeners first + if(this.container.__chartist__){this.container.__chartist__.detach();}this.container.__chartist__ = this;} // Using event loop for first draw to make it possible to register event listeners in the same call stack where + // the chart was created. + this.initializeTimeoutId = setTimeout(initialize.bind(this),0);} // Creating the chart base class + Chartist.Base = Chartist.Class.extend({constructor:Base,optionsProvider:undefined,container:undefined,svg:undefined,eventEmitter:undefined,createChart:function createChart(){throw new Error('Base chart type can\'t be instantiated!');},update:update,detach:detach,on:on,off:off,version:Chartist.version,supportsForeignObject:false});})(window,document,Chartist);; /** + * Chartist SVG module for simple SVG DOM abstraction + * + * @module Chartist.Svg + */ /* global Chartist */(function(window,document,Chartist){'use strict'; /** + * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. + * + * @memberof Chartist.Svg + * @constructor + * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg + * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. + * @param {String} className This class or class list will be added to the SVG element + * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child + * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element + */function Svg(name,attributes,className,parent,insertFirst){ // If Svg is getting called with an SVG element we just return the wrapper + if(name instanceof Element){this._node = name;}else {this._node = document.createElementNS(Chartist.namespaces.svg,name); // If this is an SVG element created then custom namespace + if(name === 'svg'){this.attr({'xmlns:ct':Chartist.namespaces.ct});}}if(attributes){this.attr(attributes);}if(className){this.addClass(className);}if(parent){if(insertFirst && parent._node.firstChild){parent._node.insertBefore(this._node,parent._node.firstChild);}else {parent._node.appendChild(this._node);}}} /** + * Set attributes on the current SVG element of the wrapper you're currently working on. + * + * @memberof Chartist.Svg + * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value. + * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object. + * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function. + */function attr(attributes,ns){if(typeof attributes === 'string'){if(ns){return this._node.getAttributeNS(ns,attributes);}else {return this._node.getAttribute(attributes);}}Object.keys(attributes).forEach((function(key){ // If the attribute value is undefined we can skip this one + if(attributes[key] === undefined){return;}if(key.indexOf(':') !== -1){var namespacedAttribute=key.split(':');this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]],key,attributes[key]);}else {this._node.setAttribute(key,attributes[key]);}}).bind(this));return this;} /** + * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. + * + * @memberof Chartist.Svg + * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper + * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. + * @param {String} [className] This class or class list will be added to the SVG element + * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element + * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data + */function elem(name,attributes,className,insertFirst){return new Chartist.Svg(name,attributes,className,this,insertFirst);} /** + * Returns the parent Chartist.SVG wrapper object + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null. + */function parent(){return this._node.parentNode instanceof SVGElement?new Chartist.Svg(this._node.parentNode):null;} /** + * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element + */function root(){var node=this._node;while(node.nodeName !== 'svg') {node = node.parentNode;}return new Chartist.Svg(node);} /** + * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. + * + * @memberof Chartist.Svg + * @param {String} selector A CSS selector that is used to query for child SVG elements + * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found + */function querySelector(selector){var foundNode=this._node.querySelector(selector);return foundNode?new Chartist.Svg(foundNode):null;} /** + * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. + * + * @memberof Chartist.Svg + * @param {String} selector A CSS selector that is used to query for child SVG elements + * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found + */function querySelectorAll(selector){var foundNodes=this._node.querySelectorAll(selector);return foundNodes.length?new Chartist.Svg.List(foundNodes):null;} /** + * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. + * + * @memberof Chartist.Svg + * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject + * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. + * @param {String} [className] This class or class list will be added to the SVG element + * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child + * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element + */function foreignObject(content,attributes,className,insertFirst){ // If content is string then we convert it to DOM + // TODO: Handle case where content is not a string nor a DOM Node + if(typeof content === 'string'){var container=document.createElement('div');container.innerHTML = content;content = container.firstChild;} // Adding namespace to content element + content.setAttribute('xmlns',Chartist.namespaces.xmlns); // Creating the foreignObject without required extension attribute (as described here + // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) + var fnObj=this.elem('foreignObject',attributes,className,insertFirst); // Add content to foreignObjectElement + fnObj._node.appendChild(content);return fnObj;} /** + * This method adds a new text element to the current Chartist.Svg wrapper. + * + * @memberof Chartist.Svg + * @param {String} t The text that should be added to the text element that is created + * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element + */function text(t){this._node.appendChild(document.createTextNode(t));return this;} /** + * This method will clear all child nodes of the current wrapper object. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The same wrapper object that got emptied + */function empty(){while(this._node.firstChild) {this._node.removeChild(this._node.firstChild);}return this;} /** + * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The parent wrapper object of the element that got removed + */function remove(){this._node.parentNode.removeChild(this._node);return this.parent();} /** + * This method will replace the element with a new element that can be created outside of the current DOM. + * + * @memberof Chartist.Svg + * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object + * @return {Chartist.Svg} The wrapper of the new element + */function replace(newElement){this._node.parentNode.replaceChild(newElement._node,this._node);return newElement;} /** + * This method will append an element to the current element as a child. + * + * @memberof Chartist.Svg + * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child + * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child + * @return {Chartist.Svg} The wrapper of the appended object + */function append(element,insertFirst){if(insertFirst && this._node.firstChild){this._node.insertBefore(element._node,this._node.firstChild);}else {this._node.appendChild(element._node);}return this;} /** + * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. + * + * @memberof Chartist.Svg + * @return {Array} A list of classes or an empty array if there are no classes on the current element + */function classes(){return this._node.getAttribute('class')?this._node.getAttribute('class').trim().split(/\s+/):[];} /** + * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. + * + * @memberof Chartist.Svg + * @param {String} names A white space separated list of class names + * @return {Chartist.Svg} The wrapper of the current element + */function addClass(names){this._node.setAttribute('class',this.classes(this._node).concat(names.trim().split(/\s+/)).filter(function(elem,pos,self){return self.indexOf(elem) === pos;}).join(' '));return this;} /** + * Removes one or a space separated list of classes from the current element. + * + * @memberof Chartist.Svg + * @param {String} names A white space separated list of class names + * @return {Chartist.Svg} The wrapper of the current element + */function removeClass(names){var removedClasses=names.trim().split(/\s+/);this._node.setAttribute('class',this.classes(this._node).filter(function(name){return removedClasses.indexOf(name) === -1;}).join(' '));return this;} /** + * Removes all classes from the current element. + * + * @memberof Chartist.Svg + * @return {Chartist.Svg} The wrapper of the current element + */function removeAllClasses(){this._node.setAttribute('class','');return this;} /** + * Get element height using `getBoundingClientRect` + * + * @memberof Chartist.Svg + * @return {Number} The elements height in pixels + */function height(){return this._node.getBoundingClientRect().height;} /** + * Get element width using `getBoundingClientRect` + * + * @memberof Chartist.Core + * @return {Number} The elements width in pixels + */function width(){return this._node.getBoundingClientRect().width;} /** + * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve. + * **An animations object could look like this:** + * ```javascript + * element.animate({ + * opacity: { + * dur: 1000, + * from: 0, + * to: 1 + * }, + * x1: { + * dur: '1000ms', + * from: 100, + * to: 200, + * easing: 'easeOutQuart' + * }, + * y1: { + * dur: '2s', + * from: 0, + * to: 100 + * } + * }); + * ``` + * **Automatic unit conversion** + * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds. + * **Guided mode** + * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it. + * If guided mode is enabled the following behavior is added: + * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation + * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation) + * - The animate element will be forced to use `fill="freeze"` + * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately. + * - After the animation the element attribute value will be set to the `to` value of the animation + * - The animate element is deleted from the DOM + * + * @memberof Chartist.Svg + * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode. + * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated. + * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends. + * @return {Chartist.Svg} The current element where the animation was added + */function animate(animations,guided,eventEmitter){if(guided === undefined){guided = true;}Object.keys(animations).forEach((function createAnimateForAttributes(attribute){function createAnimate(animationDefinition,guided){var attributeProperties={},animate,timeout,easing; // Check if an easing is specified in the definition object and delete it from the object as it will not + // be part of the animate element attributes. + if(animationDefinition.easing){ // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object + easing = animationDefinition.easing instanceof Array?animationDefinition.easing:Chartist.Svg.Easing[animationDefinition.easing];delete animationDefinition.easing;} // If numeric dur or begin was provided we assume milli seconds + animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin,'ms');animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur,'ms');if(easing){animationDefinition.calcMode = 'spline';animationDefinition.keySplines = easing.join(' ');animationDefinition.keyTimes = '0;1';} // Adding "fill: freeze" if we are in guided mode and set initial attribute values + if(guided){animationDefinition.fill = 'freeze'; // Animated property on our element should already be set to the animation from value in guided mode + attributeProperties[attribute] = animationDefinition.from;this.attr(attributeProperties); // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin + // which needs to be in ms aside + timeout = Chartist.quantity(animationDefinition.begin || 0).value;animationDefinition.begin = 'indefinite';}animate = this.elem('animate',Chartist.extend({attributeName:attribute},animationDefinition));if(guided){ // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout + setTimeout((function(){ // If beginElement fails we set the animated attribute to the end position and remove the animate element + // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in + // the browser. (Currently FF 34 does not support animate elements in foreignObjects) + try{animate._node.beginElement();}catch(err) { // Set animated attribute to current animated value + attributeProperties[attribute] = animationDefinition.to;this.attr(attributeProperties); // Remove the animate element as it's no longer required + animate.remove();}}).bind(this),timeout);}if(eventEmitter){animate._node.addEventListener('beginEvent',(function handleBeginEvent(){eventEmitter.emit('animationBegin',{element:this,animate:animate._node,params:animationDefinition});}).bind(this));}animate._node.addEventListener('endEvent',(function handleEndEvent(){if(eventEmitter){eventEmitter.emit('animationEnd',{element:this,animate:animate._node,params:animationDefinition});}if(guided){ // Set animated attribute to current animated value + attributeProperties[attribute] = animationDefinition.to;this.attr(attributeProperties); // Remove the animate element as it's no longer required + animate.remove();}}).bind(this));} // If current attribute is an array of definition objects we create an animate for each and disable guided mode + if(animations[attribute] instanceof Array){animations[attribute].forEach((function(animationDefinition){createAnimate.bind(this)(animationDefinition,false);}).bind(this));}else {createAnimate.bind(this)(animations[attribute],guided);}}).bind(this));return this;}Chartist.Svg = Chartist.Class.extend({constructor:Svg,attr:attr,elem:elem,parent:parent,root:root,querySelector:querySelector,querySelectorAll:querySelectorAll,foreignObject:foreignObject,text:text,empty:empty,remove:remove,replace:replace,append:append,classes:classes,addClass:addClass,removeClass:removeClass,removeAllClasses:removeAllClasses,height:height,width:width,animate:animate}); /** + * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. + * + * @memberof Chartist.Svg + * @param {String} feature The SVG 1.1 feature that should be checked for support. + * @return {Boolean} True of false if the feature is supported or not + */Chartist.Svg.isSupported = function(feature){return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature,'1.1');}; /** + * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions. + * + * @memberof Chartist.Svg + */var easingCubicBeziers={easeInSine:[0.47,0,0.745,0.715],easeOutSine:[0.39,0.575,0.565,1],easeInOutSine:[0.445,0.05,0.55,0.95],easeInQuad:[0.55,0.085,0.68,0.53],easeOutQuad:[0.25,0.46,0.45,0.94],easeInOutQuad:[0.455,0.03,0.515,0.955],easeInCubic:[0.55,0.055,0.675,0.19],easeOutCubic:[0.215,0.61,0.355,1],easeInOutCubic:[0.645,0.045,0.355,1],easeInQuart:[0.895,0.03,0.685,0.22],easeOutQuart:[0.165,0.84,0.44,1],easeInOutQuart:[0.77,0,0.175,1],easeInQuint:[0.755,0.05,0.855,0.06],easeOutQuint:[0.23,1,0.32,1],easeInOutQuint:[0.86,0,0.07,1],easeInExpo:[0.95,0.05,0.795,0.035],easeOutExpo:[0.19,1,0.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[0.6,0.04,0.98,0.335],easeOutCirc:[0.075,0.82,0.165,1],easeInOutCirc:[0.785,0.135,0.15,0.86],easeInBack:[0.6,-0.28,0.735,0.045],easeOutBack:[0.175,0.885,0.32,1.275],easeInOutBack:[0.68,-0.55,0.265,1.55]};Chartist.Svg.Easing = easingCubicBeziers; /** + * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements. + * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`. + * + * @memberof Chartist.Svg + * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll) + * @constructor + */function SvgList(nodeList){var list=this;this.svgElements = [];for(var i=0;i < nodeList.length;i++) {this.svgElements.push(new Chartist.Svg(nodeList[i]));} // Add delegation methods for Chartist.Svg + Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty){return ['constructor','parent','querySelector','querySelectorAll','replace','append','classes','height','width'].indexOf(prototypeProperty) === -1;}).forEach(function(prototypeProperty){list[prototypeProperty] = function(){var args=Array.prototype.slice.call(arguments,0);list.svgElements.forEach(function(element){Chartist.Svg.prototype[prototypeProperty].apply(element,args);});return list;};});}Chartist.Svg.List = Chartist.Class.extend({constructor:SvgList});})(window,document,Chartist);; /** + * Chartist SVG path module for SVG path description creation and modification. + * + * @module Chartist.Svg.Path + */ /* global Chartist */(function(window,document,Chartist){'use strict'; /** + * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported. + * + * @memberof Chartist.Svg.Path + * @type {Object} + */var elementDescriptions={m:['x','y'],l:['x','y'],c:['x1','y1','x2','y2','x','y'],a:['rx','ry','xAr','lAf','sf','x','y']}; /** + * Default options for newly created SVG path objects. + * + * @memberof Chartist.Svg.Path + * @type {Object} + */var defaultOptions={ // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed. + accuracy:3};function element(command,params,pathElements,pos,relative,data){var pathElement=Chartist.extend({command:relative?command.toLowerCase():command.toUpperCase()},params,data?{data:data}:{});pathElements.splice(pos,0,pathElement);}function forEachParam(pathElements,cb){pathElements.forEach(function(pathElement,pathElementIndex){elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName,paramIndex){cb(pathElement,paramName,pathElementIndex,paramIndex,pathElements);});});} /** + * Used to construct a new path object. + * + * @memberof Chartist.Svg.Path + * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end) + * @param {Object} options Options object that overrides the default objects. See default options for more details. + * @constructor + */function SvgPath(close,options){this.pathElements = [];this.pos = 0;this.close = close;this.options = Chartist.extend({},defaultOptions,options);} /** + * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor. + * + * @memberof Chartist.Svg.Path + * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array. + * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned. + */function position(pos){if(pos !== undefined){this.pos = Math.max(0,Math.min(this.pathElements.length,pos));return this;}else {return this.pos;}} /** + * Removes elements from the path starting at the current position. + * + * @memberof Chartist.Svg.Path + * @param {Number} count Number of path elements that should be removed from the current position. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function remove(count){this.pathElements.splice(this.pos,count);return this;} /** + * Use this function to add a new move SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The x coordinate for the move element. + * @param {Number} y The y coordinate for the move element. + * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function move(x,y,relative,data){element('M',{x:+x,y:+y},this.pathElements,this.pos++,relative,data);return this;} /** + * Use this function to add a new line SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The x coordinate for the line element. + * @param {Number} y The y coordinate for the line element. + * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function line(x,y,relative,data){element('L',{x:+x,y:+y},this.pathElements,this.pos++,relative,data);return this;} /** + * Use this function to add a new curve SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} x1 The x coordinate for the first control point of the bezier curve. + * @param {Number} y1 The y coordinate for the first control point of the bezier curve. + * @param {Number} x2 The x coordinate for the second control point of the bezier curve. + * @param {Number} y2 The y coordinate for the second control point of the bezier curve. + * @param {Number} x The x coordinate for the target point of the curve element. + * @param {Number} y The y coordinate for the target point of the curve element. + * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function curve(x1,y1,x2,y2,x,y,relative,data){element('C',{x1:+x1,y1:+y1,x2:+x2,y2:+y2,x:+x,y:+y},this.pathElements,this.pos++,relative,data);return this;} /** + * Use this function to add a new non-bezier curve SVG path element. + * + * @memberof Chartist.Svg.Path + * @param {Number} rx The radius to be used for the x-axis of the arc. + * @param {Number} ry The radius to be used for the y-axis of the arc. + * @param {Number} xAr Defines the orientation of the arc + * @param {Number} lAf Large arc flag + * @param {Number} sf Sweep flag + * @param {Number} x The x coordinate for the target point of the curve element. + * @param {Number} y The y coordinate for the target point of the curve element. + * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) + * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function arc(rx,ry,xAr,lAf,sf,x,y,relative,data){element('A',{rx:+rx,ry:+ry,xAr:+xAr,lAf:+lAf,sf:+sf,x:+x,y:+y},this.pathElements,this.pos++,relative,data);return this;} /** + * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object. + * + * @memberof Chartist.Svg.Path + * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function parse(path){ // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']] + var chunks=path.replace(/([A-Za-z])([0-9])/g,'$1 $2').replace(/([0-9])([A-Za-z])/g,'$1 $2').split(/[\s,]+/).reduce(function(result,element){if(element.match(/[A-Za-z]/)){result.push([]);}result[result.length - 1].push(element);return result;},[]); // If this is a closed path we remove the Z at the end because this is determined by the close option + if(chunks[chunks.length - 1][0].toUpperCase() === 'Z'){chunks.pop();} // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters + // For example {command: 'M', x: '10', y: '10'} + var elements=chunks.map(function(chunk){var command=chunk.shift(),description=elementDescriptions[command.toLowerCase()];return Chartist.extend({command:command},description.reduce(function(result,paramName,index){result[paramName] = +chunk[index];return result;},{}));}); // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position + var spliceArgs=[this.pos,0];Array.prototype.push.apply(spliceArgs,elements);Array.prototype.splice.apply(this.pathElements,spliceArgs); // Increase the internal position by the element count + this.pos += elements.length;return this;} /** + * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string. + * + * @memberof Chartist.Svg.Path + * @return {String} + */function stringify(){var accuracyMultiplier=Math.pow(10,this.options.accuracy);return this.pathElements.reduce((function(path,pathElement){var params=elementDescriptions[pathElement.command.toLowerCase()].map((function(paramName){return this.options.accuracy?Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier:pathElement[paramName];}).bind(this));return path + pathElement.command + params.join(',');}).bind(this),'') + (this.close?'Z':'');} /** + * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements. + * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function scale(x,y){forEachParam(this.pathElements,function(pathElement,paramName){pathElement[paramName] *= paramName[0] === 'x'?x:y;});return this;} /** + * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate. + * + * @memberof Chartist.Svg.Path + * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements. + * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function translate(x,y){forEachParam(this.pathElements,function(pathElement,paramName){pathElement[paramName] += paramName[0] === 'x'?x:y;});return this;} /** + * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path. + * The method signature of the callback function looks like this: + * ```javascript + * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) + * ``` + * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate. + * + * @memberof Chartist.Svg.Path + * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description. + * @return {Chartist.Svg.Path} The current path object for easy call chaining. + */function transform(transformFnc){forEachParam(this.pathElements,function(pathElement,paramName,pathElementIndex,paramIndex,pathElements){var transformed=transformFnc(pathElement,paramName,pathElementIndex,paramIndex,pathElements);if(transformed || transformed === 0){pathElement[paramName] = transformed;}});return this;} /** + * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned. + * + * @memberof Chartist.Svg.Path + * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used. + * @return {Chartist.Svg.Path} + */function clone(close){var c=new Chartist.Svg.Path(close || this.close);c.pos = this.pos;c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement){return Chartist.extend({},pathElement);});c.options = Chartist.extend({},this.options);return c;} /** + * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings. + * + * @memberof Chartist.Svg.Path + * @param {String} command The command you'd like to use to split the path + * @return {Array} + */function splitByCommand(command){var split=[new Chartist.Svg.Path()];this.pathElements.forEach(function(pathElement){if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0){split.push(new Chartist.Svg.Path());}split[split.length - 1].pathElements.push(pathElement);});return split;} /** + * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths. + * + * @memberof Chartist.Svg.Path + * @param {Array} paths A list of paths to be joined together. The order is important. + * @param {boolean} close If the newly created path should be a closed path + * @param {Object} options Path options for the newly created path. + * @return {Chartist.Svg.Path} + */function join(paths,close,options){var joinedPath=new Chartist.Svg.Path(close,options);for(var i=0;i < paths.length;i++) {var path=paths[i];for(var j=0;j < path.pathElements.length;j++) {joinedPath.pathElements.push(path.pathElements[j]);}}return joinedPath;}Chartist.Svg.Path = Chartist.Class.extend({constructor:SvgPath,position:position,remove:remove,move:move,line:line,curve:curve,arc:arc,scale:scale,translate:translate,transform:transform,parse:parse,stringify:stringify,clone:clone,splitByCommand:splitByCommand});Chartist.Svg.Path.elementDescriptions = elementDescriptions;Chartist.Svg.Path.join = join;})(window,document,Chartist);; /* global Chartist */(function(window,document,Chartist){'use strict';var axisUnits={x:{pos:'x',len:'width',dir:'horizontal',rectStart:'x1',rectEnd:'x2',rectOffset:'y2'},y:{pos:'y',len:'height',dir:'vertical',rectStart:'y2',rectEnd:'y1',rectOffset:'x1'}};function Axis(units,chartRect,ticks,options){this.units = units;this.counterUnits = units === axisUnits.x?axisUnits.y:axisUnits.x;this.chartRect = chartRect;this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];this.gridOffset = chartRect[units.rectOffset];this.ticks = ticks;this.options = options;}function createGridAndLabels(gridGroup,labelGroup,useForeignObject,chartOptions,eventEmitter){var axisOptions=chartOptions['axis' + this.units.pos.toUpperCase()];var projectedValues=this.ticks.map(this.projectValue.bind(this));var labelValues=this.ticks.map(axisOptions.labelInterpolationFnc);projectedValues.forEach((function(projectedValue,index){var labelOffset={x:0,y:0}; // TODO: Find better solution for solving this problem + // Calculate how much space we have available for the label + var labelLength;if(projectedValues[index + 1]){ // If we still have one label ahead, we can calculate the distance to the next tick / label + labelLength = projectedValues[index + 1] - projectedValue;}else { // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to + // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will + // still be visible inside of the chart padding. + labelLength = Math.max(this.axisLength - projectedValue,30);} // Skip grid lines and labels where interpolated label values are falsey (execpt for 0) + if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== ''){return;} // Transform to global coordinates using the chartRect + // We also need to set the label offset for the createLabel function + if(this.units.pos === 'x'){projectedValue = this.chartRect.x1 + projectedValue;labelOffset.x = chartOptions.axisX.labelOffset.x; // If the labels should be positioned in start position (top side for vertical axis) we need to set a + // different offset as for positioned with end (bottom) + if(chartOptions.axisX.position === 'start'){labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject?5:20);}else {labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject?5:20);}}else {projectedValue = this.chartRect.y1 - projectedValue;labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject?labelLength:0); // If the labels should be positioned in start position (left side for horizontal axis) we need to set a + // different offset as for positioned with end (right side) + if(chartOptions.axisY.position === 'start'){labelOffset.x = useForeignObject?this.chartRect.padding.left + chartOptions.axisY.labelOffset.x:this.chartRect.x1 - 10;}else {labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;}}if(axisOptions.showGrid){Chartist.createGrid(projectedValue,index,this,this.gridOffset,this.chartRect[this.counterUnits.len](),gridGroup,[chartOptions.classNames.grid,chartOptions.classNames[this.units.dir]],eventEmitter);}if(axisOptions.showLabel){Chartist.createLabel(projectedValue,labelLength,index,labelValues,this,axisOptions.offset,labelOffset,labelGroup,[chartOptions.classNames.label,chartOptions.classNames[this.units.dir],chartOptions.classNames[axisOptions.position]],useForeignObject,eventEmitter);}}).bind(this));}Chartist.Axis = Chartist.Class.extend({constructor:Axis,createGridAndLabels:createGridAndLabels,projectValue:function projectValue(value,index,data){throw new Error('Base axis can\'t be instantiated!');}});Chartist.Axis.units = axisUnits;})(window,document,Chartist);; /** + * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored + * high: 100, + * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored + * low: 0, + * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel). + * scaleMinSpace: 20, + * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only. + * onlyInteger: true, + * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart. + * referenceValue: 5 + * }; + * ``` + * + * @module Chartist.AutoScaleAxis + */ /* global Chartist */(function(window,document,Chartist){'use strict';function AutoScaleAxis(axisUnit,data,chartRect,options){ // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options + var highLow=options.highLow || Chartist.getHighLow(data.normalized,options,axisUnit.pos);this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart],highLow,options.scaleMinSpace || 20,options.onlyInteger);this.range = {min:this.bounds.min,max:this.bounds.max};Chartist.AutoScaleAxis['super'].constructor.call(this,axisUnit,chartRect,this.bounds.values,options);}function projectValue(value){return this.axisLength * (+Chartist.getMultiValue(value,this.units.pos) - this.bounds.min) / this.bounds.range;}Chartist.AutoScaleAxis = Chartist.Axis.extend({constructor:AutoScaleAxis,projectValue:projectValue});})(window,document,Chartist);; /** + * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored + * high: 100, + * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored + * low: 0, + * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1. + * divisor: 4, + * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated. + * ticks: [1, 10, 20, 30] + * }; + * ``` + * + * @module Chartist.FixedScaleAxis + */ /* global Chartist */(function(window,document,Chartist){'use strict';function FixedScaleAxis(axisUnit,data,chartRect,options){var highLow=options.highLow || Chartist.getHighLow(data.normalized,options,axisUnit.pos);this.divisor = options.divisor || 1;this.ticks = options.ticks || Chartist.times(this.divisor).map((function(value,index){return highLow.low + (highLow.high - highLow.low) / this.divisor * index;}).bind(this));this.ticks.sort(function(a,b){return a - b;});this.range = {min:highLow.low,max:highLow.high};Chartist.FixedScaleAxis['super'].constructor.call(this,axisUnit,chartRect,this.ticks,options);this.stepLength = this.axisLength / this.divisor;}function projectValue(value){return this.axisLength * (+Chartist.getMultiValue(value,this.units.pos) - this.range.min) / (this.range.max - this.range.min);}Chartist.FixedScaleAxis = Chartist.Axis.extend({constructor:FixedScaleAxis,projectValue:projectValue});})(window,document,Chartist);; /** + * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose. + * **Options** + * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. + * ```javascript + * var options = { + * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks. + * ticks: ['One', 'Two', 'Three'], + * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead. + * stretch: true + * }; + * ``` + * + * @module Chartist.StepAxis + */ /* global Chartist */(function(window,document,Chartist){'use strict';function StepAxis(axisUnit,data,chartRect,options){Chartist.StepAxis['super'].constructor.call(this,axisUnit,chartRect,options.ticks,options);this.stepLength = this.axisLength / (options.ticks.length - (options.stretch?1:0));}function projectValue(value,index){return this.stepLength * index;}Chartist.StepAxis = Chartist.Axis.extend({constructor:StepAxis,projectValue:projectValue});})(window,document,Chartist);; /** + * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. + * + * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. + * + * @module Chartist.Line + */ /* global Chartist */(function(window,document,Chartist){'use strict'; /** + * Default options in line charts. Expand the code view to see a detailed list of options with comments. + * + * @memberof Chartist.Line + */var defaultOptions={ // Options for X-Axis + axisX:{ // The offset of the labels to the chart area + offset:30, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position:'end', // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset:{x:0,y:0}, // If labels should be shown or not + showLabel:true, // If the axis grid should be drawn or not + showGrid:true, // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc:Chartist.noop, // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + type:undefined}, // Options for Y-Axis + axisY:{ // The offset of the labels to the chart area + offset:40, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position:'start', // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset:{x:0,y:0}, // If labels should be shown or not + showLabel:true, // If the axis grid should be drawn or not + showGrid:true, // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc:Chartist.noop, // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + type:undefined, // This value specifies the minimum height in pixel of the scale steps + scaleMinSpace:20, // Use only integer values (whole numbers) for the scale steps + onlyInteger:false}, // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + width:undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + height:undefined, // If the line should be drawn or not + showLine:true, // If dots should be drawn or not + showPoint:true, // If the line chart should draw an area + showArea:false, // The base for the area chart that will be used to close the area shape (is normally 0) + areaBase:0, // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description. + lineSmooth:true, // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + low:undefined, // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + high:undefined, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + chartPadding:{top:15,right:15,bottom:5,left:10}, // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. + fullWidth:false, // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + reverseData:false, // Override the class names that get used to generate the SVG structure of the chart + classNames:{chart:'ct-chart-line',label:'ct-label',labelGroup:'ct-labels',series:'ct-series',line:'ct-line',point:'ct-point',area:'ct-area',grid:'ct-grid',gridGroup:'ct-grids',vertical:'ct-vertical',horizontal:'ct-horizontal',start:'ct-start',end:'ct-end'}}; /** + * Creates a new chart + * + */function createChart(options){this.data = Chartist.normalizeData(this.data);var data={raw:this.data,normalized:Chartist.getDataArray(this.data,options.reverseData,true)}; // Create new svg object + this.svg = Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart); // Create groups for labels, grid and series + var gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type === undefined){axisX = new Chartist.StepAxis(Chartist.Axis.units.x,data,chartRect,Chartist.extend({},options.axisX,{ticks:data.raw.labels,stretch:options.fullWidth}));}else {axisX = options.axisX.type.call(Chartist,Chartist.Axis.units.x,data,chartRect,options.axisX);}if(options.axisY.type === undefined){axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNum(options.high)?options.high:options.axisY.high,low:Chartist.isNum(options.low)?options.low:options.axisY.low}));}else {axisY = options.axisY.type.call(Chartist,Chartist.Axis.units.y,data,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter); // Draw the series + data.raw.series.forEach((function(series,seriesIndex){var seriesElement=seriesGroup.elem('g'); // Write attributes to series group element. If series name or meta is undefined the attributes will not be written + seriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)}); // Use series class from series data or if not set generate one + seriesElement.addClass([options.classNames.series,series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized[seriesIndex].forEach((function(value,valueIndex){var p={x:chartRect.x1 + axisX.projectValue(value,valueIndex,data.normalized[seriesIndex]),y:chartRect.y1 - axisY.projectValue(value,valueIndex,data.normalized[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}).bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth === 'function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none(); // Interpolating path where pathData will be used to annotate each path element so we can trace back the original + // index, value and meta data + var path=smoothing(pathCoordinates,pathData); // If we should show points we need to create them now to avoid secondary loop + // Points are drawn from the pathElements returned by the interpolation function + // Small offset for Firefox to render squares correctly + if(seriesOptions.showPoint){path.pathElements.forEach((function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x + 0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNum).join(','),'ct:meta':pathElement.data.meta});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}).bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:line});} // Area currently only works with axes that support a range! + if(seriesOptions.showArea && axisY.range){ // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that + // the area is not drawn outside the chart area. + var areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min); // We project the areaBase value into screen coordinates + var areaBaseProjected=chartRect.y1 - axisY.projectValue(areaBase); // In order to form the area we'll first split the path by move commands so we can chunk it up into segments + path.splitByCommand('M').filter(function onlySolidSegments(pathSegment){ // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area + return pathSegment.pathElements.length > 1;}).map(function convertToArea(solidPathSegments){ // Receiving the filtered solid path segments we can now convert those segments into fill areas + var firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; // Cloning the solid path segment with closing option and removing the first move command from the clone + // We then insert a new move that should start at the area base and draw a straight line up or down + // at the end of the path we add an additional straight line to the projected area base value + // As the closing option is set our path will be automatically closed + return solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length + 1).line(lastElement.x,areaBaseProjected);}).forEach((function createArea(areaPath){ // For each of our newly created area paths, we'll now create path elements by stringifying our path objects + // and adding the created DOM elements to the correct series group + var area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true); // Emit an event for each area that was drawn + this.eventEmitter.emit('draw',{type:'area',values:data.normalized[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}).bind(this));}}).bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});} /** + * This method creates a new line chart. + * + * @memberof Chartist.Line + * @param {String|Node} query A selector query string or directly a DOM element + * @param {Object} data The data object that needs to consist of a labels and a series array + * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. + * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] + * @return {Object} An object which exposes the API for the created chart + * + * @example + * // Create a simple line chart + * var data = { + * // A labels array that can contain any sort of values + * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], + * // Our series array that contains series objects or in this case series data arrays + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // As options we currently only set a static size of 300x200 px + * var options = { + * width: '300px', + * height: '200px' + * }; + * + * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options + * new Chartist.Line('.ct-chart', data, options); + * + * @example + * // Use specific interpolation function with configuration from the Chartist.Interpolation module + * + * var chart = new Chartist.Line('.ct-chart', { + * labels: [1, 2, 3, 4, 5], + * series: [ + * [1, 1, 8, 1, 7] + * ] + * }, { + * lineSmooth: Chartist.Interpolation.cardinal({ + * tension: 0.2 + * }) + * }); + * + * @example + * // Create a line chart with responsive options + * + * var data = { + * // A labels array that can contain any sort of values + * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], + * // Our series array that contains series objects or in this case series data arrays + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. + * var responsiveOptions = [ + * ['screen and (min-width: 641px) and (max-width: 1024px)', { + * showPoint: false, + * axisX: { + * labelInterpolationFnc: function(value) { + * // Will return Mon, Tue, Wed etc. on medium screens + * return value.slice(0, 3); + * } + * } + * }], + * ['screen and (max-width: 640px)', { + * showLine: false, + * axisX: { + * labelInterpolationFnc: function(value) { + * // Will return M, T, W etc. on small screens + * return value[0]; + * } + * } + * }] + * ]; + * + * new Chartist.Line('.ct-chart', data, null, responsiveOptions); + * + */function Line(query,data,options,responsiveOptions){Chartist.Line['super'].constructor.call(this,query,data,defaultOptions,Chartist.extend({},defaultOptions,options),responsiveOptions);} // Creating line chart type in Chartist namespace + Chartist.Line = Chartist.Base.extend({constructor:Line,createChart:createChart});})(window,document,Chartist);; /** + * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. + * + * @module Chartist.Bar + */ /* global Chartist */(function(window,document,Chartist){'use strict'; /** + * Default options in bar charts. Expand the code view to see a detailed list of options with comments. + * + * @memberof Chartist.Bar + */var defaultOptions={ // Options for X-Axis + axisX:{ // The offset of the chart drawing area to the border of the container + offset:30, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position:'end', // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset:{x:0,y:0}, // If labels should be shown or not + showLabel:true, // If the axis grid should be drawn or not + showGrid:true, // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc:Chartist.noop, // This value specifies the minimum width in pixel of the scale steps + scaleMinSpace:30, // Use only integer values (whole numbers) for the scale steps + onlyInteger:false}, // Options for Y-Axis + axisY:{ // The offset of the chart drawing area to the border of the container + offset:40, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + position:'start', // Allows you to correct label positioning on this axis by positive or negative x and y offset. + labelOffset:{x:0,y:0}, // If labels should be shown or not + showLabel:true, // If the axis grid should be drawn or not + showGrid:true, // Interpolation function that allows you to intercept the value from the axis label + labelInterpolationFnc:Chartist.noop, // This value specifies the minimum height in pixel of the scale steps + scaleMinSpace:20, // Use only integer values (whole numbers) for the scale steps + onlyInteger:false}, // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + width:undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + height:undefined, // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + high:undefined, // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + low:undefined, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + chartPadding:{top:15,right:15,bottom:5,left:10}, // Specify the distance in pixel of bars in a group + seriesBarDistance:15, // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options. + stackBars:false, // If set to 'overlap' this property will force the stacked bars to draw from the zero line. + // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. + stackMode:'accumulate', // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values. + horizontalBars:false, // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time. + distributeSeries:false, // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + reverseData:false, // Override the class names that get used to generate the SVG structure of the chart + classNames:{chart:'ct-chart-bar',horizontalBars:'ct-horizontal-bars',label:'ct-label',labelGroup:'ct-labels',series:'ct-series',bar:'ct-bar',grid:'ct-grid',gridGroup:'ct-grids',vertical:'ct-vertical',horizontal:'ct-horizontal',start:'ct-start',end:'ct-end'}}; /** + * Creates a new chart + * + */function createChart(options){this.data = Chartist.normalizeData(this.data);var data={raw:this.data,normalized:options.distributeSeries?Chartist.getDataArray(this.data,options.reverseData,options.horizontalBars?'x':'y').map(function(value){return [value];}):Chartist.getDataArray(this.data,options.reverseData,options.horizontalBars?'x':'y')};var highLow; // Create new svg element + this.svg = Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart + (options.horizontalBars?' ' + options.classNames.horizontalBars:'')); // Drawing groups in correct order + var gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);if(options.stackBars && data.normalized.length !== 0){ // If stacked bars we need to calculate the high low from stacked values from each series + var serialSums=Chartist.serialMap(data.normalized,function serialSums(){return Array.prototype.slice.call(arguments).map(function(value){return value;}).reduce(function(prev,curr){return {x:prev.x + (curr && curr.x) || 0,y:prev.y + (curr && curr.y) || 0};},{x:0,y:0});});highLow = Chartist.getHighLow([serialSums],Chartist.extend({},options,{referenceValue:0}),options.horizontalBars?'x':'y');}else {highLow = Chartist.getHighLow(data.normalized,Chartist.extend({},options,{referenceValue:0}),options.horizontalBars?'x':'y');} // Overrides of high / low from settings + highLow.high = +options.high || (options.high === 0?0:highLow.high);highLow.low = +options.low || (options.low === 0?0:highLow.low);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var valueAxis,labelAxisTicks,labelAxis,axisX,axisY; // We need to set step count based on some options combinations + if(options.distributeSeries && options.stackBars){ // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should + // use only the first label for the step axis + labelAxisTicks = data.raw.labels.slice(0,1);}else { // If distributed series are enabled but stacked bars aren't, we should use the series labels + // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array + // as the bars are normalized + labelAxisTicks = data.raw.labels;} // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary. + if(options.horizontalBars){if(options.axisX.type === undefined){valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x,data,chartRect,Chartist.extend({},options.axisX,{highLow:highLow,referenceValue:0}));}else {valueAxis = axisX = options.axisX.type.call(Chartist,Chartist.Axis.units.x,data,chartRect,Chartist.extend({},options.axisX,{highLow:highLow,referenceValue:0}));}if(options.axisY.type === undefined){labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y,data,chartRect,{ticks:labelAxisTicks});}else {labelAxis = axisY = options.axisY.type.call(Chartist,Chartist.Axis.units.y,data,chartRect,options.axisY);}}else {if(options.axisX.type === undefined){labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x,data,chartRect,{ticks:labelAxisTicks});}else {labelAxis = axisX = options.axisX.type.call(Chartist,Chartist.Axis.units.x,data,chartRect,options.axisX);}if(options.axisY.type === undefined){valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data,chartRect,Chartist.extend({},options.axisY,{highLow:highLow,referenceValue:0}));}else {valueAxis = axisY = options.axisY.type.call(Chartist,Chartist.Axis.units.y,data,chartRect,Chartist.extend({},options.axisY,{highLow:highLow,referenceValue:0}));}} // Projected 0 point + var zeroPoint=options.horizontalBars?chartRect.x1 + valueAxis.projectValue(0):chartRect.y1 - valueAxis.projectValue(0); // Used to track the screen coordinates of stacked bars + var stackedBarValues=[];labelAxis.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);valueAxis.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter); // Draw the series + data.raw.series.forEach((function(series,seriesIndex){ // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. + var biPol=seriesIndex - (data.raw.series.length - 1) / 2; // Half of the period width between vertical grid lines used to position bars + var periodHalfLength; // Current series SVG element + var seriesElement; // We need to set periodHalfLength based on some options combinations + if(options.distributeSeries && !options.stackBars){ // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array + // which is the series count and divide by 2 + periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;}else if(options.distributeSeries && options.stackBars){ // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis + // length by 2 + periodHalfLength = labelAxis.axisLength / 2;}else { // On regular bar charts we should just use the series length + periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;} // Adding the series group to the series element + seriesElement = seriesGroup.elem('g'); // Write attributes to series group element. If series name or meta is undefined the attributes will not be written + seriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)}); // Use series class from series data or if not set generate one + seriesElement.addClass([options.classNames.series,series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)].join(' '));data.normalized[seriesIndex].forEach((function(value,valueIndex){var projected,bar,previousStack,labelAxisValueIndex; // We need to set labelAxisValueIndex based on some options combinations + if(options.distributeSeries && !options.stackBars){ // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection + // on the step axis for label positioning + labelAxisValueIndex = seriesIndex;}else if(options.distributeSeries && options.stackBars){ // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use + // 0 for projection on the label step axis + labelAxisValueIndex = 0;}else { // On regular bar charts we just use the value index to project on the label step axis + labelAxisValueIndex = valueIndex;} // We need to transform coordinates differently based on the chart layout + if(options.horizontalBars){projected = {x:chartRect.x1 + valueAxis.projectValue(value && value.x?value.x:0,valueIndex,data.normalized[seriesIndex]),y:chartRect.y1 - labelAxis.projectValue(value && value.y?value.y:0,labelAxisValueIndex,data.normalized[seriesIndex])};}else {projected = {x:chartRect.x1 + labelAxis.projectValue(value && value.x?value.x:0,labelAxisValueIndex,data.normalized[seriesIndex]),y:chartRect.y1 - valueAxis.projectValue(value && value.y?value.y:0,valueIndex,data.normalized[seriesIndex])};} // If the label axis is a step based axis we will offset the bar into the middle of between two steps using + // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using + // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not + // add any automated positioning. + if(labelAxis instanceof Chartist.StepAxis){ // Offset to center bar between grid lines, but only if the step axis is not stretched + if(!labelAxis.options.stretch){projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars?-1:1);} // Using bi-polar offset for multiple series if no stacked bars or series distribution is used + projected[labelAxis.units.pos] += options.stackBars || options.distributeSeries?0:biPol * options.seriesBarDistance * (options.horizontalBars?-1:1);} // Enter value in stacked bar values used to remember previous screen value for stacking up bars + previousStack = stackedBarValues[valueIndex] || zeroPoint;stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); // Skip if value is undefined + if(value === undefined){return;}var positions={};positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)){ // Stack mode: accumulate (default) + // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line + // We want backwards compatibility, so the expected fallback without the 'stackMode' option + // to be the original behaviour (accumulate) + positions[labelAxis.counterUnits.pos + '1'] = previousStack;positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];}else { // Draw from the zero line normally + // This is also the same code for Stack mode: overlap + positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];} // Limit x and y so that they are within the chart rect + positions.x1 = Math.min(Math.max(positions.x1,chartRect.x1),chartRect.x2);positions.x2 = Math.min(Math.max(positions.x2,chartRect.x1),chartRect.x2);positions.y1 = Math.min(Math.max(positions.y1,chartRect.y2),chartRect.y1);positions.y2 = Math.min(Math.max(positions.y2,chartRect.y2),chartRect.y1); // Create bar element + bar = seriesElement.elem('line',positions,options.classNames.bar).attr({'ct:value':[value.x,value.y].filter(Chartist.isNum).join(','),'ct:meta':Chartist.getMetaData(series,valueIndex)});this.eventEmitter.emit('draw',Chartist.extend({type:'bar',value:value,index:valueIndex,meta:Chartist.getMetaData(series,valueIndex),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,group:seriesElement,element:bar},positions));}).bind(this));}).bind(this));this.eventEmitter.emit('created',{bounds:valueAxis.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});} /** + * This method creates a new bar chart and returns API object that you can use for later changes. + * + * @memberof Chartist.Bar + * @param {String|Node} query A selector query string or directly a DOM element + * @param {Object} data The data object that needs to consist of a labels and a series array + * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. + * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] + * @return {Object} An object which exposes the API for the created chart + * + * @example + * // Create a simple bar chart + * var data = { + * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], + * series: [ + * [5, 2, 4, 2, 0] + * ] + * }; + * + * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. + * new Chartist.Bar('.ct-chart', data); + * + * @example + * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 + * new Chartist.Bar('.ct-chart', { + * labels: [1, 2, 3, 4, 5, 6, 7], + * series: [ + * [1, 3, 2, -5, -3, 1, -6], + * [-5, -2, -4, -1, 2, -3, 1] + * ] + * }, { + * seriesBarDistance: 12, + * low: -10, + * high: 10 + * }); + * + */function Bar(query,data,options,responsiveOptions){Chartist.Bar['super'].constructor.call(this,query,data,defaultOptions,Chartist.extend({},defaultOptions,options),responsiveOptions);} // Creating bar chart type in Chartist namespace + Chartist.Bar = Chartist.Base.extend({constructor:Bar,createChart:createChart});})(window,document,Chartist);; /** + * The pie chart module of Chartist that can be used to draw pie, donut or gauge charts + * + * @module Chartist.Pie + */ /* global Chartist */(function(window,document,Chartist){'use strict'; /** + * Default options in line charts. Expand the code view to see a detailed list of options with comments. + * + * @memberof Chartist.Pie + */var defaultOptions={ // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + width:undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + height:undefined, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + chartPadding:5, // Override the class names that are used to generate the SVG structure of the chart + classNames:{chartPie:'ct-chart-pie',chartDonut:'ct-chart-donut',series:'ct-series',slicePie:'ct-slice-pie',sliceDonut:'ct-slice-donut',label:'ct-label'}, // The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. + startAngle:0, // An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. + total:undefined, // If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. + donut:false, // Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. + // This option can be set as number or string to specify a relative width (i.e. 100 or '30%'). + donutWidth:60, // If a label should be shown or not + showLabel:true, // Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. + labelOffset:0, // This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option. + labelPosition:'inside', // An interpolation function for the label value + labelInterpolationFnc:Chartist.noop, // Label direction can be 'neutral', 'explode' or 'implode'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. + labelDirection:'neutral', // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + reverseData:false, // If true empty values will be ignored to avoid drawing unncessary slices and labels + ignoreEmptyValues:false}; /** + * Determines SVG anchor position based on direction and center parameter + * + * @param center + * @param label + * @param direction + * @return {string} + */function determineAnchorPosition(center,label,direction){var toTheRight=label.x > center.x;if(toTheRight && direction === 'explode' || !toTheRight && direction === 'implode'){return 'start';}else if(toTheRight && direction === 'implode' || !toTheRight && direction === 'explode'){return 'end';}else {return 'middle';}} /** + * Creates the pie chart + * + * @param options + */function createChart(options){this.data = Chartist.normalizeData(this.data);var seriesGroups=[],labelsGroup,chartRect,radius,labelRadius,totalDataSum,startAngle=options.startAngle,dataArray=Chartist.getDataArray(this.data,options.reverseData); // Create SVG.js draw + this.svg = Chartist.createSvg(this.container,options.width,options.height,options.donut?options.classNames.chartDonut:options.classNames.chartPie); // Calculate charting rect + chartRect = Chartist.createChartRect(this.svg,options,defaultOptions.padding); // Get biggest circle radius possible within chartRect + radius = Math.min(chartRect.width() / 2,chartRect.height() / 2); // Calculate total of all series to get reference value or use total reference from optional options + totalDataSum = options.total || dataArray.reduce(function(previousValue,currentValue){return previousValue + currentValue;},0);var donutWidth=Chartist.quantity(options.donutWidth);if(donutWidth.unit === '%'){donutWidth.value *= radius / 100;} // If this is a donut chart we need to adjust our radius to enable strokes to be drawn inside + // Unfortunately this is not possible with the current SVG Spec + // See this proposal for more details: http://lists.w3.org/Archives/Public/www-svg/2003Oct/0000.html + radius -= options.donut?donutWidth.value / 2:0; // If labelPosition is set to `outside` or a donut chart is drawn then the label position is at the radius, + // if regular pie chart it's half of the radius + if(options.labelPosition === 'outside' || options.donut){labelRadius = radius;}else if(options.labelPosition === 'center'){ // If labelPosition is center we start with 0 and will later wait for the labelOffset + labelRadius = 0;}else { // Default option is 'inside' where we use half the radius so the label will be placed in the center of the pie + // slice + labelRadius = radius / 2;} // Add the offset to the labelRadius where a negative offset means closed to the center of the chart + labelRadius += options.labelOffset; // Calculate end angle based on total sum and current data value and offset with padding + var center={x:chartRect.x1 + chartRect.width() / 2,y:chartRect.y2 + chartRect.height() / 2}; // Check if there is only one non-zero value in the series array. + var hasSingleValInSeries=this.data.series.filter(function(val){return val.hasOwnProperty('value')?val.value !== 0:val !== 0;}).length === 1; //if we need to show labels we create the label group now + if(options.showLabel){labelsGroup = this.svg.elem('g',null,null,true);} // Draw the series + // initialize series groups + for(var i=0;i < this.data.series.length;i++) { // If current value is zero and we are ignoring empty values then skip to next value + if(dataArray[i] === 0 && options.ignoreEmptyValues)continue;var series=this.data.series[i];seriesGroups[i] = this.svg.elem('g',null,null,true); // If the series is an object and contains a name or meta data we add a custom attribute + seriesGroups[i].attr({'ct:series-name':series.name}); // Use series class from series data or if not set generate one + seriesGroups[i].addClass([options.classNames.series,series.className || options.classNames.series + '-' + Chartist.alphaNumerate(i)].join(' '));var endAngle=startAngle + dataArray[i] / totalDataSum * 360; // Use slight offset so there are no transparent hairline issues + var overlappigStartAngle=Math.max(0,startAngle - (i === 0 || hasSingleValInSeries?0:0.2)); // If we need to draw the arc for all 360 degrees we need to add a hack where we close the circle + // with Z and use 359.99 degrees + if(endAngle - overlappigStartAngle >= 359.99){endAngle = overlappigStartAngle + 359.99;}var start=Chartist.polarToCartesian(center.x,center.y,radius,overlappigStartAngle),end=Chartist.polarToCartesian(center.x,center.y,radius,endAngle); // Create a new path element for the pie chart. If this isn't a donut chart we should close the path for a correct stroke + var path=new Chartist.Svg.Path(!options.donut).move(end.x,end.y).arc(radius,radius,0,endAngle - startAngle > 180,0,start.x,start.y); // If regular pie chart (no donut) we add a line to the center of the circle for completing the pie + if(!options.donut){path.line(center.x,center.y);} // Create the SVG path + // If this is a donut chart we add the donut class, otherwise just a regular slice + var pathElement=seriesGroups[i].elem('path',{d:path.stringify()},options.donut?options.classNames.sliceDonut:options.classNames.slicePie); // Adding the pie series value to the path + pathElement.attr({'ct:value':dataArray[i],'ct:meta':Chartist.serialize(series.meta)}); // If this is a donut, we add the stroke-width as style attribute + if(options.donut){pathElement.attr({'style':'stroke-width: ' + donutWidth.value + 'px'});} // Fire off draw event + this.eventEmitter.emit('draw',{type:'slice',value:dataArray[i],totalDataSum:totalDataSum,index:i,meta:series.meta,series:series,group:seriesGroups[i],element:pathElement,path:path.clone(),center:center,radius:radius,startAngle:startAngle,endAngle:endAngle}); // If we need to show labels we need to add the label for this slice now + if(options.showLabel){ // Position at the labelRadius distance from center and between start and end angle + var labelPosition=Chartist.polarToCartesian(center.x,center.y,labelRadius,startAngle + (endAngle - startAngle) / 2),interpolatedValue=options.labelInterpolationFnc(this.data.labels && !Chartist.isFalseyButZero(this.data.labels[i])?this.data.labels[i]:dataArray[i],i);if(interpolatedValue || interpolatedValue === 0){var labelElement=labelsGroup.elem('text',{dx:labelPosition.x,dy:labelPosition.y,'text-anchor':determineAnchorPosition(center,labelPosition,options.labelDirection)},options.classNames.label).text('' + interpolatedValue); // Fire off draw event + this.eventEmitter.emit('draw',{type:'label',index:i,group:labelsGroup,element:labelElement,text:'' + interpolatedValue,x:labelPosition.x,y:labelPosition.y});}} // Set next startAngle to current endAngle. + // (except for last slice) + startAngle = endAngle;}this.eventEmitter.emit('created',{chartRect:chartRect,svg:this.svg,options:options});} /** + * This method creates a new pie chart and returns an object that can be used to redraw the chart. + * + * @memberof Chartist.Pie + * @param {String|Node} query A selector query string or directly a DOM element + * @param {Object} data The data object in the pie chart needs to have a series property with a one dimensional data array. The values will be normalized against each other and don't necessarily need to be in percentage. The series property can also be an array of value objects that contain a value property and a className property to override the CSS class name for the series group. + * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. + * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] + * @return {Object} An object with a version and an update method to manually redraw the chart + * + * @example + * // Simple pie chart example with four series + * new Chartist.Pie('.ct-chart', { + * series: [10, 2, 4, 3] + * }); + * + * @example + * // Drawing a donut chart + * new Chartist.Pie('.ct-chart', { + * series: [10, 2, 4, 3] + * }, { + * donut: true + * }); + * + * @example + * // Using donut, startAngle and total to draw a gauge chart + * new Chartist.Pie('.ct-chart', { + * series: [20, 10, 30, 40] + * }, { + * donut: true, + * donutWidth: 20, + * startAngle: 270, + * total: 200 + * }); + * + * @example + * // Drawing a pie chart with padding and labels that are outside the pie + * new Chartist.Pie('.ct-chart', { + * series: [20, 10, 30, 40] + * }, { + * chartPadding: 30, + * labelOffset: 50, + * labelDirection: 'explode' + * }); + * + * @example + * // Overriding the class names for individual series as well as a name and meta data. + * // The name will be written as ct:series-name attribute and the meta data will be serialized and written + * // to a ct:meta attribute. + * new Chartist.Pie('.ct-chart', { + * series: [{ + * value: 20, + * name: 'Series 1', + * className: 'my-custom-class-one', + * meta: 'Meta One' + * }, { + * value: 10, + * name: 'Series 2', + * className: 'my-custom-class-two', + * meta: 'Meta Two' + * }, { + * value: 70, + * name: 'Series 3', + * className: 'my-custom-class-three', + * meta: 'Meta Three' + * }] + * }); + */function Pie(query,data,options,responsiveOptions){Chartist.Pie['super'].constructor.call(this,query,data,defaultOptions,Chartist.extend({},defaultOptions,options),responsiveOptions);} // Creating pie chart type in Chartist namespace + Chartist.Pie = Chartist.Base.extend({constructor:Pie,createChart:createChart,determineAnchorPosition:determineAnchorPosition});})(window,document,Chartist);return Chartist;}); /***/ } /******/ ]) diff --git a/scripts/Griddle.js b/scripts/Griddle.js index e5894b7..600b36e 100644 --- a/scripts/Griddle.js +++ b/scripts/Griddle.js @@ -90,34 +90,38 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var GridTable = __webpack_require__(5); - var GridFilter = __webpack_require__(29); - var GridPagination = __webpack_require__(30); - var GridSettings = __webpack_require__(33); - var GridNoData = __webpack_require__(36); - var GridRow = __webpack_require__(37); - var GridRowContainer = __webpack_require__(24); - var CustomRowComponentContainer = __webpack_require__(48); - var CustomPaginationContainer = __webpack_require__(49); - var CustomFilterContainer = __webpack_require__(50); - var ColumnProperties = __webpack_require__(8); - var RowProperties = __webpack_require__(26); - var deep = __webpack_require__(38); - - var drop = __webpack_require__(51); - var dropRight = __webpack_require__(53); - var find = __webpack_require__(15); - var first = __webpack_require__(54); - var forEach = __webpack_require__(39); - var initial = __webpack_require__(55); - var isArray = __webpack_require__(41); - var isEmpty = __webpack_require__(56); - var isNull = __webpack_require__(57); - var isUndefined = __webpack_require__(58); - var omit = __webpack_require__(59); - var map = __webpack_require__(9); - var sortBy = __webpack_require__(18); - var extend = __webpack_require__(31); - var _filter = __webpack_require__(13); + var GridFilter = __webpack_require__(177); + var GridPagination = __webpack_require__(178); + var GridSettings = __webpack_require__(179); + var GridNoData = __webpack_require__(185); + var GridRow = __webpack_require__(186); + var GridRowContainer = __webpack_require__(168); + var CustomRowComponentContainer = __webpack_require__(206); + var CustomPaginationContainer = __webpack_require__(207); + var CustomFilterContainer = __webpack_require__(208); + var ColumnProperties = __webpack_require__(7); + var RowProperties = __webpack_require__(175); + var deep = __webpack_require__(187); + + var drop = __webpack_require__(209); + var dropRight = __webpack_require__(211); + var find = __webpack_require__(132); + var first = __webpack_require__(212); + var forEach = __webpack_require__(188); + var initial = __webpack_require__(213); + var intersection = __webpack_require__(214); + var isArray = __webpack_require__(73); + var isEmpty = __webpack_require__(217); + var isNull = __webpack_require__(218); + var isUndefined = __webpack_require__(219); + var omit = __webpack_require__(220); + var map = __webpack_require__(8); + var extend = __webpack_require__(163); + var _filter = __webpack_require__(130); + + var _orderBy = __webpack_require__(248); + var _property = __webpack_require__(121); + var _get = __webpack_require__(106); var Griddle = React.createClass({ displayName: 'Griddle', @@ -139,7 +143,6 @@ return /******/ (function(modules) { // webpackBootstrap "rowMetadata": null, "results": [], // Used if all results are already loaded. "initialSort": "", - "initialSortAscending": true, "gridClassName": "", "tableClassName": "", "customRowComponentClassName": "", @@ -173,6 +176,8 @@ return /******/ (function(modules) { // webpackBootstrap "noDataMessage": "There is no data to display.", "noDataClassName": "griddle-nodata", "customNoDataComponent": null, + "customNoDataComponentProps": null, + "allowEmptyGrid": false, "showTableHeading": true, "showPager": true, "useFixedHeader": false, @@ -196,6 +201,10 @@ return /******/ (function(modules) { // webpackBootstrap "isSubGriddle": false, "enableSort": true, "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, /* css class names */ "sortAscendingClassName": "sort-ascending", "sortDescendingClassName": "sort-descending", @@ -216,19 +225,23 @@ return /******/ (function(modules) { // webpackBootstrap "previousIconComponent": "", "isMultipleSelection": false, //currently does not support subgrids "selectedRowIds": [], - "uniqueIdentifier": "id" + "uniqueIdentifier": "id", + "onSelectionChange": null }; }, propTypes: { isMultipleSelection: React.PropTypes.bool, selectedRowIds: React.PropTypes.oneOfType([React.PropTypes.arrayOf(React.PropTypes.number), React.PropTypes.arrayOf(React.PropTypes.string)]), - uniqueIdentifier: React.PropTypes.string + uniqueIdentifier: React.PropTypes.string, + onSelectionChange: React.PropTypes.func }, defaultFilter: function defaultFilter(results, filter) { + var that = this; return _filter(results, function (item) { var arr = deep.keys(item); for (var i = 0; i < arr.length; i++) { - if ((deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { + var isFilterable = that.columnSettings.getMetadataColumnProperty(arr[i], "filterable", true); + if (isFilterable && (deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { return true; } } @@ -236,14 +249,19 @@ return /******/ (function(modules) { // webpackBootstrap }); }, + defaultColumnFilter: function defaultColumnFilter(value, filter) { + return _filter(deep.getObjectValues(value), function (value) { + return value.toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0; + }).length > 0; + }, + filterByColumnFilters: function filterByColumnFilters(columnFilters) { + var filterFunction = this.defaultColumnFilter; var filteredResults = Object.keys(columnFilters).reduce(function (previous, current) { return _filter(previous, function (item) { - if (deep.getAt(item, current || "").toString().toLowerCase().indexOf(columnFilters[current].toLowerCase()) >= 0) { - return true; - } - - return false; + var value = deep.getAt(item, current || ""); + var filter = columnFilters[current]; + return filterFunction(value, filter); }); }, this.props.results); @@ -310,10 +328,12 @@ return /******/ (function(modules) { // webpackBootstrap }, setPageSize: function setPageSize(size) { if (this.props.useExternal) { + this.setState({ + resultsPerPage: size + }); this.props.externalSetPageSize(size); return; } - //make this better. this.state.resultsPerPage = size; this.setMaxPage(); @@ -323,14 +343,23 @@ return /******/ (function(modules) { // webpackBootstrap showColumnChooser: !this.state.showColumnChooser }); }, + isNullOrUndefined: function isNullOrUndefined(value) { + return value === undefined || value === null; + }, + shouldUseCustomRowComponent: function shouldUseCustomRowComponent() { + return this.isNullOrUndefined(this.state.useCustomRowComponent) ? this.props.useCustomRowComponent : this.state.useCustomRowComponent; + }, + shouldUseCustomGridComponent: function shouldUseCustomGridComponent() { + return this.isNullOrUndefined(this.state.useCustomGridComponent) ? this.props.useCustomGridComponent : this.state.useCustomGridComponent; + }, toggleCustomComponent: function toggleCustomComponent() { if (this.state.customComponentType === "grid") { - this.setProps({ - useCustomGridComponent: !this.props.useCustomGridComponent + this.setState({ + useCustomGridComponent: !this.shouldUseCustomGridComponent() }); } else if (this.state.customComponentType === "row") { - this.setProps({ - useCustomRowComponent: !this.props.useCustomRowComponent + this.setState({ + useCustomRowComponent: !this.shouldUseCustomRowComponent() }); } }, @@ -373,10 +402,6 @@ return /******/ (function(modules) { // webpackBootstrap this.setState({ isSelectAllChecked: false }); - } else { - //When the paging is done on the server, the previously selected rows on a certain page might not - // coincide with the new rows on that exact page page, if moving back and forth. Better reset the selection - this._resetSelectedRows(); } }, setColumns: function setColumns(columns) { @@ -398,36 +423,50 @@ return /******/ (function(modules) { // webpackBootstrap this.setPage(currentPage - 1); } }, - changeSort: function changeSort(sort) { + changeSort: function changeSort(column) { if (this.props.enableSort === false) { return; } + if (this.props.useExternal) { - this.props.externalChangeSort(sort, this.props.externalSortColumn === sort ? !this.props.externalSortAscending : true); + var isAscending = this.props.externalSortColumn === column ? !this.props.externalSortAscending : true; + this.setState({ + sortColumn: column, + sortDirection: isAscending ? 'asc' : 'desc' + }); + this.props.externalChangeSort(column, isAscending); return; } + var columnMeta = find(this.props.columnMetadata, { columnName: column }) || {}; + var sortDirectionCycle = columnMeta.sortDirectionCycle ? columnMeta.sortDirectionCycle : [null, 'asc', 'desc']; + var sortDirection = null; + // Find the current position in the cycle (or -1). + var i = sortDirectionCycle.indexOf(this.state.sortDirection && column === this.state.sortColumn ? this.state.sortDirection : null); - var that = this, - state = { - page: 0, - sortColumn: sort, - sortAscending: true - }; + // Proceed to the next position in the cycle (or start at the beginning). + i = (i + 1) % sortDirectionCycle.length; - // If this is the same column, reverse the sort. - if (this.state.sortColumn == sort) { - state.sortAscending = !this.state.sortAscending; + if (sortDirectionCycle[i]) { + sortDirection = sortDirectionCycle[i]; + } else { + sortDirection = null; } - this.setState(state); + var state = { + page: 0, + sortColumn: column, + sortDirection: sortDirection + }; - //When the sorting is done on the server, the previously selected rows might not correspond with the new ones. - //Better reset the selection - this._resetSelectedRows(); + this.setState(state); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setMaxPage(nextProps.results); - + if (nextProps.resultsPerPage !== this.props.resultsPerPage) { + this.setPageSize(nextProps.resultsPerPage); + } + //This will updaet the column Metadata + this.columnSettings.columnMetadata = nextProps.columnMetadata; if (nextProps.results.length > 0) { var deepKeys = deep.keys(nextProps.results[0]); @@ -442,12 +481,8 @@ return /******/ (function(modules) { // webpackBootstrap this.columnSettings.allColumns = []; } - if (nextProps.columns !== this.columnSettings.filteredColumns) { - this.columnSettings.filteredColumns = nextProps.columns; - } - if (nextProps.selectedRowIds) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true); + var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), @@ -465,13 +500,10 @@ return /******/ (function(modules) { // webpackBootstrap //this sets the individual column filters columnFilters: {}, resultsPerPage: this.props.resultsPerPage || 5, - sortColumn: this.props.initialSort, - sortAscending: this.props.initialSortAscending, showColumnChooser: false, isSelectAllChecked: false, selectedRowIds: this.props.selectedRowIds }; - return state; }, componentWillMount: function componentWillMount() { @@ -482,14 +514,25 @@ return /******/ (function(modules) { // webpackBootstrap this.rowSettings = new RowProperties(this.props.rowMetadata, this.props.useCustomTableRowComponent && this.props.customTableRowComponent ? this.props.customTableRowComponent : GridRow, this.props.useCustomTableRowComponent); + if (this.props.initialSort) { + // shouldn't change Sort on init for external + if (this.props.useExternal) { + this.setState({ + sortColumn: this.props.externalSortColumn, + sortDirection: this.props.externalSortAscending ? 'asc' : 'desc' + }); + } else { + this.changeSort(this.props.initialSort); + } + } this.setMaxPage(); //don't like the magic strings - if (this.props.useCustomGridComponent === true) { + if (this.shouldUseCustomGridComponent()) { this.setState({ customComponentType: "grid" }); - } else if (this.props.useCustomRowComponent === true) { + } else if (this.shouldUseCustomRowComponent()) { this.setState({ customComponentType: "row" }); @@ -499,6 +542,16 @@ return /******/ (function(modules) { // webpackBootstrap }); } }, + componentDidMount: function componentDidMount() { + if (this.props.componentDidMount && typeof this.props.componentDidMount === "function") { + return this.props.componentDidMount(); + } + }, + componentDidUpdate: function componentDidUpdate() { + if (this.props.componentDidUpdate && typeof this.props.componentDidUpdate === "function") { + return this.props.componentDidUpdate(this.state); + } + }, //todo: clean these verify methods up verifyExternal: function verifyExternal() { if (this.props.useExternal === true) { @@ -528,6 +581,7 @@ return /******/ (function(modules) { // webpackBootstrap } } }, + //TODO: Do this with propTypes verifyCustom: function verifyCustom() { if (this.props.useCustomGridComponent === true && this.props.customGridComponent === null) { console.error("useCustomGridComponent is set to true but no custom component was specified."); @@ -546,36 +600,77 @@ return /******/ (function(modules) { // webpackBootstrap } }, getDataForRender: function getDataForRender(data, cols, pageList) { + var _this = this; + var that = this; - //get the correct page size - if (this.state.sortColumn !== "" || this.props.initialSort !== "") { - var sortProperty = _filter(this.props.columnMetadata, { columnName: this.state.sortColumn }); - sortProperty = sortProperty.length > 0 && sortProperty[0].hasOwnProperty("sortProperty") && sortProperty[0]["sortProperty"] || null; - data = sortBy(data, function (item) { - return sortProperty ? deep.getAt(item, that.state.sortColumn || that.props.initialSort)[sortProperty] : deep.getAt(item, that.state.sortColumn || that.props.initialSort); - }); + if (!this.props.useExternal) { + if (this.state.sortColumn !== "") { + var column = this.state.sortColumn; + var sortColumn = _filter(this.props.columnMetadata, { columnName: column }); + var customCompareFn; + var multiSort = { + columns: [], + orders: [] + }; + + if (sortColumn.length > 0) { + customCompareFn = sortColumn[0].hasOwnProperty("customCompareFn") && sortColumn[0]["customCompareFn"]; + if (sortColumn[0]["multiSort"]) { + multiSort = sortColumn[0]["multiSort"]; + } + } - if (this.state.sortAscending === false) { - data.reverse(); + if (this.state.sortDirection) { + if (typeof customCompareFn === 'function') { + if (customCompareFn.length === 2) { + data = data.sort(function (a, b) { + return customCompareFn(_get(a, column), _get(b, column)); + }); + + if (this.state.sortDirection === 'desc') { + data.reverse(); + } + } else if (customCompareFn.length === 1) { + data = _orderBy(data, function (item) { + return customCompareFn(_get(item, column)); + }, [this.state.sortDirection]); + } + } else { + var iteratees = [function (row) { + return (_get(row, column) || '').toString().toLowerCase(); + }]; + var orders = [this.state.sortDirection]; + multiSort.columns.forEach(function (col, i) { + iteratees.push(function (row) { + return (_get(row, col) || '').toString().toLowerCase(); + }); + if (multiSort.orders[i] === 'asc' || multiSort.orders[i] === 'desc') { + orders.push(multiSort.orders[i]); + } else { + orders.push(_this.state.sortDirection); + } + }); + + data = _orderBy(data, iteratees, orders); + } + } } - } - var currentPage = this.getCurrentPage(); + var currentPage = this.getCurrentPage(); - if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { - if (this.isInfiniteScrollEnabled()) { - // If we're doing infinite scroll, grab all results up to the current page. - data = first(data, (currentPage + 1) * this.state.resultsPerPage); - } else { - //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results - var rest = drop(data, currentPage * this.state.resultsPerPage); - data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); + if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { + if (this.isInfiniteScrollEnabled()) { + // If we're doing infinite scroll, grab all results up to the current page. + data = first(data, (currentPage + 1) * this.state.resultsPerPage); + } else { + //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results + var rest = drop(data, currentPage * this.state.resultsPerPage); + data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); + } } } - var meta = this.columnSettings.getMetadataColumns; - var transformedData = []; for (var i = 0; i < data.length; i++) { @@ -594,9 +689,8 @@ return /******/ (function(modules) { // webpackBootstrap } return transformedData; }, - //this is the current results - getCurrentResults: function getCurrentResults() { - return this.state.filteredResults || this.props.results; + getCurrentResults: function getCurrentResults(results) { + return this.state.filteredResults || results || this.props.results; }, getCurrentPage: function getCurrentPage() { return this.props.externalCurrentPage || this.state.page; @@ -605,7 +699,7 @@ return /******/ (function(modules) { // webpackBootstrap return this.props.useExternal ? this.props.externalSortColumn : this.state.sortColumn; }, getCurrentSortAscending: function getCurrentSortAscending() { - return this.props.useExternal ? this.props.externalSortAscending : this.state.sortAscending; + return this.props.useExternal ? this.props.externalSortAscending : this.state.sortDirection === 'asc'; }, getCurrentMaxPage: function getCurrentMaxPage() { return this.props.useExternal ? this.props.externalMaxPage : this.state.maxPage; @@ -617,6 +711,7 @@ return /******/ (function(modules) { // webpackBootstrap changeSort: this.changeSort, sortColumn: this.getCurrentSort(), sortAscending: this.getCurrentSortAscending(), + sortDirection: this.state.sortDirection, sortAscendingClassName: this.props.sortAscendingClassName, sortDescendingClassName: this.props.sortDescendingClassName, sortAscendingComponent: this.props.sortAscendingComponent, @@ -625,31 +720,40 @@ return /******/ (function(modules) { // webpackBootstrap }; }, _toggleSelectAll: function _toggleSelectAll() { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newIsSelectAllChecked = !this.state.isSelectAllChecked, newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); + var self = this; forEach(visibleRows, function (row) { - this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); + self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); }, this); this.setState({ isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _toggleSelectRow: function _toggleSelectRow(row, isChecked) { - var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); + var newIsSelectAllChecked = this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)); + this.setState({ - isSelectAllChecked: this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), + isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); + + if (this.props.onSelectionChange) { + this.props.onSelectionChange(newSelectedRowIds, newIsSelectAllChecked); + } }, _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { @@ -673,23 +777,7 @@ return /******/ (function(modules) { // webpackBootstrap }, _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { - var i, isFound; - - if (selectedRowIds.length !== visibleRowIds.length) { - return false; - } - - for (i = 0; i < selectedRowIds.length; i++) { - isFound = find(visibleRowIds, function (visibleRowId) { - return selectedRowIds[i] === visibleRowId; - }); - - if (isFound === undefined) { - return false; - } - } - - return true; + return visibleRowIds.length === intersection(visibleRowIds, selectedRowIds).length; }, _getIsRowChecked: function _getIsRowChecked(row) { @@ -715,7 +803,6 @@ return /******/ (function(modules) { // webpackBootstrap }) ? false : this.props.isMultipleSelection, //does not support subgrids toggleSelectAll: this._toggleSelectAll, getIsSelectAllChecked: this._getIsSelectAllChecked, - toggleSelectRow: this._toggleSelectRow, getSelectedRowIds: this.getSelectedRowIds, getIsRowChecked: this._getIsRowChecked @@ -754,7 +841,7 @@ return /******/ (function(modules) { // webpackBootstrap }; }, getFilter: function getFilter() { - return this.props.showFilter && this.props.useCustomGridComponent === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; + return this.props.showFilter && this.shouldUseCustomGridComponent() === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; }, getSettings: function getSettings() { return this.props.showSettings ? React.createElement('button', { type: 'button', className: this.props.settingsToggleClassName, onClick: this.toggleColumnChooser, @@ -779,17 +866,17 @@ return /******/ (function(modules) { // webpackBootstrap return React.createElement('div', { className: 'top-section', style: topContainerStyles }, React.createElement('div', { className: 'griddle-filter', style: filterStyles }, filter), React.createElement('div', { className: 'griddle-settings-toggle', style: settingsStyles }, settings)); }, getPagingSection: function getPagingSection(currentPage, maxPage) { - if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.props.useCustomGridComponent) === false) { + if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.shouldUseCustomGridComponent()) === false) { return undefined; } - return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); + return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { customPagerComponentOptions: this.props.customPagerComponentOptions, next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); }, getColumnSelectorSection: function getColumnSelectorSection(keys, cols) { return this.state.showColumnChooser ? React.createElement(GridSettings, { columns: keys, selectedColumns: cols, setColumns: this.setColumns, settingsText: this.props.settingsText, settingsIconComponent: this.props.settingsIconComponent, maxRowsText: this.props.maxRowsText, setPageSize: this.setPageSize, - showSetPageSize: !this.props.useCustomGridComponent, resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, - toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.props.useCustomRowComponent || this.props.useCustomGridComponent, + showSetPageSize: !this.shouldUseCustomGridComponent(), resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, + toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.shouldUseCustomRowComponent() || this.shouldUseCustomGridComponent(), useGriddleStyles: this.props.useGriddleStyles, enableCustomFormatText: this.props.enableCustomFormatText, columnMetadata: this.props.columnMetadata }) : ""; }, getCustomGridSection: function getCustomGridSection() { @@ -838,12 +925,16 @@ return /******/ (function(modules) { // webpackBootstrap externalLoadingComponent: this.props.externalLoadingComponent, externalIsLoading: this.props.externalIsLoading, hasMorePages: hasMorePages, - onRowClick: this.props.onRowClick })); + onRowClick: this.props.onRowClick, + onRowMouseEnter: this.props.onRowMouseEnter, + onRowMouseLeave: this.props.onRowMouseLeave, + onRowWillMount: this.props.onRowWillMount, + onRowWillUnmount: this.props.onRowWillUnmount })); }, getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) { - if (this.props.useCustomGridComponent && this.props.customGridComponent !== null) { + if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) { return this.getCustomGridSection(); - } else if (this.props.useCustomRowComponent) { + } else if (this.shouldUseCustomRowComponent()) { return this.getCustomRowSection(data, cols, meta, pagingContent, globalData); } else { return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages); @@ -851,11 +942,15 @@ return /******/ (function(modules) { // webpackBootstrap }, getNoDataSection: function getNoDataSection() { if (this.props.customNoDataComponent != null) { - return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, null)); + return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, this.props.customNoDataComponentProps)); } return React.createElement(GridNoData, { noDataMessage: this.props.noDataMessage }); }, shouldShowNoDataSection: function shouldShowNoDataSection(results) { + if (this.props.allowEmptyGrid) { + return false; + } + return this.props.useExternal === false && (typeof results === 'undefined' || results.length === 0) || this.props.useExternal === true && this.props.externalIsLoading === false && results.length === 0; }, render: function render() { @@ -873,14 +968,22 @@ return /******/ (function(modules) { // webpackBootstrap var keys = []; var cols = this.columnSettings.getColumns(); - //figure out which columns are displayed and show only those var data = this.getDataForRender(results, cols, true); var meta = this.columnSettings.getMetadataColumns(); - // Grab the column keys from the first results - keys = deep.keys(omit(results[0], meta)); + if (this.props.columnMetadata) { + // Get column keys from column metadata + forEach(this.props.columnMetadata, function (meta) { + if (!(typeof meta.visible === 'boolean' && meta.visible === false)) { + keys.push(meta.columnName); + } + }); + } else { + // Grab the column keys from the first results + keys = deep.keys(omit(results[0], meta)); + } // sort keys by order keys = this.columnSettings.orderColumns(keys); @@ -901,7 +1004,7 @@ return /******/ (function(modules) { // webpackBootstrap var gridClassName = this.props.gridClassName.length > 0 ? "griddle " + this.props.gridClassName : "griddle"; //add custom to the class name so we can style it differently - gridClassName += this.props.useCustomRowComponent ? " griddle-custom" : ""; + gridClassName += this.shouldUseCustomRowComponent() ? " griddle-custom" : ""; return React.createElement('div', { className: gridClassName }, topSection, columnSelector, React.createElement('div', { className: 'griddle-container', style: this.props.useGriddleStyles && !this.props.isSubGriddle ? { border: "1px solid #DDD" } : null }, resultContent)); } @@ -920,10 +1023,9 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var GridTitle = __webpack_require__(6); - var GridRowContainer = __webpack_require__(24); - var ColumnProperties = __webpack_require__(8); - var RowProperties = __webpack_require__(26); - var _ = __webpack_require__(7); + var GridRowContainer = __webpack_require__(168); + var ColumnProperties = __webpack_require__(7); + var RowProperties = __webpack_require__(175); var GridTable = React.createClass({ displayName: 'GridTable', @@ -955,7 +1057,11 @@ return /******/ (function(modules) { // webpackBootstrap "parentRowExpandedComponent": "▼", "externalLoadingComponent": null, "externalIsLoading": false, - "onRowClick": null + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null }; }, getInitialState: function getInitialState() { @@ -1075,13 +1181,18 @@ return /******/ (function(modules) { // webpackBootstrap rowHeight: that.props.rowHeight, hasChildren: hasChildren, tableClassName: that.props.className, - onRowClick: that.props.onRowClick + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount }); }); // no data section if (this.props.showNoData) { - nodes.push(React.createElement('tr', { key: 'no-data-section' }, React.createElement('td', null, this.props.noDataSection))); + var colSpan = this.props.columnSettings.getVisibleColumnCount(); + nodes.push(React.createElement('tr', { key: 'no-data-section' }, React.createElement('td', { colSpan: colSpan }, this.props.noDataSection))); } // Add the spacer rows for nodes we're not rendering. @@ -1145,10 +1256,10 @@ return /******/ (function(modules) { // webpackBootstrap textAlign: "center", paddingBottom: "40px" }; - - defaultColSpan = this.props.columnSettings.getVisibleColumnCount(); } + defaultColSpan = this.props.columnSettings.getVisibleColumnCount(); + var loadingComponent = this.props.externalLoadingComponent ? React.createElement(this.props.externalLoadingComponent, null) : React.createElement('div', null, 'Loading...'); loadingContent = React.createElement('tbody', null, React.createElement('tr', null, React.createElement('td', { style: defaultLoadingStyle, colSpan: defaultColSpan }, loadingComponent))); @@ -1170,9 +1281,9 @@ return /******/ (function(modules) { // webpackBootstrap var pagingContent = React.createElement('tbody', null); if (this.props.showPager) { var pagingStyles = this.props.useGriddleStyles ? { - "padding": "0", + padding: "0px", backgroundColor: "#EDEDED", - border: "0", + border: "0px", color: "#222", height: this.props.showNoData ? "20px" : null } : null; @@ -1199,123 +1310,132 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ 'use strict'; var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i];for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - }return target; + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; }; var React = __webpack_require__(2); - var _ = __webpack_require__(7); - var ColumnProperties = __webpack_require__(8); + var ColumnProperties = __webpack_require__(7); + var assign = __webpack_require__(163); var DefaultHeaderComponent = React.createClass({ - displayName: 'DefaultHeaderComponent', + displayName: 'DefaultHeaderComponent', - render: function render() { - return React.createElement('span', null, this.props.displayName); - } + render: function render() { + return React.createElement('span', null, this.props.displayName); + } }); var GridTitle = React.createClass({ - displayName: 'GridTitle', + displayName: 'GridTitle', - getDefaultProps: function getDefaultProps() { - return { - "columnSettings": null, - "filterByColumn": function filterByColumn() {}, - "rowSettings": null, - "sortSettings": null, - "multipleSelectionSettings": null, - "headerStyle": null, - "useGriddleStyles": true, - "useGriddleIcons": true, - "headerStyles": {} - }; - }, - componentWillMount: function componentWillMount() { - this.verifyProps(); - }, - sort: function sort(column) { - var that = this; - return function (event) { - that.props.sortSettings.changeSort(column); - }; - }, - toggleSelectAll: function toggleSelectAll(event) { - this.props.multipleSelectionSettings.toggleSelectAll(); - }, - handleSelectionChange: function handleSelectionChange(event) { - //hack to get around warning message that's not helpful in this case - return; - }, - verifyProps: function verifyProps() { - if (this.props.columnSettings === null) { - console.error("gridTitle: The columnSettings prop is null and it shouldn't be"); - } + getDefaultProps: function getDefaultProps() { + return { + "columnSettings": null, + "filterByColumn": function filterByColumn() {}, + "rowSettings": null, + "sortSettings": null, + "multipleSelectionSettings": null, + "headerStyle": null, + "useGriddleStyles": true, + "useGriddleIcons": true, + "headerStyles": {} + }; + }, + componentWillMount: function componentWillMount() { + this.verifyProps(); + }, + sort: function sort(column) { + var that = this; + return function (event) { + that.props.sortSettings.changeSort(column); + }; + }, + toggleSelectAll: function toggleSelectAll(event) { + this.props.multipleSelectionSettings.toggleSelectAll(); + }, + handleSelectionChange: function handleSelectionChange(event) { + //hack to get around warning message that's not helpful in this case + return; + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridTitle: The columnSettings prop is null and it shouldn't be"); + } - if (this.props.sortSettings === null) { - console.error("gridTitle: The sortSettings prop is null and it shouldn't be"); - } - }, - render: function render() { - this.verifyProps(); - var that = this; - var titleStyles = null; - - var nodes = this.props.columnSettings.getColumns().map(function (col, index) { - var columnSort = ""; - var columnIsSortable = that.props.columnSettings.getMetadataColumnProperty(col, "sortable", true); - var sortComponent = columnIsSortable ? that.props.sortSettings.sortDefaultComponent : null; - - if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortAscending) { - columnSort = that.props.sortSettings.sortAscendingClassName; - sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortAscendingComponent; - } else if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortAscending === false) { - columnSort += that.props.sortSettings.sortDescendingClassName; - sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortDescendingComponent; - } + if (this.props.sortSettings === null) { + console.error("gridTitle: The sortSettings prop is null and it shouldn't be"); + } + }, + render: function render() { + this.verifyProps(); + var that = this; + var titleStyles = {}; + + var nodes = this.props.columnSettings.getColumns().map(function (col, index) { + var defaultTitleStyles = {}; + var columnSort = ""; + var columnIsSortable = that.props.columnSettings.getMetadataColumnProperty(col, "sortable", true); + var sortComponent = columnIsSortable ? that.props.sortSettings.sortDefaultComponent : null; + + if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'asc') { + columnSort = that.props.sortSettings.sortAscendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortAscendingComponent; + } else if (that.props.sortSettings.sortColumn == col && that.props.sortSettings.sortDirection === 'desc') { + columnSort += that.props.sortSettings.sortDescendingClassName; + sortComponent = that.props.useGriddleIcons && that.props.sortSettings.sortDescendingComponent; + } - var meta = that.props.columnSettings.getColumnMetadataByName(col); - var displayName = that.props.columnSettings.getMetadataColumnProperty(col, "displayName", col); - var HeaderComponent = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponent", DefaultHeaderComponent); - var headerProps = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponentProps", {}); - - columnSort = meta == null ? columnSort : (columnSort && columnSort + " " || columnSort) + that.props.columnSettings.getMetadataColumnProperty(col, "cssClassName", ""); - - if (that.props.useGriddleStyles) { - titleStyles = { - backgroundColor: "#EDEDEF", - border: "0", - borderBottom: "1px solid #DDD", - color: "#222", - padding: "5px", - cursor: columnIsSortable ? "pointer" : "default" - }; - } + var meta = that.props.columnSettings.getColumnMetadataByName(col); + var displayName = that.props.columnSettings.getMetadataColumnProperty(col, "displayName", col); + var HeaderComponent = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponent", DefaultHeaderComponent); + var headerProps = that.props.columnSettings.getMetadataColumnProperty(col, "customHeaderComponentProps", {}); + + columnSort = meta == null ? columnSort : (columnSort && columnSort + " " || columnSort) + that.props.columnSettings.getMetadataColumnProperty(col, "cssClassName", ""); + + if (that.props.useGriddleStyles) { + defaultTitleStyles = { + backgroundColor: "#EDEDEF", + border: "0px", + borderBottom: "1px solid #DDD", + color: "#222", + padding: "5px", + cursor: columnIsSortable ? "pointer" : "default" + }; + } + titleStyles = meta && meta.titleStyles ? assign({}, defaultTitleStyles, meta.titleStyles) : assign({}, defaultTitleStyles); - return React.createElement('th', { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: displayName, style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); - }); + var ComponentClass = displayName ? 'th' : 'td'; + return React.createElement(ComponentClass, { onClick: columnIsSortable ? that.sort(col) : null, 'data-title': col, className: columnSort, key: col, + style: titleStyles }, React.createElement(HeaderComponent, _extends({ columnName: col, displayName: displayName, + filterByColumn: that.props.filterByColumn }, headerProps)), sortComponent); + }); - if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { - nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles }, React.createElement('input', { type: 'checkbox', checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), onChange: this.handleSelectionChange }))); - } + if (nodes && this.props.multipleSelectionSettings.isMultipleSelection) { + nodes.unshift(React.createElement('th', { key: 'selection', onClick: this.toggleSelectAll, style: titleStyles, className: 'griddle-select griddle-select-title' }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsSelectAllChecked(), + onChange: this.handleSelectionChange + }))); + } - //Get the row from the row settings. - var className = that.props.rowSettings && that.props.rowSettings.getHeaderRowMetadataClass() || null; + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getHeaderRowMetadataClass() || null; - return React.createElement('thead', null, React.createElement('tr', { - className: className, - style: this.props.headerStyles }, nodes)); - } + return React.createElement('thead', null, React.createElement('tr', { + className: className, + style: this.props.headerStyles }, nodes)); + } }); module.exports = GridTitle; @@ -1324,2515 +1444,2062 @@ return /******/ (function(modules) { // webpackBootstrap /* 7 */ /***/ function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.6.0 - // http://underscorejs.org - // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - // Underscore may be freely distributed under the MIT license. - 'use strict'; - (function () { - - // Baseline setup - // -------------- + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } - // Save the previous value of the `_` variable. - var previousUnderscore = root._; + var map = __webpack_require__(8); + var filter = __webpack_require__(130); + var find = __webpack_require__(132); + var sortBy = __webpack_require__(139); + var difference = __webpack_require__(155); - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; + var ColumnProperties = (function () { + function ColumnProperties() { + var allColumns = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + var filteredColumns = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; + var childrenColumnName = arguments.length <= 2 || arguments[2] === undefined ? "children" : arguments[2]; + var columnMetadata = arguments.length <= 3 || arguments[3] === undefined ? [] : arguments[3]; + var metadataColumns = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, - ObjProto = Object.prototype, - FuncProto = Function.prototype; + _classCallCheck(this, ColumnProperties); - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; + this.allColumns = allColumns; + this.filteredColumns = filteredColumns; + this.childrenColumnName = childrenColumnName; + this.columnMetadata = columnMetadata; + this.metadataColumns = metadataColumns; + } - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; + _createClass(ColumnProperties, [{ + key: 'getMetadataColumns', + value: function getMetadataColumns() { + var meta = map(filter(this.columnMetadata, { visible: false }), function (item) { + return item.columnName; + }); + if (meta.indexOf(this.childrenColumnName) < 0) { + meta.push(this.childrenColumnName); + } + return meta.concat(this.metadataColumns); + } + }, { + key: 'getVisibleColumnCount', + value: function getVisibleColumnCount() { + return this.getColumns().length; + } + }, { + key: 'getColumnMetadataByName', + value: function getColumnMetadataByName(name) { + return find(this.columnMetadata, { columnName: name }); + } + }, { + key: 'hasColumnMetadata', + value: function hasColumnMetadata() { + return this.columnMetadata !== null && this.columnMetadata.length > 0; + } + }, { + key: 'getMetadataColumnProperty', + value: function getMetadataColumnProperty(columnName, propertyName, defaultValue) { + var meta = this.getColumnMetadataByName(columnName); - // Create a safe reference to the Underscore object for use below. - var _ = function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; + //send back the default value if meta isn't there + if (typeof meta === "undefined" || meta === null) return defaultValue; - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (true) { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; + return meta.hasOwnProperty(propertyName) ? meta[propertyName] : defaultValue; } - exports._ = _; - } else { - root._ = _; - } + }, { + key: 'orderColumns', + value: function orderColumns(cols) { + var _this = this; - // Current version. - _.VERSION = '1.6.0'; + var ORDER_MAX = 100; - // Collection Functions - // -------------------- + var orderedColumns = sortBy(cols, function (item) { + var metaItem = find(_this.columnMetadata, { columnName: item }); - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function (obj, iterator, context) { - if (obj == null) return obj; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; - } + if (typeof metaItem === 'undefined' || metaItem === null || isNaN(metaItem.order)) { + return ORDER_MAX; + } + + return metaItem.order; + }); + + return orderedColumns; } - return obj; - }; + }, { + key: 'getColumns', + value: function getColumns() { + //if we didn't set default or filter + var filteredColumns = this.filteredColumns.length === 0 ? this.allColumns : this.filteredColumns; - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function (obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function (value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; + filteredColumns = difference(filteredColumns, this.metadataColumns); - var reduceError = 'Reduce of empty array with no initial value'; + filteredColumns = this.orderColumns(filteredColumns); - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function (obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + return filteredColumns; } - each(obj, function (value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; + }]); - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function (obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function (value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function (obj, predicate, context) { - var result; - any(obj, function (value, index, list) { - if (predicate.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function (obj, predicate, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); - each(obj, function (value, index, list) { - if (predicate.call(context, value, index, list)) results.push(value); - }); - return results; - }; + return ColumnProperties; + })(); - // Return all the elements for which a truth test fails. - _.reject = function (obj, predicate, context) { - return _.filter(obj, function (value, index, list) { - return !predicate.call(context, value, index, list); - }, context); - }; + module.exports = ColumnProperties; - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function (obj, predicate, context) { - predicate || (predicate = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); - each(obj, function (value, index, list) { - if (!(result = result && predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function (obj, predicate, context) { - predicate || (predicate = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); - each(obj, function (value, index, list) { - if (result || (result = predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; + 'use strict'; - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function (obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function (value) { - return value === target; - }); - }; + var arrayMap = __webpack_require__(9), + baseIteratee = __webpack_require__(10), + baseMap = __webpack_require__(124), + isArray = __webpack_require__(73); - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function (obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function (value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, baseIteratee(iteratee, 3)); + } - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function (obj, key) { - return _.map(obj, _.property(key)); - }; + module.exports = map; - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function (obj, attrs) { - return _.filter(obj, _.matches(attrs)); - }; +/***/ }, +/* 9 */ +/***/ function(module, exports) { - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function (obj, attrs) { - return _.find(obj, _.matches(attrs)); - }; + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + "use strict"; - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) - _.max = function (obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - var result = -Infinity, - lastComputed = -Infinity; - each(obj, function (value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed > lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); - // Return the minimum element (or element-based computation). - _.min = function (obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - var result = Infinity, - lastComputed = Infinity; - each(obj, function (value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed < lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } - // Shuffle an array, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function (obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function (value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; + module.exports = arrayMap; - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function (obj, n, guard) { - if (n == null || guard) { - if (obj.length !== +obj.length) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { - // An internal function to generate lookup iterators. - var lookupIterator = function lookupIterator(value) { - if (value == null) return _.identity; - if (_.isFunction(value)) return value; - return _.property(value); - }; + 'use strict'; - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function (obj, iterator, context) { - iterator = lookupIterator(iterator); - return _.pluck(_.map(obj, function (value, index, list) { - return { - value: value, - index: index, - criteria: iterator.call(context, value, index, list) - }; - }).sort(function (left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; + var baseMatches = __webpack_require__(11), + baseMatchesProperty = __webpack_require__(105), + identity = __webpack_require__(120), + isArray = __webpack_require__(73), + property = __webpack_require__(121); - // An internal function used for aggregate "group by" operations. - var group = function group(behavior) { - return function (obj, iterator, context) { - var result = {}; - iterator = lookupIterator(iterator); - each(obj, function (value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - }; + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + return property(value); + } - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function (result, key, value) { - _.has(result, key) ? result[key].push(value) : result[key] = [value]; - }); + module.exports = baseIteratee; - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function (result, key, value) { - result[key] = value; - }); +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function (result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; - }); + 'use strict'; - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function (array, obj, iterator, context) { - iterator = lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, - high = array.length; - while (low < high) { - var mid = low + high >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; + var baseIsMatch = __webpack_require__(12), + getMatchData = __webpack_require__(102), + matchesStrictComparable = __webpack_require__(104); - // Safely create a real, live array from anything iterable. - _.toArray = function (obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function (object) { + return object === source || baseIsMatch(object, source, matchData); }; + } - // Return the number of elements in an object. - _.size = function (obj) { - if (obj == null) return 0; - return obj.length === +obj.length ? obj.length : _.keys(obj).length; - }; + module.exports = baseMatches; - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function (array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - if (n < 0) return []; - return slice.call(array, 0, n); - }; +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function (array, n, guard) { - return slice.call(array, 0, array.length - (n == null || guard ? 1 : n)); - }; + 'use strict'; - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function (array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return slice.call(array, Math.max(array.length - n, 0)); - }; + var Stack = __webpack_require__(13), + baseIsEqual = __webpack_require__(57); - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function (array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; - // Trim out all falsy values from an array. - _.compact = function (array) { - return _.filter(array, _.identity); - }; + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; - // Internal implementation of a recursive `flatten` function. - var flatten = function flatten(input, shallow, output) { - if (shallow && _.every(input, _.isArray)) { - return concat.apply(output, input); + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; } - each(input, function (value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; } - }); - return output; - }; + } else { + var stack = new Stack(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) { + return false; + } + } + } + return true; + } - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function (array, shallow) { - return flatten(array, shallow, []); - }; + module.exports = baseIsMatch; - // Return a version of the array that does not contain the specified value(s). - _.without = function (array) { - return _.difference(array, slice.call(arguments, 1)); - }; +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { - // Split an array into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function (array, predicate) { - var pass = [], - fail = []; - each(array, function (elem) { - (predicate(elem) ? pass : fail).push(elem); - }); - return [pass, fail]; - }; + 'use strict'; - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function (array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function (value, index) { - if (isSorted ? !index || seen[seen.length - 1] !== value : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; + var ListCache = __webpack_require__(14), + stackClear = __webpack_require__(22), + stackDelete = __webpack_require__(23), + stackGet = __webpack_require__(24), + stackHas = __webpack_require__(25), + stackSet = __webpack_require__(26); - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function () { - return _.uniq(_.flatten(arguments, true)); - }; + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function (array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function (item) { - return _.every(rest, function (other) { - return _.contains(other, item); - }); - }); - }; + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function (array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function (value) { - return !_.contains(rest, value); - }); - }; + module.exports = Stack; - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function () { - var length = _.max(_.pluck(arguments, 'length').concat(0)); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, '' + i); - } - return results; - }; +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function (list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; + 'use strict'; - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function (array, item, isSorted) { - if (array == null) return -1; - var i = 0, - length = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function (array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = hasIndex ? from : array.length; - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function (start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; + var listCacheClear = __webpack_require__(15), + listCacheDelete = __webpack_require__(16), + listCacheGet = __webpack_require__(19), + listCacheHas = __webpack_require__(20), + listCacheSet = __webpack_require__(21); - var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - while (idx < length) { - range[idx++] = start; - start += step; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } + } - return range; - }; + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function ctor() {}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function (func, context) { - var args, bound; - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError(); - args = slice.call(arguments, 2); - return bound = function () { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor(); - ctor.prototype = null; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; + module.exports = ListCache; - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function (func) { - var boundArgs = slice.call(arguments, 1); - return function () { - var position = 0; - var args = boundArgs.slice(); - for (var i = 0, length = args.length; i < length; i++) { - if (args[i] === _) args[i] = arguments[position++]; - } - while (position < arguments.length) args.push(arguments[position++]); - return func.apply(this, args); - }; - }; +/***/ }, +/* 15 */ +/***/ function(module, exports) { - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function (obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) throw new Error('bindAll must be passed function names'); - each(funcs, function (f) { - obj[f] = _.bind(obj[f], obj); - }); - return obj; - }; + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + "use strict"; - // Memoize an expensive function by storing its results. - _.memoize = function (func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function () { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : memo[key] = func.apply(this, arguments); - }; - }; + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function (func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function () { - return func.apply(null, args); - }, wait); - }; + module.exports = listCacheClear; - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function (func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function (func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - options || (options = {}); - var later = function later() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - context = args = null; - }; - return function () { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; + 'use strict'; - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function (func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function later() { - var last = _.now() - timestamp; - if (last < wait) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - context = args = null; - } - } - }; + var assocIndexOf = __webpack_require__(17); - return function () { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } - if (callNow) { - result = func.apply(context, args); - context = args = null; - } + /** Used for built-in method references. */ + var arrayProto = Array.prototype; - return result; - }; - }; + /** Built-in value references. */ + var splice = arrayProto.splice; - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function (func) { - var ran = false, - memo; - return function () { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function (func, wrapper) { - return _.partial(wrapper, func); - }; + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function () { - var funcs = arguments; - return function () { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; + module.exports = listCacheDelete; - // Returns a function that will only be executed after being called N times. - _.after = function (times, func) { - return function () { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function (obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - return keys; - }; + 'use strict'; - // Retrieve the values of an object's properties. - _.values = function (obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; + var eq = __webpack_require__(18); - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function (obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = new Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; } - return pairs; - }; + } + return -1; + } - // Invert the keys and values of an object. The values must be serializable. - _.invert = function (obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; + module.exports = assocIndexOf; - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function (obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; +/***/ }, +/* 18 */ +/***/ function(module, exports) { - // Extend a given object with all the properties in passed-in object(s). - _.extend = function (obj) { - each(slice.call(arguments, 1), function (source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + "use strict"; - // Return a copy of the object only containing the whitelisted properties. - _.pick = function (obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function (key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; + function eq(value, other) { + return value === other || value !== value && other !== other; + } - // Return a copy of the object without the blacklisted properties. - _.omit = function (obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; + module.exports = eq; - // Fill in a given object with default properties. - _.defaults = function (obj) { - each(slice.call(arguments, 1), function (source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - }); - return obj; - }; +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { - // Create a (shallow-cloned) duplicate of an object. - _.clone = function (obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; + 'use strict'; - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function (obj, interceptor) { - interceptor(obj); - return obj; - }; + var assocIndexOf = __webpack_require__(17); - // Internal recursive comparison function for `isEqual`. - var eq = function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, - bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && 'constructor' in a && 'constructor' in b) { - return false; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, - result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && ! size--) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function (a, b) { - return eq(a, b, [], []); - }; + return index < 0 ? undefined : data[index][1]; + } - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function (obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; + module.exports = listCacheGet; - // Is a given value a DOM element? - _.isElement = function (obj) { - return !!(obj && obj.nodeType === 1); - }; +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function (obj) { - return toString.call(obj) == '[object Array]'; - }; + 'use strict'; - // Is a given variable an object? - _.isObject = function (obj) { - return obj === Object(obj); - }; + var assocIndexOf = __webpack_require__(17); - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function (name) { - _['is' + name] = function (obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function (obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } + module.exports = listCacheHas; - // Optimize `isFunction` if appropriate. - if (true) { - _.isFunction = function (obj) { - return typeof obj === 'function'; - }; - } +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { - // Is a given object a finite number? - _.isFinite = function (obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; + 'use strict'; - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function (obj) { - return _.isNumber(obj) && obj != +obj; - }; + var assocIndexOf = __webpack_require__(17); - // Is a given value a boolean? - _.isBoolean = function (obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Is a given value equal to null? - _.isNull = function (obj) { - return obj === null; - }; + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } - // Is a given variable undefined? - _.isUndefined = function (obj) { - return obj === void 0; - }; + module.exports = listCacheSet; - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function (obj, key) { - return hasOwnProperty.call(obj, key); - }; +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { - // Utility Functions - // ----------------- + 'use strict'; - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function () { - root._ = previousUnderscore; - return this; - }; + var ListCache = __webpack_require__(14); - // Keep the identity function around for default iterators. - _.identity = function (value) { - return value; - }; + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache(); + this.size = 0; + } - _.constant = function (value) { - return function () { - return value; - }; - }; + module.exports = stackClear; - _.property = function (key) { - return function (obj) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of `key:value` pairs. - _.matches = function (attrs) { - return function (obj) { - if (obj === attrs) return true; //avoid comparing an object to itself. - for (var key in attrs) { - if (attrs[key] !== obj[key]) return false; - } - return true; - }; - }; - - // Run a function **n** times. - _.times = function (n, iterator, context) { - var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function (min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function () { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function (method) { - _[method] = function (string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function (match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function (object, property) { - if (object == null) return void 0; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function (obj) { - each(_.functions(obj), function (name) { - var func = _[name] = obj[name]; - _.prototype[name] = function () { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function (prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; +/***/ }, +/* 23 */ +/***/ function(module, exports) { - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function (text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + 'use strict'; - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g'); + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function (match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, function (match) { - return '\\' + escapes[match]; - }); + this.size = data.size; + return result; + } - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; + module.exports = stackDelete; - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; +/***/ }, +/* 24 */ +/***/ function(module, exports) { - source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n"; + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + "use strict"; - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } + function stackGet(key) { + return this.__data__.get(key); + } - if (data) return render(data, _); - var template = function template(data) { - return render.call(this, data, _); - }; + module.exports = stackGet; - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; +/***/ }, +/* 25 */ +/***/ function(module, exports) { - return template; - }; + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + "use strict"; - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function (obj) { - return _(obj).chain(); - }; + function stackHas(key) { + return this.__data__.has(key); + } - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. + module.exports = stackHas; - // Helper function to continue chaining intermediate results. - var result = function result(obj) { - return this._chain ? _(obj).chain() : obj; - }; +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function (name) { - var method = ArrayProto[name]; - _.prototype[name] = function () { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); + 'use strict'; - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function (name) { - var method = ArrayProto[name]; - _.prototype[name] = function () { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); + var ListCache = __webpack_require__(14), + Map = __webpack_require__(27), + MapCache = __webpack_require__(42); - _.extend(_.prototype, { + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; - // Start chaining a wrapped Underscore object. - chain: function chain() { - this._chain = true; + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + this.size = ++data.size; return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function value() { - return this._wrapped; } - - }); - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { - return _; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + data = this.__data__ = new MapCache(pairs); } - }).call(undefined); + data.set(key, value); + this.size = data.size; + return this; + } + + module.exports = stackSet; /***/ }, -/* 8 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var _createClass = (function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); - } - }return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; - }; - })(); + var getNative = __webpack_require__(28), + root = __webpack_require__(33); - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } + /* Built-in method references that are verified to be native. */ + var Map = getNative(root, 'Map'); - var map = __webpack_require__(9); - var filter = __webpack_require__(13); - var find = __webpack_require__(15); - var sortBy = __webpack_require__(18); - var difference = __webpack_require__(21); + module.exports = Map; - var ColumnProperties = (function () { - function ColumnProperties() { - var allColumns = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; - var filteredColumns = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; - var childrenColumnName = arguments.length <= 2 || arguments[2] === undefined ? "children" : arguments[2]; - var columnMetadata = arguments.length <= 3 || arguments[3] === undefined ? [] : arguments[3]; - var metadataColumns = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { - _classCallCheck(this, ColumnProperties); + 'use strict'; - this.allColumns = allColumns; - this.filteredColumns = filteredColumns; - this.childrenColumnName = childrenColumnName; - this.columnMetadata = columnMetadata; - this.metadataColumns = metadataColumns; - } + var baseIsNative = __webpack_require__(29), + getValue = __webpack_require__(41); - _createClass(ColumnProperties, [{ - key: 'getMetadataColumns', - value: function getMetadataColumns() { - var meta = map(filter(this.columnMetadata, { visible: false }), function (item) { - return item.columnName; - }); - if (meta.indexOf(this.childrenColumnName) < 0) { - meta.push(this.childrenColumnName); - } - return meta.concat(this.metadataColumns); - } - }, { - key: 'getVisibleColumnCount', - value: function getVisibleColumnCount() { - return this.getColumns().length; - } - }, { - key: 'getColumnMetadataByName', - value: function getColumnMetadataByName(name) { - return find(this.columnMetadata, { columnName: name }); - } - }, { - key: 'hasColumnMetadata', - value: function hasColumnMetadata() { - return this.columnMetadata !== null && this.columnMetadata.length > 0; - } - }, { - key: 'getMetadataColumnProperty', - value: function getMetadataColumnProperty(columnName, propertyName, defaultValue) { - var meta = this.getColumnMetadataByName(columnName); + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } - //send back the default value if meta isn't there - if (typeof meta === "undefined" || meta === null) return defaultValue; + module.exports = getNative; - return meta.hasOwnProperty(propertyName) ? meta[propertyName] : defaultValue; - } - }, { - key: 'orderColumns', - value: function orderColumns(cols) { - var _this = this; +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { - var ORDER_MAX = 100; + 'use strict'; - var orderedColumns = sortBy(cols, function (item) { - var metaItem = find(_this.columnMetadata, { columnName: item }); + var isFunction = __webpack_require__(30), + isMasked = __webpack_require__(38), + isObject = __webpack_require__(37), + toSource = __webpack_require__(40); - if (typeof metaItem === 'undefined' || metaItem === null || isNaN(metaItem.order)) { - return ORDER_MAX; - } + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - return metaItem.order; - }); + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; - return orderedColumns; - } - }, { - key: 'getColumns', - value: function getColumns() { - //if we didn't set default or filter - var filteredColumns = this.filteredColumns.length === 0 ? this.allColumns : this.filteredColumns; + /** Used for built-in method references. */ + var funcProto = Function.prototype, + objectProto = Object.prototype; - filteredColumns = difference(filteredColumns, this.metadataColumns); + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; - filteredColumns = this.orderColumns(filteredColumns); + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; - return filteredColumns; - } - }]); + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); - return ColumnProperties; - })(); + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } - module.exports = ColumnProperties; + module.exports = baseIsNative; /***/ }, -/* 9 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.2.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseEach = __webpack_require__(10), - baseIteratee = __webpack_require__(11); + var baseGetTag = __webpack_require__(31), + isObject = __webpack_require__(37); - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; + /** `Object#toString` result references. */ + var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + module.exports = isFunction; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Symbol = __webpack_require__(32), + getRawTag = __webpack_require__(35), + objectToString = __webpack_require__(36); /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * The base implementation of `getTag` without fallbacks for buggy environments. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } + module.exports = baseGetTag; + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var root = __webpack_require__(33); + + /** Built-in value references. */ + var Symbol = root.Symbol; + + module.exports = Symbol; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var freeGlobal = __webpack_require__(34); + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + module.exports = root; + +/***/ }, +/* 34 */ +/***/ function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ + 'use strict'; + + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + module.exports = freeGlobal; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Symbol = __webpack_require__(32); + /** Used for built-in method references. */ var objectProto = Object.prototype; + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ - var objectToString = objectProto.toString; + var nativeObjectToString = objectProto.toString; + + /** Built-in value references. */ + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** - * The base implementation of `_.map` without support for iteratee shorthands. + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - baseEach(collection, function (value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } return result; } - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } + module.exports = getRawTag; + +/***/ }, +/* 36 */ +/***/ function(module, exports) { + + /** Used for built-in method references. */ + "use strict"; + + var objectProto = Object.prototype; /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. */ - var getLength = baseProperty('length'); + var nativeObjectToString = objectProto.toString; /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; + * Converts `value` to a string using `Object.prototype.toString`. * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee, 3)); + function objectToString(value) { + return nativeObjectToString.call(value); } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; + module.exports = objectToString; + +/***/ }, +/* 37 */ +/***/ function(module, exports) { /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * - * _.isArrayLike([1, 2, 3]); + * _.isObject({}); * // => true * - * _.isArrayLike(document.body.children); + * _.isObject([1, 2, 3]); * // => true * - * _.isArrayLike('abc'); + * _.isObject(_.noop); * // => true * - * _.isArrayLike(_.noop); + * _.isObject(null); * // => false */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + 'use strict'; + + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); } + module.exports = isObject; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var coreJsData = __webpack_require__(39); + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function () { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? 'Symbol(src)_1.' + uid : ''; + })(); + /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example + * Checks if `func` has its source masked. * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; } - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } + module.exports = isMasked; - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { - module.exports = map; + 'use strict'; + + var root = __webpack_require__(33); + + /** Used to detect overreaching core-js shims. */ + var coreJsData = root['__core-js_shared__']; + + module.exports = coreJsData; /***/ }, -/* 10 */ +/* 40 */ /***/ function(module, exports) { - /** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used as references for various `Number` constants. */ + /** Used for built-in method references. */ 'use strict'; - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]'; + var funcProto = Function.prototype; - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. + * Converts `func` to its source code. * * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return func + ''; + } catch (e) {} } - return result; + return ''; } + module.exports = toSource; + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a valid array-like index. + * Gets the value at `key` of `object`. * * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } + "use strict"; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + function getValue(object, key) { + return object == null ? undefined : object[key]; + } - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = getValue; - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { - /** Built-in value references. */ - var getPrototypeOf = Object.getPrototypeOf, - propertyIsEnumerable = objectProto.propertyIsEnumerable; + 'use strict'; - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = Object.keys; + var mapCacheClear = __webpack_require__(43), + mapCacheDelete = __webpack_require__(51), + mapCacheGet = __webpack_require__(54), + mapCacheHas = __webpack_require__(55), + mapCacheSet = __webpack_require__(56); /** - * The base implementation of `_.forEach` without support for iteratee shorthands. + * Creates a map cache object to store key-value pairs. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - var baseEach = createBaseEach(baseForOwn); + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + module.exports = MapCache; + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Hash = __webpack_require__(44), + ListCache = __webpack_require__(14), + Map = __webpack_require__(27); /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. + * Removes all key-value entries from the map. * * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. + * @name clear + * @memberOf MapCache */ - var baseFor = createBaseFor(); + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash(), + 'map': new (Map || ListCache)(), + 'string': new Hash() + }; + } + + module.exports = mapCacheClear; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var hashClear = __webpack_require__(45), + hashDelete = __webpack_require__(47), + hashGet = __webpack_require__(48), + hashHas = __webpack_require__(49), + hashSet = __webpack_require__(50); /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. + * Creates a hash object. * * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + module.exports = Hash; + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var nativeCreate = __webpack_require__(46); + /** - * The base implementation of `_.has` without support for deep paths. + * Removes all key-value entries from the hash. * * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. + * @name clear + * @memberOf Hash */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || typeof object == 'object' && key in object && getPrototypeOf(object) === null; + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } + module.exports = hashClear; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getNative = __webpack_require__(28); + + /* Built-in method references that are verified to be native. */ + var nativeCreate = getNative(Object, 'create'); + + module.exports = nativeCreate; + +/***/ }, +/* 47 */ +/***/ function(module, exports) { + /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * Removes `key` and its value from the hash. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - function baseKeys(object) { - return nativeKeys(Object(object)); + "use strict"; + + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } + module.exports = hashDelete; + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var nativeCreate = __webpack_require__(46); + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * The base implementation of `_.property` without support for deep paths. + * Gets the hash value for `key`. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; } + module.exports = hashGet; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var nativeCreate = __webpack_require__(46); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Creates a `baseEach` or `baseEachRight` function. + * Checks if a hash value for `key` exists. * * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function createBaseEach(eachFunc, fromRight) { - return function (collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while (fromRight ? index-- : ++index < length) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } + module.exports = hashHas; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var nativeCreate = __webpack_require__(46); + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** - * Creates a base function for methods like `_.forIn`. + * Sets the hash `key` to `value`. * * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. */ - function createBaseFor(fromRight) { - return function (object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; + return this; } + module.exports = hashSet; + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getMapData = __webpack_require__(52); + /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. + * Removes `key` and its value from the map. * * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ - var getLength = baseProperty('length'); + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + module.exports = mapCacheDelete; + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isKeyable = __webpack_require__(53); /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. + * Gets the data for `map`. * * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } + module.exports = getMapData; + +/***/ }, +/* 53 */ +/***/ function(module, exports) { + /** - * Checks if `value` is likely a prototype object. + * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + 'use strict'; - return value === proto; + function isKeyable(value) { + var type = typeof value; + return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; } + module.exports = isKeyable; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getMapData = __webpack_require__(52); + /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true + * Gets the map value for `key`. * - * _.isArguments([1, 2, 3]); - * // => false + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + function mapCacheGet(key) { + return getMapData(this, key).get(key); } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; + module.exports = mapCacheGet; + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getMapData = __webpack_require__(52); /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true + * Checks if a map value for `key` exists. * - * _.isArrayLike(_.noop); - * // => false + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + function mapCacheHas(key) { + return getMapData(this, key).has(key); } + module.exports = mapCacheHas; + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getMapData = __webpack_require__(52); + /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false + * Sets the map `key` to `value`. * - * _.isArrayLikeObject(_.noop); - * // => false + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; } + module.exports = mapCacheSet; + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseIsEqualDeep = __webpack_require__(58), + isObjectLike = __webpack_require__(82); + /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. * - * _.isFunction(/abc/); - * // => false + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && !(skipIndexes && (key == 'length' || isIndex(key, length))) && !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; - } - - module.exports = baseEach; + module.exports = baseIsEqual; /***/ }, -/* 11 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(module, global) {/** - * lodash 4.5.2 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used as the size to enable large array optimizations. */ 'use strict'; - var LARGE_ARRAY_SIZE = 200; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; + var Stack = __webpack_require__(13), + equalArrays = __webpack_require__(59), + equalByTag = __webpack_require__(65), + equalObjects = __webpack_require__(69), + getTag = __webpack_require__(97), + isArray = __webpack_require__(73), + isBuffer = __webpack_require__(83), + isTypedArray = __webpack_require__(87); - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + objectTag = '[object Object]'; - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - - /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + /** Used for built-in method references. */ + var objectProto = Object.prototype; - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType ? exports : undefined; + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType ? module : undefined; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack()); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + module.exports = baseIsEqualDeep; - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); + 'use strict'; - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof undefined] && undefined); + var SetCache = __webpack_require__(60), + arraySome = __webpack_require__(63), + cacheHas = __webpack_require__(64); - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || freeWindow !== (thisGlobal && thisGlobal.window) && freeWindow || freeSelf || thisGlobal || Function('return this')(); + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; - while (++index < length) { - result[index] = iteratee(array[index], index, array); + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; } - return result; - } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined; - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; + stack.set(array, other); + stack.set(other, array); - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function (othValue, othIndex) { + if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + result = false; + break; } } - return false; + stack['delete'](array); + stack['delete'](other); + return result; } + module.exports = equalArrays; + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var MapCache = __webpack_require__(42), + setCacheAdd = __webpack_require__(61), + setCacheHas = __webpack_require__(62); + /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. + * + * Creates an array cache object to store unique values. * * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. + * @constructor + * @param {Array} [values] The values to cache. */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; - while (++index < n) { - result[index] = iteratee(index); - } - return result; + this.__data__ = new MapCache(); + while (++index < length) { + this.add(values[index]); + } } + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + module.exports = SetCache; + +/***/ }, +/* 61 */ +/***/ function(module, exports) { + + /** Used to stand-in for `undefined` hash values. */ + 'use strict'; + + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. + * Adds `value` to the array cache. * * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ - function baseToPairs(object, props) { - return arrayMap(props, function (key) { - return [key, object[key]]; - }); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } + module.exports = setCacheAdd; + +/***/ }, +/* 62 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a global object. + * Checks if `value` is in the array cache. * * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. */ - function checkGlobal(value) { - return value && value.Object === Object ? value : null; + "use strict"; + + function setCacheHas(value) { + return this.__data__.has(value); } + module.exports = setCacheHas; + +/***/ }, +/* 63 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a host object in IE < 9. + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} + "use strict"; + + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } } - return result; + return false; } + module.exports = arraySome; + +/***/ }, +/* 64 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a valid array-like index. + * Checks if a `cache` value for `key` exists. * * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; + "use strict"; + + function cacheHas(cache, key) { + return cache.has(key); + } + + module.exports = cacheHas; + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Symbol = __webpack_require__(32), + Uint8Array = __webpack_require__(66), + eq = __webpack_require__(18), + equalArrays = __webpack_require__(59), + mapToArray = __webpack_require__(67), + setToArray = __webpack_require__(68); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** `Object#toString` result references. */ + var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == other + ''; + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; } + module.exports = equalByTag; + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var root = __webpack_require__(33); + + /** Built-in value references. */ + var Uint8Array = root.Uint8Array; + + module.exports = Uint8Array; + +/***/ }, +/* 67 */ +/***/ function(module, exports) { + /** - * Converts `map` to an array. + * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the key-value pairs. */ + "use strict"; + function mapToArray(map) { var index = -1, result = Array(map.size); @@ -3843,13 +3510,21 @@ return /******/ (function(modules) { // webpackBootstrap return result; } + module.exports = mapToArray; + +/***/ }, +/* 68 */ +/***/ function(module, exports) { + /** - * Converts `set` to an array. + * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. + * @returns {Array} Returns the values. */ + "use strict"; + function setToArray(set) { var index = -1, result = Array(set.size); @@ -3860,1034 +3535,1319 @@ return /******/ (function(modules) { // webpackBootstrap return result; } - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + module.exports = setToArray; - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + 'use strict'; - /** Built-in value references. */ - var Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototypeOf = Object.getPrototypeOf, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + var getAllKeys = __webpack_require__(70); - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = Object.keys; + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1; - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + /** Used for built-in method references. */ + var objectProto = Object.prototype; - /** Used to detect maps, sets, and weakmaps. */ - var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * Creates an hash object. + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. * * @private - * @constructor - * @returns {Object} Returns the new hash object. + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ - function Hash() {} + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; - /** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; - } + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); - /** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + stack['delete'](object); + stack['delete'](other); + return result; } + module.exports = equalObjects; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGetAllKeys = __webpack_require__(71), + getSymbols = __webpack_require__(74), + keys = __webpack_require__(77); + /** - * Checks if a hash value for `key` exists. + * Creates an array of own enumerable property names and symbols of `object`. * * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); } + module.exports = getAllKeys; + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayPush = __webpack_require__(72), + isArray = __webpack_require__(73); + /** - * Sets the hash `key` to `value`. + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. * * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. */ - function hashSet(hash, key, value) { - hash[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } + module.exports = baseGetAllKeys; + +/***/ }, +/* 72 */ +/***/ function(module, exports) { + /** - * Creates a map cache object to store key-value pairs. + * Appends the elements of `values` to `array`. * * @private - * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. */ - function MapCache(values) { + "use strict"; + + function arrayPush(array, values) { var index = -1, - length = values ? values.length : 0; + length = values.length, + offset = array.length; - this.clear(); while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); + array[offset + index] = values[index]; } + return array; } - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapClear() { - this.__data__ = { - 'hash': new Hash(), - 'map': Map ? new Map() : [], - 'string': new Hash() - }; - } + module.exports = arrayPush; - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); - } +/***/ }, +/* 73 */ +/***/ function(module, exports) { /** - * Gets the map value for `key`. + * Checks if `value` is classified as an `Array` object. * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); - } - - /** - * Checks if a map value for `key` exists. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); - } + "use strict"; + + var isArray = Array.isArray; + + module.exports = isArray; + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayFilter = __webpack_require__(75), + stubArray = __webpack_require__(76); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; /** - * Sets the map `key` to `value`. + * Creates an array of the own enumerable symbols of `object`. * * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); + var getSymbols = !nativeGetSymbols ? stubArray : function (object) { + if (object == null) { + return []; } - return this; - } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function (symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + module.exports = getSymbols; + +/***/ }, +/* 75 */ +/***/ function(module, exports) { /** - * Creates a stack cache object to store key-value pairs. + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. * * @private - * @constructor - * @param {Array} [values] The values to cache. + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ - function Stack(values) { + "use strict"; + + function arrayFilter(array, predicate) { var index = -1, - length = values ? values.length : 0; + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; - this.clear(); while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } } + return result; } + module.exports = arrayFilter; + +/***/ }, +/* 76 */ +/***/ function(module, exports) { + /** - * Removes all key-value entries from the stack. + * This method returns a new empty array. * - * @private - * @name clear - * @memberOf Stack + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false */ - function stackClear() { - this.__data__ = { 'array': [], 'map': null }; + "use strict"; + + function stubArray() { + return []; } - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - array = data.array; + module.exports = stubArray; - return array ? assocDelete(array, key) : data.map['delete'](key); - } +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - var data = this.__data__, - array = data.array; + 'use strict'; - return array ? assocGet(array, key) : data.map.get(key); - } + var arrayLikeKeys = __webpack_require__(78), + baseKeys = __webpack_require__(92), + isArrayLike = __webpack_require__(96); /** - * Checks if a stack value for `key` exists. + * Creates an array of the own enumerable property names of `object`. * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] */ - function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } + module.exports = keys; + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseTimes = __webpack_require__(79), + isArguments = __webpack_require__(80), + isArray = __webpack_require__(73), + isBuffer = __webpack_require__(83), + isIndex = __webpack_require__(86), + isTypedArray = __webpack_require__(87); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Sets the stack `key` to `value`. + * Creates an array of the enumerable property names of the array-like `value`. * * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. */ - function stackSet(key, value) { - var data = this.__data__, - array = data.array; + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; - if (array) { - if (array.length < LARGE_ARRAY_SIZE - 1) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + isBuff && (key == 'offset' || key == 'parent') || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || + // Skip index properties. + isIndex(key, length)))) { + result.push(key); } } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; + return result; } + module.exports = arrayLikeKeys; + +/***/ }, +/* 79 */ +/***/ function(module, exports) { + /** - * Removes `key` and its value from the associative array. + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. * * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); + "use strict"; + + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); } - return true; + return result; } - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } + module.exports = baseTimes; - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseIsArguments = __webpack_require__(81), + isObjectLike = __webpack_require__(82); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. + * Checks if `value` is likely an `arguments` object. * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } + var isArguments = baseIsArguments((function () { + return arguments; + })()) ? baseIsArguments : function (value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + }; + + module.exports = isArguments; + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGetTag = __webpack_require__(31), + isObjectLike = __webpack_require__(82); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; /** - * Sets the associative array `key` to `value`. + * The base implementation of `_.isArguments`. * * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } + module.exports = baseIsArguments; + +/***/ }, +/* 82 */ +/***/ function(module, exports) { + /** - * Casts `value` to a path array if it's not one. + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false */ - function baseCastPath(value) { - return isArray(value) ? value : stringToPath(value); + 'use strict'; + + function isObjectLike(value) { + return value != null && typeof value == 'object'; } - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseCastPath(path); + module.exports = isObjectLike; - var index = 0, - length = path.length; +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { - while (object != null && index < length) { - object = object[path[index++]]; - } - return index && index == length ? object : undefined; - } + /* WEBPACK VAR INJECTION */(function(module) {'use strict'; - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || typeof object == 'object' && key in object && getPrototypeOf(object) === null; - } + var root = __webpack_require__(33), + stubFalse = __webpack_require__(85); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** - * The base implementation of `_.hasIn` without support for deep paths. + * Checks if `value` is a buffer. * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return key in Object(object); - } + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + module.exports = isBuffer; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)(module))) + +/***/ }, +/* 84 */ +/***/ function(module, exports) { + + "use strict"; + + module.exports = function (module) { + if (!module.webpackPolyfill) { + module.deprecate = function () {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + }; + +/***/ }, +/* 85 */ +/***/ function(module, exports) { /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. + * This method returns `false`. * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || !isObject(value) && !isObjectLike(other)) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + "use strict"; + + function stubFalse() { + return false; } + module.exports = stubFalse; + +/***/ }, +/* 86 */ +/***/ function(module, exports) { + + /** Used as references for various `Number` constants. */ + 'use strict'; + + var MAX_SAFE_INTEGER = 9007199254740991; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. + * Checks if `value` is a valid array-like index. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; + } - if (!objIsArr) { - objTag = getTag(object); - objTag = objTag == argsTag ? objectTag : objTag; - } - if (!othIsArr) { - othTag = getTag(other); - othTag = othTag == argsTag ? objectTag : othTag; - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; + module.exports = isIndex; - if (isSameTag && !objIsObj) { - stack || (stack = new Stack()); - return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); - } - if (!(bitmask & PARTIAL_COMPARE_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { - if (objIsWrapped || othIsWrapped) { - stack || (stack = new Stack()); - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack()); - return equalObjects(object, other, equalFunc, customizer, bitmask, stack); - } + 'use strict'; + + var baseIsTypedArray = __webpack_require__(88), + baseUnary = __webpack_require__(90), + nodeUtil = __webpack_require__(91); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. + * Checks if `value` is classified as a typed array. * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; + module.exports = isTypedArray; - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack(), - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { - return false; - } - } - } - return true; - } + 'use strict'; + + var baseGetTag = __webpack_require__(31), + isLength = __webpack_require__(89), + isObjectLike = __webpack_require__(82); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** - * The base implementation of `_.iteratee`. + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ - function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (type == 'object') { - return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); - } - return property(value); + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } + module.exports = baseIsTypedArray; + +/***/ }, +/* 89 */ +/***/ function(module, exports) { + + /** Used as references for various `Number` constants. */ + 'use strict'; + + var MAX_SAFE_INTEGER = 9007199254740991; + /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * Checks if `value` is a valid array-like length. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false */ - function baseKeys(object) { - return nativeKeys(Object(object)); + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } + module.exports = isLength; + +/***/ }, +/* 90 */ +/***/ function(module, exports) { + /** - * The base implementation of `_.matches` which doesn't clone `source`. + * The base implementation of `_.unary` without support for storing metadata. * * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; + "use strict"; - return function (object) { - if (object == null) { - return false; - } - return object[key] === value && (value !== undefined || key in Object(object)); - }; - } - return function (object) { - return object === source || baseIsMatch(object, source, matchData); - }; + function baseUnary(func) { + return function (value) { + return func(value); + }; } + module.exports = baseUnary; + +/***/ }, +/* 91 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(module) {'use strict'; + + var freeGlobal = __webpack_require__(34); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function () { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + })(); + + module.exports = nodeUtil; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)(module))) + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isPrototype = __webpack_require__(93), + nativeKeys = __webpack_require__(94); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ - function baseMatchesProperty(path, srcValue) { - return function (object) { - var objValue = get(object, path); - return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; } + module.exports = baseKeys; + +/***/ }, +/* 93 */ +/***/ function(module, exports) { + + /** Used for built-in method references. */ + 'use strict'; + + var objectProto = Object.prototype; + /** - * The base implementation of `_.property` without support for deep paths. + * Checks if `value` is likely a prototype object. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + + return value === proto; } + module.exports = isPrototype; + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var overArg = __webpack_require__(95); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + module.exports = nativeKeys; + +/***/ }, +/* 95 */ +/***/ function(module, exports) { + /** - * A specialized version of `baseProperty` which supports deep paths. + * Creates a unary function that invokes `func` with its argument transformed. * * @private - * @param {Array|string} path The path of the property to get. + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ - function basePropertyDeep(path) { - return function (object) { - return baseGet(object, path); + "use strict"; + + function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); }; } - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; + module.exports = overArg; - if (start < 0) { - start = -start > length ? 0 : length + start; - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : end - start >>> 0; - start >>>= 0; +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } + 'use strict'; + + var isFunction = __webpack_require__(30), + isLength = __webpack_require__(89); /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(array, other); + module.exports = isArrayLike; - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { - if (customizer) { - var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function (othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - result = false; - break; - } - } - stack['delete'](array); - return result; - } + 'use strict'; + + var DataView = __webpack_require__(98), + Map = __webpack_require__(27), + Promise = __webpack_require__(99), + Set = __webpack_require__(100), + WeakMap = __webpack_require__(101), + baseGetTag = __webpack_require__(31), + toSource = __webpack_require__(40); + + /** `Object#toString` result references. */ + var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + + var dataViewTag = '[object DataView]'; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * Gets the `toStringTag` of `value`. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { - switch (tag) { - case arrayBufferTag: - if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) { + getTag = function (value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; + } - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; + module.exports = getTag; - case errorTag: - return object.name == other.name && object.message == other.message; +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return object != +object ? other != +other : object == +other; + 'use strict'; - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == other + ''; + var getNative = __webpack_require__(28), + root = __webpack_require__(33); - case mapTag: - var convert = mapToArray; + /* Built-in method references that are verified to be native. */ + var DataView = getNative(root, 'DataView'); - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); + module.exports = DataView; - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask | UNORDERED_COMPARE_FLAG, stack.set(object, other)); +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } + 'use strict'; + + var getNative = __webpack_require__(28), + root = __webpack_require__(33); + + /* Built-in method references that are verified to be native. */ + var Promise = getNative(root, 'Promise'); + + module.exports = Promise; + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getNative = __webpack_require__(28), + root = __webpack_require__(33); + + /* Built-in method references that are verified to be native. */ + var Set = getNative(root, 'Set'); + + module.exports = Set; + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getNative = __webpack_require__(28), + root = __webpack_require__(33); + + /* Built-in method references that are verified to be native. */ + var WeakMap = getNative(root, 'WeakMap'); + + module.exports = WeakMap; + +/***/ }, +/* 102 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isStrictComparable = __webpack_require__(103), + keys = __webpack_require__(77); /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. + * Gets the property names, values, and compare flags of `object`. * * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; + function getMatchData(object) { + var result = keys(object), + length = result.length; - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { - return false; + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(object, other); + return result; + } - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; + module.exports = getMatchData; - if (customizer) { - var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - return result; - } + 'use strict'; + + var isObject = __webpack_require__(37); /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. */ - var getLength = baseProperty('length'); + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + module.exports = isStrictComparable; + +/***/ }, +/* 104 */ +/***/ function(module, exports) { /** - * Gets the property names, values, and compare flags of `object`. + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function getMatchData(object) { - var result = toPairs(object), - length = result.length; + "use strict"; - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; + function matchesStrictComparable(key, srcValue) { + return function (object) { + if (object == null) { + return false; + } + return object[key] === srcValue && (srcValue !== undefined || key in Object(object)); + }; } + module.exports = matchesStrictComparable; + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseIsEqual = __webpack_require__(57), + get = __webpack_require__(106), + hasIn = __webpack_require__(117), + isKey = __webpack_require__(109), + isStrictComparable = __webpack_require__(103), + matchesStrictComparable = __webpack_require__(104), + toKey = __webpack_require__(116); + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + /** - * Gets the native function at `key` of `object`. + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function (object) { + var objValue = get(object, path); + return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; } + module.exports = baseMatchesProperty; + +/***/ }, +/* 106 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGet = __webpack_require__(107); + /** - * Gets the `toStringTag` of `value`. + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' */ - function getTag(value) { - return objectToString.call(value); - } - - // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. - if (Map && getTag(new Map()) != mapTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) { - getTag = function (value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case mapCtorString: - return mapTag; - case setCtorString: - return setTag; - case weakMapCtorString: - return weakMapTag; - } - } - return result; - }; + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; } + module.exports = get; + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var castPath = __webpack_require__(108), + toKey = __webpack_require__(116); + /** - * Checks if `path` exists on `object`. + * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. */ - function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseCastPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); - } + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; } - var length = object ? object.length : undefined; - return result || !!length && isLength(length) && isIndex(path, length) && (isArray(object) || isString(object) || isArguments(object)); + return index && index == length ? object : undefined; } + module.exports = baseGet; + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArray = __webpack_require__(73), + isKey = __webpack_require__(109), + stringToPath = __webpack_require__(111), + toString = __webpack_require__(114); + /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. + * Casts `value` to a path array if it's not one. * * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); + function castPath(value, object) { + if (isArray(value)) { + return value; } - return null; + return isKey(value, object) ? [value] : stringToPath(toString(value)); } + module.exports = castPath; + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArray = __webpack_require__(73), + isSymbol = __webpack_require__(110); + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + /** * Checks if `value` is a property name and not a property path. * @@ -4897,61 +4857,67 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { - if (typeof value == 'number') { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } - return !isArray(value) && (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object)); + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } + module.exports = isKey; + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGetTag = __webpack_require__(31), + isObjectLike = __webpack_require__(82); + + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + /** - * Checks if `value` is suitable for use as unique object key. + * Checks if `value` is classified as a `Symbol` primitive or object. * - * @private + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || type == 'string' && value != '__proto__' || value == null; + function isSymbol(value) { + return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; } - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + module.exports = isSymbol; - return value === proto; - } +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } + 'use strict'; - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); - } + var memoizeCapped = __webpack_require__(112); + + /** Used to match property names within property paths. */ + var reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. @@ -4960,964 +4926,1216 @@ return /******/ (function(modules) { // webpackBootstrap * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - function stringToPath(string) { + var stringToPath = memoizeCapped(function (string) { var result = []; - toString(string).replace(rePropName, function (match, number, quote, string) { + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function (match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : number || match); }); return result; - } + }); + + module.exports = stringToPath; + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var memoize = __webpack_require__(113); + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; /** - * Gets the last element of `array`. + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; + function memoizeCapped(func) { + var result = memoize(func, function (key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; } + module.exports = memoizeCapped; + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var MapCache = __webpack_require__(42); + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; * - * _.eq(object, object); - * // => true + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] * - * _.eq(object, other); - * // => false + * values(other); + * // => [3, 4] * - * _.eq('a', 'a'); - * // => true + * object.a = 2; + * values(object); + * // => [1, 2] * - * _.eq('a', Object('a')); - * // => false + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] * - * _.eq(NaN, NaN); - * // => true + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; */ - function eq(value, other) { - return value === other || value !== value && other !== other; + function memoize(func, resolver) { + if (typeof func != 'function' || resolver != null && typeof resolver != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function memoized() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; } + // Expose `MapCache`. + memoize.Cache = MapCache; + + module.exports = memoize; + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseToString = __webpack_require__(115); + /** - * Checks if `value` is likely an `arguments` object. + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * - * _.isArguments(function() { return arguments; }()); - * // => true + * _.toString(null); + * // => '' * - * _.isArguments([1, 2, 3]); - * // => false + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + function toString(value) { + return value == null ? '' : baseToString(value); } + module.exports = toString; + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Symbol = __webpack_require__(32), + arrayMap = __webpack_require__(9), + isArray = __webpack_require__(73), + isSymbol = __webpack_require__(110); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. * - * _.isArray(_.noop); - * // => false + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. */ - var isArray = Array.isArray; + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = value + ''; + return result == '0' && 1 / value == -INFINITY ? '-0' : result; + } + + module.exports = baseToString; + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isSymbol = __webpack_require__(110); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0; /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true + * Converts `value` to a string key if it's not a string or symbol. * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = value + ''; + return result == '0' && 1 / value == -INFINITY ? '-0' : result; } + module.exports = toKey; + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseHasIn = __webpack_require__(118), + hasPath = __webpack_require__(119); + /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * _.isArrayLikeObject([1, 2, 3]); + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); * // => true * - * _.isArrayLikeObject(document.body.children); + * _.hasIn(object, 'a.b'); * // => true * - * _.isArrayLikeObject('abc'); - * // => false + * _.hasIn(object, ['a', 'b']); + * // => true * - * _.isArrayLikeObject(_.noop); + * _.hasIn(object, 'b'); * // => false */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); } - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true + module.exports = hasIn; + +/***/ }, +/* 118 */ +/***/ function(module, exports) { + + /** + * The base implementation of `_.hasIn` without support for deep paths. * - * _.isFunction(/abc/); - * // => false + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + "use strict"; + + function baseHasIn(object, key) { + return object != null && key in Object(object); } + module.exports = baseHasIn; + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var castPath = __webpack_require__(108), + isArguments = __webpack_require__(80), + isArray = __webpack_require__(73), + isIndex = __webpack_require__(86), + isLength = __webpack_require__(89), + toKey = __webpack_require__(116); + /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false + * Checks if `path` exists on `object`. * - * _.isLength('3'); - * // => false + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } + module.exports = hasPath; + +/***/ }, +/* 120 */ +/***/ function(module, exports) { + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * This method returns the first argument it receives. * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. * @example * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true + * var object = { 'a': 1 }; * - * _.isObject(_.noop); + * console.log(_.identity(object) === object); * // => true - * - * _.isObject(null); - * // => false */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + "use strict"; + + function identity(value) { + return value; } + module.exports = identity; + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseProperty = __webpack_require__(122), + basePropertyDeep = __webpack_require__(123), + isKey = __webpack_require__(109), + toKey = __webpack_require__(116); + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. * @example * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; * - * _.isObjectLike(_.noop); - * // => false + * _.map(objects, _.property('a.b')); + * // => [2, 1] * - * _.isObjectLike(null); - * // => false + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } + module.exports = property; + +/***/ }, +/* 122 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true + * The base implementation of `_.property` without support for deep paths. * - * _.isNative(_); - * // => false + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + "use strict"; + + function baseProperty(key) { + return function (object) { + return object == null ? undefined : object[key]; + }; } + module.exports = baseProperty; + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGet = __webpack_require__(107); + /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true + * A specialized version of `baseProperty` which supports deep paths. * - * _.isString(1); - * // => false + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + function basePropertyDeep(path) { + return function (object) { + return baseGet(object, path); + }; } + module.exports = basePropertyDeep; + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseEach = __webpack_require__(125), + isArrayLike = __webpack_require__(96); + /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true + * The base implementation of `_.map` without support for iteratee shorthands. * - * _.isSymbol('abc'); - * // => false + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. */ - function isSymbol(value) { - return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function (value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; } + module.exports = baseMap; + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseForOwn = __webpack_require__(126), + createBaseEach = __webpack_require__(129); + /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true + * The base implementation of `_.forEach` without support for iteratee shorthands. * - * _.isTypedArray([]); - * // => false + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } + var baseEach = createBaseEach(baseForOwn); + + module.exports = baseEach; + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseFor = __webpack_require__(127), + keys = __webpack_require__(77); /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' + * The base implementation of `_.forOwn` without support for iteratee shorthands. * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. */ - function toString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (value == null) { - return ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = value + ''; - return result == '0' && 1 / value == -INFINITY ? '-0' : result; + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); } + module.exports = baseForOwn; + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var createBaseFor = __webpack_require__(128); + /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } + var baseFor = createBaseFor(); + + module.exports = baseFor; + +/***/ }, +/* 128 */ +/***/ function(module, exports) { /** - * Checks if `path` is a direct or inherited property of `object`. + * Creates a base function for methods like `_.forIn` and `_.forOwn`. * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ - function hasIn(object, path) { - return hasPath(object, path, baseHasIn); + "use strict"; + + function createBaseFor(fromRight) { + return function (object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; } + module.exports = createBaseFor; + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArrayLike = __webpack_require__(96); + /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) + * Creates a `baseEach` or `baseEachRight` function. * - * _.keys('hi'); - * // => ['0', '1'] + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; + function createBaseEach(eachFunc, fromRight) { + return function (collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); - for (var key in object) { - if (baseHas(object, key) && !(skipIndexes && (key == 'length' || isIndex(key, length))) && !(isProto && key == 'constructor')) { - result.push(key); + while (fromRight ? index-- : ++index < length) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } } - } - return result; + return collection; + }; } + module.exports = createBaseEach; + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayFilter = __webpack_require__(75), + baseFilter = __webpack_require__(131), + baseIteratee = __webpack_require__(10), + isArray = __webpack_require__(73); + /** - * Creates an array of own enumerable key-value pairs for `object` which - * can be consumed by `_.fromPairs`. + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * Foo.prototype.c = 3; + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] */ - function toPairs(object) { - return baseToPairs(object, keys(object)); + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); } + module.exports = filter; + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseEach = __webpack_require__(125); + /** - * This method returns the first argument given to it. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; + * The base implementation of `_.filter` without support for iteratee shorthands. * - * _.identity(object) === object; - * // => true + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. */ - function identity(value) { - return value; + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function (value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; } + module.exports = baseFilter; + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var createFind = __webpack_require__(133), + findIndex = __webpack_require__(134); + /** - * Creates a function that returns the value at `path` of a given object. + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. * @example * - * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * - * _.map(objects, _.property('a.b.c')); - * // => [2, 1] + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); - * // => [1, 2] + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' */ - function property(path) { - return isKey(path) ? baseProperty(path) : basePropertyDeep(path); - } - - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - - // Add functions to the `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; - - // Add functions to the `Stack` cache. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - module.exports = baseIteratee; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }()))) - -/***/ }, -/* 12 */ -/***/ function(module, exports) { - - "use strict"; + var find = createFind(findIndex); - module.exports = function (module) { - if (!module.webpackPolyfill) { - module.deprecate = function () {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - }; + module.exports = find; /***/ }, -/* 13 */ +/* 133 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.2.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseFilter = __webpack_require__(14), - baseIteratee = __webpack_require__(11); + var baseIteratee = __webpack_require__(10), + isArrayLike = __webpack_require__(96), + keys = __webpack_require__(77); /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. + * Creates a `_.find` or `_.findLast` function. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; + function createFind(findIndexFunc) { + return function (collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function (key) { + return iteratee(iterable[key], key, iterable); + }; } - } - return result; + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; } + module.exports = createFind; + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseFindIndex = __webpack_require__(135), + baseIteratee = __webpack_require__(10), + toInteger = __webpack_require__(136); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } * ]; * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 * * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 * * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] + * _.findIndex(users, ['active', false]); + * // => 0 * * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] + * _.findIndex(users, 'active'); + * // => 2 */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - module.exports = filter; + module.exports = findIndex; /***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var baseEach = __webpack_require__(10); +/* 135 */ +/***/ function(module, exports) { /** - * The base implementation of `_.filter` without support for iteratee shorthands. + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. * * @private - * @param {Array|Object} collection The collection to iterate over. + * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function (value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); + "use strict"; + + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while (fromRight ? index-- : ++index < length) { + if (predicate(array[index], index, array)) { + return index; } - }); - return result; + } + return -1; } - module.exports = baseFilter; + module.exports = baseFindIndex; /***/ }, -/* 15 */ +/* 136 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.2.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseEach = __webpack_require__(10), - baseFind = __webpack_require__(16), - baseFindIndex = __webpack_require__(17), - baseIteratee = __webpack_require__(11); + var toFinite = __webpack_require__(137); /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' + * _.toInteger(3.2); + * // => 3 * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' + * _.toInteger(Number.MIN_VALUE); + * // => 0 * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' + * _.toInteger('3.2'); + * // => 3 */ - function find(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEach); + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? remainder ? result - remainder : result : 0; } + module.exports = toInteger; + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var toNumber = __webpack_require__(138); + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308; + /** - * Checks if `value` is classified as an `Array` object. + * Converts `value` to a finite number. * * @static * @memberOf _ - * @type {Function} + * @since 4.12.0 * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. * @example * - * _.isArray([1, 2, 3]); - * // => true + * _.toFinite(3.2); + * // => 3.2 * - * _.isArray(document.body.children); - * // => false + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 * - * _.isArray('abc'); - * // => false + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 * - * _.isArray(_.noop); - * // => false + * _.toFinite('3.2'); + * // => 3.2 */ - var isArray = Array.isArray; + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } - module.exports = find; + module.exports = toFinite; /***/ }, -/* 16 */ -/***/ function(module, exports) { +/* 138 */ +/***/ function(module, exports, __webpack_require__) { - /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ + 'use strict'; - /** - * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, - * without support for callback shorthands and `this` binding, which iterates - * over `collection` using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - "use strict"; + var isObject = __webpack_require__(37), + isSymbol = __webpack_require__(110); - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function (value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; - module.exports = baseFind; + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; -/***/ }, -/* 17 */ -/***/ function(module, exports) { + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; /** - * lodash 3.6.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? other + '' : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + + module.exports = toNumber; + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseFlatten = __webpack_require__(140), + baseOrderBy = __webpack_require__(142), + baseRest = __webpack_require__(146), + isIterateeCall = __webpack_require__(154); /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for callback shorthands and `this` binding. + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function (collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + module.exports = sortBy; + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayPush = __webpack_require__(72), + isFlattenable = __webpack_require__(141); + + /** + * The base implementation of `_.flatten` with support for restricting flattening. * * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. */ - "use strict"; + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; - function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; + predicate || (predicate = isFlattenable); + result || (result = []); - while (fromRight ? index-- : ++index < length) { - if (predicate(array[index], index, array)) { - return index; + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; } } - return -1; + return result; } - module.exports = baseFindIndex; + module.exports = baseFlatten; /***/ }, -/* 18 */ +/* 141 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + + var Symbol = __webpack_require__(32), + isArguments = __webpack_require__(80), + isArray = __webpack_require__(73); + + /** Built-in value references. */ + var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + /** - * lodash 4.2.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ - 'use strict'; + function isFlattenable(value) { + return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + } - var baseEach = __webpack_require__(10), - baseFlatten = __webpack_require__(19), - baseIteratee = __webpack_require__(11), - rest = __webpack_require__(20); + module.exports = isFlattenable; - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + 'use strict'; - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + var arrayMap = __webpack_require__(9), + baseIteratee = __webpack_require__(10), + baseMap = __webpack_require__(124), + baseSortBy = __webpack_require__(143), + baseUnary = __webpack_require__(90), + compareMultiple = __webpack_require__(144), + identity = __webpack_require__(120); /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * The base implementation of `_.orderBy` without param guards. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; + var result = baseMap(collection, function (value, key, collection) { + var criteria = arrayMap(iteratees, function (iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function (object, other) { + return compareMultiple(object, other, orders); + }); } + module.exports = baseOrderBy; + +/***/ }, +/* 143 */ +/***/ function(module, exports) { + /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding @@ -5928,6 +6146,8 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ + "use strict"; + function baseSortBy(array, comparer) { var length = array.length; @@ -5938,33 +6158,15 @@ return /******/ (function(modules) { // webpackBootstrap return array; } - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; + module.exports = baseSortBy; - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { - if (value > other && !othIsNull || !valIsReflexive || valIsNull && !othIsUndef && othIsReflexive || valIsUndef && othIsReflexive) { - return 1; - } - if (value < other && !valIsNull || !othIsReflexive || othIsNull && !valIsUndef && valIsReflexive || othIsUndef && valIsReflexive) { - return -1; - } - } - return 0; - } + 'use strict'; + + var compareAscending = __webpack_require__(145); /** * Used by `_.orderBy` to compare multiple properties of a value to another @@ -6003,5723 +6205,2416 @@ return /******/ (function(modules) { // webpackBootstrap // for more details. // // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } + module.exports = compareMultiple; - /** Used for built-in method references. */ - var objectProto = Object.prototype; +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + 'use strict'; + + var isSymbol = __webpack_require__(110); /** - * The base implementation of `_.map` without support for iteratee shorthands. + * Compares values to sort them in ascending order. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); - baseEach(collection, function (value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { + return 1; + } + if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; + } + } + return 0; } + module.exports = compareAscending; + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var identity = __webpack_require__(120), + overRest = __webpack_require__(147), + setToString = __webpack_require__(149); + /** - * The base implementation of `_.orderBy` without param guards. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ - function baseOrderBy(collection, iteratees, orders) { - var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : Array(1), baseIteratee); + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } - var result = baseMap(collection, function (value, key, collection) { - var criteria = arrayMap(iteratees, function (iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); + module.exports = baseRest; - return baseSortBy(result, function (object, other) { - return compareMultiple(object, other, orders); - }); - } +/***/ }, +/* 147 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var apply = __webpack_require__(148); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; /** - * The base implementation of `_.property` without support for deep paths. + * A specialized version of `baseRest` which transforms the rest array. * * @private - * @param {string} key The key of the property to get. + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? func.length - 1 : start, 0); + return function () { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); }; } + module.exports = overRest; + +/***/ }, +/* 148 */ +/***/ function(module, exports) { + /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. * * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. */ - var getLength = baseProperty('length'); + "use strict"; + + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + module.exports = apply; + +/***/ }, +/* 149 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseSetToString = __webpack_require__(150), + shortOut = __webpack_require__(153); /** - * Checks if the given arguments are from an iteratee call. + * Sets the `toString` method of `func` to return `string`. * * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { - return eq(object[index], value); - } - return false; - } + var setToString = shortOut(baseSetToString); + + module.exports = setToString; + +/***/ }, +/* 150 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var constant = __webpack_require__(151), + defineProperty = __webpack_require__(152), + identity = __webpack_require__(120); /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; + * The base implementation of `setToString` without support for hot loop shorting. * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ - var sortBy = rest(function (collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees.length = 1; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); + var baseSetToString = !defineProperty ? identity : function (func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + module.exports = baseSetToString; + +/***/ }, +/* 151 */ +/***/ function(module, exports) { /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * Creates a function that returns `value`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true + * var objects = _.times(2, _.constant({ 'a': 1 })); * - * _.eq('a', Object('a')); - * // => false + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] * - * _.eq(NaN, NaN); + * console.log(objects[0] === objects[1]); * // => true */ - function eq(value, other) { - return value === other || value !== value && other !== other; + "use strict"; + + function constant(value) { + return function () { + return value; + }; } + module.exports = constant; + +/***/ }, +/* 152 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var getNative = __webpack_require__(28); + + var defineProperty = (function () { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + })(); + + module.exports = defineProperty; + +/***/ }, +/* 153 */ +/***/ function(module, exports) { + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + "use strict"; + + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeNow = Date.now; + /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function () { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; } + module.exports = shortOut; + +/***/ }, +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var eq = __webpack_require__(18), + isArrayLike = __webpack_require__(96), + isIndex = __webpack_require__(86), + isObject = __webpack_require__(37); + /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true + * Checks if the given arguments are from an iteratee call. * - * _.isFunction(/abc/); - * // => false + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { + return eq(object[index], value); + } + return false; } + module.exports = isIterateeCall; + +/***/ }, +/* 155 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseDifference = __webpack_require__(156), + baseFlatten = __webpack_require__(140), + baseRest = __webpack_require__(146), + isArrayLikeObject = __webpack_require__(162); + /** - * Checks if `value` is a valid array-like length. + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor * @example * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false + * _.difference([2, 1], [2, 3]); + * // => [1] */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } + var difference = baseRest(function (array, values) { + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; + }); + + module.exports = difference; + +/***/ }, +/* 156 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var SetCache = __webpack_require__(60), + arrayIncludes = __webpack_require__(157), + arrayIncludesWith = __webpack_require__(161), + arrayMap = __webpack_require__(9), + baseUnary = __webpack_require__(90), + cacheHas = __webpack_require__(64); + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. * - * _.isObject(null); - * // => false + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = comparator || value !== 0 ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; } - module.exports = sortBy; + module.exports = baseDifference; /***/ }, -/* 19 */ -/***/ function(module, exports) { +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseIndexOf = __webpack_require__(158); /** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } - /** Used as references for various `Number` constants. */ - 'use strict'; + module.exports = arrayIncludes; - var MAX_SAFE_INTEGER = 9007199254740991; +/***/ }, +/* 158 */ +/***/ function(module, exports, __webpack_require__) { - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + 'use strict'; + + var baseFindIndex = __webpack_require__(135), + baseIsNaN = __webpack_require__(159), + strictIndexOf = __webpack_require__(160); /** - * Appends the elements of `values` to `array`. + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; + function baseIndexOf(array, value, fromIndex) { + return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } - /** Used for built-in method references. */ - var objectProto = Object.prototype; + module.exports = baseIndexOf; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }, +/* 159 */ +/***/ function(module, exports) { /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ - var objectToString = objectProto.toString; + "use strict"; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; + function baseIsNaN(value) { + return value !== value; + } + + module.exports = baseIsNaN; + +/***/ }, +/* 160 */ +/***/ function(module, exports) { /** - * The base implementation of `_.flatten` with support for restricting flattening. + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. * * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function baseFlatten(array, depth, isStrict, result) { - result || (result = []); + "use strict"; - var index = -1, + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, length = array.length; while (++index < length) { - var value = array[index]; - if (depth > 0 && isArrayLikeObject(value) && (isStrict || isArray(value) || isArguments(value))) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; + if (array[index] === value) { + return index; } } - return result; + return -1; } + module.exports = strictIndexOf; + +/***/ }, +/* 161 */ +/***/ function(module, exports) { + /** - * The base implementation of `_.property` without support for deep paths. + * This function is like `arrayIncludes` except that it accepts a comparator. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; + "use strict"; + + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; } - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); + module.exports = arrayIncludesWith; + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArrayLike = __webpack_require__(96), + isObjectLike = __webpack_require__(82); /** - * Checks if `value` is likely an `arguments` object. + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * * @static * @memberOf _ + * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * - * _.isArguments(function() { return arguments; }()); + * _.isArrayLikeObject([1, 2, 3]); * // => true * - * _.isArguments([1, 2, 3]); + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); * // => false */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } + module.exports = isArrayLikeObject; + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assignValue = __webpack_require__(164), + copyObject = __webpack_require__(166), + createAssigner = __webpack_require__(167), + isArrayLike = __webpack_require__(96), + isPrototype = __webpack_require__(93), + keys = __webpack_require__(77); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Checks if `value` is classified as an `Array` object. + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn * @example * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true + * function Foo() { + * this.a = 1; + * } * - * _.isArrayLike(document.body.children); - * // => true + * function Bar() { + * this.c = 3; + * } * - * _.isArrayLike('abc'); - * // => true + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.isArrayLike(_.noop); - * // => false + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } + var assign = createAssigner(function (object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } + module.exports = assign; - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } + 'use strict'; + + var baseAssignValue = __webpack_require__(165), + eq = __webpack_require__(18); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * _.isObject(null); - * // => false + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { + baseAssignValue(object, key, value); + } } + module.exports = assignValue; + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var defineProperty = __webpack_require__(152); + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * - * _.isObjectLike(null); - * // => false + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } - module.exports = baseFlatten; + module.exports = baseAssignValue; /***/ }, -/* 20 */ -/***/ function(module, exports) { +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assignValue = __webpack_require__(164), + baseAssignValue = __webpack_require__(165); /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); - /** Used as the `TypeError` message for "Functions" methods. */ - 'use strict'; - - var FUNC_ERROR_TEXT = 'Expected a function'; + var index = -1, + length = props.length; - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; + while (++index < length) { + var key = props[index]; - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + module.exports = copyObject; - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; + 'use strict'; - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; + var baseRest = __webpack_require__(146), + isIterateeCall = __webpack_require__(154); /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. + * Creates a function like `_.assign`. * * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. */ - function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); + function createAssigner(assigner) { + return baseRest(function (object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); } - /** Used for built-in method references. */ - var objectProto = Object.prototype; + module.exports = createAssigner; - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max; + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + 'use strict'; - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? func.length - 1 : toInteger(start), 0); - return function () { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + var React = __webpack_require__(2); + var ColumnProperties = __webpack_require__(7); + var pick = __webpack_require__(169); - while (++index < length) { - array[index] = args[start + index]; + var GridRowContainer = React.createClass({ + displayName: 'GridRowContainer', + + getDefaultProps: function getDefaultProps() { + return { + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "columnSettings": null, + "rowSettings": null, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "▶", + "parentRowExpandedComponent": "▼", + "onRowClick": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null, + "multipleSelectionSettings": null + }; + }, + getInitialState: function getInitialState() { + return { + "data": {}, + "showChildren": false + }; + }, + componentWillReceiveProps: function componentWillReceiveProps() { + this.setShowChildren(false); + }, + toggleChildren: function toggleChildren() { + this.setShowChildren(this.state.showChildren === false); + }, + setShowChildren: function setShowChildren(visible) { + this.setState({ + showChildren: visible + }); + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be"); } - switch (start) { - case 0: - return func.call(this, array); - case 1: - return func.call(this, args[0], array); - case 2: - return func.call(this, args[0], args[1], array); + }, + render: function render() { + this.verifyProps(); + var that = this; + if (typeof this.props.data === "undefined") { + return React.createElement('tbody', null); } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; + var arr = []; + + var columns = this.props.columnSettings.getColumns(); + + arr.push(React.createElement(this.props.rowSettings.rowComponent, { + useGriddleStyles: this.props.useGriddleStyles, + isSubGriddle: this.props.isSubGriddle, + data: this.props.rowSettings.isCustom ? pick(this.props.data, columns) : this.props.data, + rowData: this.props.rowSettings.isCustom ? this.props.data : null, + columnSettings: this.props.columnSettings, + rowSettings: this.props.rowSettings, + hasChildren: that.props.hasChildren, + toggleChildren: that.toggleChildren, + showChildren: that.state.showChildren, + key: that.props.uniqueId + '_base_row', + useGriddleIcons: that.props.useGriddleIcons, + parentRowExpandedClassName: this.props.parentRowExpandedClassName, + parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, + parentRowExpandedComponent: this.props.parentRowExpandedComponent, + parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight, + onRowClick: that.props.onRowClick, + onRowMouseEnter: that.props.onRowMouseEnter, + onRowMouseLeave: that.props.onRowMouseLeave, + multipleSelectionSettings: this.props.multipleSelectionSettings, + onRowWillMount: that.props.onRowWillMount, + onRowWillUnmount: that.props.onRowWillUnmount })); + + var children = null; + + if (that.state.showChildren) { + children = that.props.hasChildren && this.props.data["children"].map(function (row, index) { + var key = that.props.rowSettings.getRowKey(row, index); + + if (typeof row["children"] !== "undefined") { + var Griddle = that.constructor.Griddle; + return React.createElement('tr', { key: key, style: { paddingLeft: 5 } }, React.createElement('td', { colSpan: that.props.columnSettings.getVisibleColumnCount(), className: 'griddle-parent', style: that.props.useGriddleStyles ? { border: "none", "padding": "0 0 0 5px" } : null }, React.createElement(Griddle, { + rowMetadata: { key: 'id' }, + isSubGriddle: true, + results: [row], + columns: that.props.columnSettings.getColumns(), + tableClassName: that.props.tableClassName, + parentRowExpandedClassName: that.props.parentRowExpandedClassName, + parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, + showTableHeading: false, + showPager: false, + columnMetadata: that.props.columnSettings.columnMetadata, + parentRowExpandedComponent: that.props.parentRowExpandedComponent, + parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, + paddingHeight: that.props.paddingHeight, + rowHeight: that.props.rowHeight + }))); + } + + return React.createElement(that.props.rowSettings.rowComponent, { + useGriddleStyles: that.props.useGriddleStyles, + isSubGriddle: that.props.isSubGriddle, + data: row, + columnSettings: that.props.columnSettings, + isChildRow: true, + columnMetadata: that.props.columnSettings.columnMetadata, + key: key + }); + }); } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } + + return that.props.hasChildren === false ? arr[0] : React.createElement('tbody', null, that.state.showChildren ? arr.concat(children) : arr); + } + }); + + module.exports = GridRowContainer; + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var basePick = __webpack_require__(170), + flatRest = __webpack_require__(173); /** - * Checks if `value` is classified as a `Function` object. + * Creates an object composed of the picked `object` properties. * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. * @example * - * _.isFunction(_); - * // => true + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * _.isFunction(/abc/); - * // => false + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } + var pick = flatRest(function (object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + module.exports = pick; + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var basePickBy = __webpack_require__(171), + hasIn = __webpack_require__(117); /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * The base implementation of `_.pick` without support for individual + * property identifiers. * - * _.isObject(null); - * // => false + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function basePick(object, paths) { + return basePickBy(object, paths, function (value, path) { + return hasIn(object, path); + }); } + module.exports = basePick; + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGet = __webpack_require__(107), + baseSet = __webpack_require__(172), + castPath = __webpack_require__(108); + /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 + * The base implementation of `_.pickBy` without support for iteratee shorthands. * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; } + module.exports = basePickBy; + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assignValue = __webpack_require__(164), + castPath = __webpack_require__(108), + isIndex = __webpack_require__(86), + isObject = __webpack_require__(37), + toKey = __webpack_require__(116); + /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 + * The base implementation of `_.set`. * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; } - if (typeof value != 'string') { - return value === 0 ? value : +value; + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; + } + } + assignValue(nested, key, newValue); + nested = nested[key]; } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + return object; } - module.exports = rest; + module.exports = baseSet; /***/ }, -/* 21 */ +/* 173 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseDifference = __webpack_require__(22), - baseFlatten = __webpack_require__(19), - rest = __webpack_require__(20); - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + var flatten = __webpack_require__(174), + overRest = __webpack_require__(147), + setToString = __webpack_require__(149); /** - * The base implementation of `_.property` without support for deep paths. + * A specialized version of `baseRest` which flattens the rest array. * * @private - * @param {string} key The key of the property to get. + * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); } - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); + module.exports = flatRest; + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseFlatten = __webpack_require__(140); /** - * Creates an array of unique `array` values not included in the other - * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. The order of result values is determined by the - * order they occur in the first array. + * Flattens `array` a single level deep. * * @static * @memberOf _ + * @since 0.1.0 * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. * @example * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ - var difference = rest(function (array, values) { - return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, true)) : []; - }); + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + module.exports = flatten; + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } } + var _uniqueId = __webpack_require__(176); + + var RowProperties = (function () { + function RowProperties() { + var rowMetadata = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var rowComponent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var isCustom = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; + + _classCallCheck(this, RowProperties); + + this.rowMetadata = rowMetadata; + this.rowComponent = rowComponent; + this.isCustom = isCustom; + // assign unique Id to each griddle instance + } + + _createClass(RowProperties, [{ + key: 'getRowKey', + value: function getRowKey(row, key) { + var uniqueId; + + if (this.hasRowMetadataKey()) { + uniqueId = row[this.rowMetadata.key]; + } else { + uniqueId = _uniqueId("grid_row"); + } + + //todo: add error handling + + return uniqueId; + } + }, { + key: 'hasRowMetadataKey', + value: function hasRowMetadataKey() { + return this.hasRowMetadata() && this.rowMetadata.key !== null && this.rowMetadata.key !== undefined; + } + }, { + key: 'getBodyRowMetadataClass', + value: function getBodyRowMetadataClass(rowData) { + if (this.hasRowMetadata() && this.rowMetadata.bodyCssClassName !== null && this.rowMetadata.bodyCssClassName !== undefined) { + if (typeof this.rowMetadata.bodyCssClassName === 'function') { + return this.rowMetadata.bodyCssClassName(rowData); + } else { + return this.rowMetadata.bodyCssClassName; + } + } + return null; + } + }, { + key: 'getHeaderRowMetadataClass', + value: function getHeaderRowMetadataClass() { + return this.hasRowMetadata() && this.rowMetadata.headerCssClassName !== null && this.rowMetadata.headerCssClassName !== undefined ? this.rowMetadata.headerCssClassName : null; + } + }, { + key: 'hasRowMetadata', + value: function hasRowMetadata() { + return this.rowMetadata !== null; + } + }]); + + return RowProperties; + })(); + + module.exports = RowProperties; + +/***/ }, +/* 176 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var toString = __webpack_require__(114); + + /** Used to generate unique IDs. */ + var idCounter = 0; + /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. * @example * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false + * _.uniqueId('contact_'); + * // => 'contact_104' * - * _.isArrayLikeObject(_.noop); - * // => false + * _.uniqueId(); + * // => '105' */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; } - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } + module.exports = uniqueId; + +/***/ }, +/* 177 */ +/***/ function(module, exports, __webpack_require__) { + + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + "use strict"; + + var React = __webpack_require__(2); + + var GridFilter = React.createClass({ + displayName: "GridFilter", + + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + handleChange: function handleChange(event) { + this.props.changeFilter(event.target.value); + }, + render: function render() { + return React.createElement("div", { className: "filter-container" }, React.createElement("input", { type: "text", name: "filter", placeholder: this.props.placeholderText, className: "form-control", onChange: this.handleChange })); + } + }); + + module.exports = GridFilter; + +/***/ }, +/* 178 */ +/***/ function(module, exports, __webpack_require__) { + + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + 'use strict'; + + var React = __webpack_require__(2); + var assign = __webpack_require__(163); + + //needs props maxPage, currentPage, nextFunction, prevFunction + var GridPagination = React.createClass({ + displayName: 'GridPagination', + + getDefaultProps: function getDefaultProps() { + return { + "maxPage": 0, + "nextText": "", + "previousText": "", + "currentPage": 0, + "useGriddleStyles": true, + "nextClassName": "griddle-next", + "previousClassName": "griddle-previous", + "nextIconComponent": null, + "previousIconComponent": null + }; + }, + pageChange: function pageChange(event) { + this.props.setPage(parseInt(event.target.value, 10) - 1); + }, + render: function render() { + var previous = ""; + var next = ""; + + if (this.props.currentPage > 0) { + previous = React.createElement('button', { type: 'button', onClick: this.props.previous, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 0 0 10px" } : null }, this.props.previousIconComponent, this.props.previousText); + } + + if (this.props.currentPage !== this.props.maxPage - 1) { + next = React.createElement('button', { type: 'button', onClick: this.props.next, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 10px 0 0" } : null }, this.props.nextText, this.props.nextIconComponent); + } + + var leftStyle = null; + var middleStyle = null; + var rightStyle = null; + + if (this.props.useGriddleStyles === true) { + var baseStyle = { + "float": "left", + minHeight: "1px", + marginTop: "5px" + }; + + rightStyle = assign({ textAlign: "right", width: "34%" }, baseStyle); + middleStyle = assign({ textAlign: "center", width: "33%" }, baseStyle); + leftStyle = assign({ width: "33%" }, baseStyle); + } + + var options = []; + + for (var i = 1; i <= this.props.maxPage; i++) { + options.push(React.createElement('option', { value: i, key: i }, i)); + } + + return React.createElement('div', { style: this.props.useGriddleStyles ? { minHeight: "35px" } : null }, React.createElement('div', { className: this.props.previousClassName, style: leftStyle }, previous), React.createElement('div', { className: 'griddle-page', style: middleStyle }, React.createElement('select', { value: this.props.currentPage + 1, onChange: this.pageChange }, options), ' / ', this.props.maxPage), React.createElement('div', { className: this.props.nextClassName, style: rightStyle }, next)); + } + }); + + module.exports = GridPagination; + +/***/ }, +/* 179 */ +/***/ function(module, exports, __webpack_require__) { + + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + 'use strict'; + + var React = __webpack_require__(2); + var includes = __webpack_require__(180); + var without = __webpack_require__(184); + var find = __webpack_require__(132); + + var GridSettings = React.createClass({ + displayName: 'GridSettings', + + getDefaultProps: function getDefaultProps() { + return { + "columns": [], + "columnMetadata": [], + "selectedColumns": [], + "settingsText": "", + "maxRowsText": "", + "resultsPerPage": 0, + "enableToggleCustom": false, + "useCustomComponent": false, + "useGriddleStyles": true, + "toggleCustomComponent": function toggleCustomComponent() {} + }; + }, + setPageSize: function setPageSize(event) { + var value = parseInt(event.target.value, 10); + this.props.setPageSize(value); + }, + handleChange: function handleChange(event) { + var columnName = event.target.dataset ? event.target.dataset.name : event.target.getAttribute('data-name'); + if (event.target.checked === true && includes(this.props.selectedColumns, columnName) === false) { + this.props.selectedColumns.push(columnName); + this.props.setColumns(this.props.selectedColumns); + } else { + /* redraw with the selected columns minus the one just unchecked */ + this.props.setColumns(without(this.props.selectedColumns, columnName)); + } + }, + render: function render() { + var that = this; + + var nodes = []; + //don't show column selector if we're on a custom component + if (that.props.useCustomComponent === false) { + nodes = this.props.columns.map(function (col, index) { + var checked = includes(that.props.selectedColumns, col); + //check column metadata -- if this one is locked make it disabled and don't put an onChange event + var meta = find(that.props.columnMetadata, { columnName: col }); + var displayName = col; + + if (typeof meta !== "undefined" && typeof meta.displayName !== "undefined" && meta.displayName != null) { + displayName = meta.displayName; + } + + if (typeof meta !== "undefined" && meta != null && meta.locked) { + return React.createElement('div', { className: 'column checkbox' }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', disabled: true, name: 'check', checked: checked, 'data-name': col }), displayName)); + } else if (typeof meta !== "undefined" && meta != null && typeof meta.visible !== "undefined" && meta.visible === false) { + return null; + } + return React.createElement('div', { className: 'griddle-column-selection checkbox', key: col, style: that.props.useGriddleStyles ? { "float": "left", width: "20%" } : null }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', name: 'check', onChange: that.handleChange, checked: checked, 'data-name': col }), displayName)); + }); + } + + var toggleCustom = that.props.enableToggleCustom ? React.createElement('div', { className: 'form-group' }, React.createElement('label', { htmlFor: 'maxRows' }, React.createElement('input', { type: 'checkbox', checked: this.props.useCustomComponent, onChange: this.props.toggleCustomComponent }), ' ', this.props.enableCustomFormatText)) : ""; + + var setPageSize = this.props.showSetPageSize ? React.createElement('div', null, React.createElement('label', { htmlFor: 'maxRows' }, this.props.maxRowsText, ':', React.createElement('select', { onChange: this.setPageSize, value: this.props.resultsPerPage }, React.createElement('option', { value: '5' }, '5'), React.createElement('option', { value: '10' }, '10'), React.createElement('option', { value: '25' }, '25'), React.createElement('option', { value: '50' }, '50'), React.createElement('option', { value: '100' }, '100')))) : ""; + + return React.createElement('div', { className: 'griddle-settings', style: this.props.useGriddleStyles ? { backgroundColor: "#FFF", border: "1px solid #DDD", color: "#222", padding: "10px", marginBottom: "10px" } : null }, React.createElement('h6', null, this.props.settingsText), React.createElement('div', { className: 'griddle-columns', style: this.props.useGriddleStyles ? { clear: "both", display: "table", width: "100%", borderBottom: "1px solid #EDEDED", marginBottom: "10px" } : null }, nodes), setPageSize, toggleCustom); + } + }); + + module.exports = GridSettings; + +/***/ }, +/* 180 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseIndexOf = __webpack_require__(158), + isArrayLike = __webpack_require__(96), + isString = __webpack_require__(181), + toInteger = __webpack_require__(136), + values = __webpack_require__(182); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * - * _.isLength(3); + * _.includes([1, 2, 3], 1); * // => true * - * _.isLength(Number.MIN_VALUE); + * _.includes([1, 2, 3], 1, 2); * // => false * - * _.isLength(Infinity); - * // => false + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true * - * _.isLength('3'); - * // => false + * _.includes('abcd', 'bc'); + * // => true */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; } + module.exports = includes; + +/***/ }, +/* 181 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGetTag = __webpack_require__(31), + isArray = __webpack_require__(73), + isObjectLike = __webpack_require__(82); + + /** `Object#toString` result references. */ + var stringTag = '[object String]'; + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Checks if `value` is classified as a `String` primitive or object. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); + * _.isString('abc'); * // => true * - * _.isObject(null); + * _.isString(1); * // => false */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function isString(value) { + return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * + module.exports = isString; + +/***/ }, +/* 182 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseValues = __webpack_require__(183), + keys = __webpack_require__(77); + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. * @example * - * _.isObjectLike({}); - * // => true + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.isObjectLike([1, 2, 3]); - * // => true + * Foo.prototype.c = 3; * - * _.isObjectLike(_.noop); - * // => false + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) * - * _.isObjectLike(null); - * // => false + * _.values('hi'); + * // => ['h', 'i'] */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); } - module.exports = difference; + module.exports = values; /***/ }, -/* 22 */ +/* 183 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.4.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var SetCache = __webpack_require__(23); - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; + var arrayMap = __webpack_require__(9); /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. * * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. */ - function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; + function baseValues(object, props) { + return arrayMap(props, function (key) { + return object[key]; + }); } - /** - * A specialized version of `_.includesWith` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; + module.exports = baseValues; - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } +/***/ }, +/* 184 */ +/***/ function(module, exports, __webpack_require__) { - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); + 'use strict'; - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } + var baseDifference = __webpack_require__(156), + baseRest = __webpack_require__(146), + isArrayLikeObject = __webpack_require__(162); /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.unary` without support for storing wrapper metadata. + * **Note:** Unlike `_.pull`, this method returns a new array. * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - */ - function baseUnary(func) { - return function (value) { - return func(value); - }; - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); + var without = baseRest(function (array, values) { + return isArrayLikeObject(array) ? baseDifference(array, values) : []; + }); - while (fromRight ? index-- : ++index < length) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } + module.exports = without; - /** - * Checks if `value` is in `cache`. - * - * @private - * @param {Object} cache The set cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function cacheHas(cache, value) { - var map = cache.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { - return hash[value] === HASH_UNDEFINED; - } - return map.has(value); - } + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + "use strict"; - /** - * The base implementation of methods like `_.difference` without support for - * excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; + var React = __webpack_require__(2); - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; + var GridNoData = React.createClass({ + displayName: "GridNoData", - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } + getDefaultProps: function getDefaultProps() { + return { + "noDataMessage": "No Data" + }; + }, + render: function render() { + var that = this; - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || type == 'string' && value != '__proto__' || value == null; - } + return React.createElement("div", null, this.props.noDataMessage); + } + }); - module.exports = baseDifference; + module.exports = GridNoData; /***/ }, -/* 23 */ +/* 186 */ /***/ function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(module, global) {/** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used to stand-in for `undefined` hash values. */ + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ 'use strict'; - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; + var React = __webpack_require__(2); + var ColumnProperties = __webpack_require__(7); + var deep = __webpack_require__(187); + var isFunction = __webpack_require__(30); + var zipObject = __webpack_require__(194); + var assign = __webpack_require__(163); + var defaults = __webpack_require__(196); + var toPairs = __webpack_require__(202); + var without = __webpack_require__(184); - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; + var GridRow = React.createClass({ + displayName: 'GridRow', - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType ? exports : undefined; + getDefaultProps: function getDefaultProps() { + return { + "isChildRow": false, + "showChildren": false, + "data": {}, + "columnSettings": null, + "rowSettings": null, + "hasChildren": false, + "useGriddleStyles": true, + "useGriddleIcons": true, + "isSubGriddle": false, + "paddingHeight": null, + "rowHeight": null, + "parentRowCollapsedClassName": "parent-row", + "parentRowExpandedClassName": "parent-row expanded", + "parentRowCollapsedComponent": "▶", + "parentRowExpandedComponent": "▼", + "onRowClick": null, + "multipleSelectionSettings": null, + "onRowMouseEnter": null, + "onRowMouseLeave": null, + "onRowWillMount": null, + "onRowWillUnmount": null + }; + }, + componentWillMount: function componentWillMount() { + if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) { + this.props.onRowWillMount(this); + } + }, + componentWillUnmount: function componentWillUnmount() { + if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) { + this.props.onRowWillUnmount(this); + } + }, + handleClick: function handleClick(e) { + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + this.props.onRowClick(this, e); + } else if (this.props.hasChildren) { + this.props.toggleChildren(); + } + }, + handleMouseEnter: function handleMouseEnter(e) { + if (this.props.onRowMouseEnter !== null && isFunction(this.props.onRowMouseEnter)) { + this.props.onRowMouseEnter(this, e); + } + }, + handleMouseLeave: function handleMouseLeave(e) { + if (this.props.onRowMouseLeave !== null && isFunction(this.props.onRowMouseLeave)) { + this.props.onRowMouseLeave(this, e); + } + }, + handleSelectionChange: function handleSelectionChange(e) { + //hack to get around warning that's not super useful in this case + return; + }, + handleSelectClick: function handleSelectClick(e) { + if (this.props.multipleSelectionSettings.isMultipleSelection) { + if (e.target.type === "checkbox") { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); + } else { + this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); + } + } + }, + verifyProps: function verifyProps() { + if (this.props.columnSettings === null) { + console.error("gridRow: The columnSettings prop is null and it shouldn't be"); + } + }, + formatData: function formatData(data) { + if (typeof data === 'boolean') { + return String(data); + } + return data; + }, + render: function render() { + var _this = this; - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType ? module : undefined; + this.verifyProps(); + var that = this; + var columnStyles = null; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + if (this.props.useGriddleStyles) { + columnStyles = { + margin: "0px", + padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", + height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, + backgroundColor: "#FFF", + borderTopColor: "#DDD", + color: "#222" + }; + } - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); + var columns = this.props.columnSettings.getColumns(); - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); + // make sure that all the columns we need have default empty values + // otherwise they will get clipped + var defaultValues = zipObject(columns, []); - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof undefined] && undefined); + // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns + var dataView = assign({}, this.props.data); - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || freeWindow !== (thisGlobal && thisGlobal.window) && freeWindow || freeSelf || thisGlobal || Function('return this')(); + defaults(dataView, defaultValues); + var data = toPairs(deep.pick(dataView, without(columns, 'children'))); + var nodes = data.map(function (col, index) { + var returnValue = null; + var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return value && value.Object === Object ? value : null; - } + //todo: Make this not as ridiculous looking + var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } + if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { + columnStyles = assign(columnStyles, { paddingLeft: 10 }); + } - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype; + if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { + if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { + var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); + } else { + returnValue = React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, _this.formatData(col[1])); + } + } - /** Used to resolve the decompiled source of functions. */ - var funcToString = Function.prototype.toString; + return returnValue || React.createElement('td', { onClick: _this.handleClick, onMouseEnter: _this.handleMouseEnter, onMouseLeave: _this.handleMouseLeave, key: index, style: columnStyles }, firstColAppend, col[1]); + }); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + // Don't compete with onRowClick, but if no onRowClick function then + // clicking on the row should trigger select + var trOnClick, tdOnClick; + if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { + trOnClick = null; + tdOnClick = this.handleSelectClick; + } else { + if (this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + trOnClick = this.handleSelectClick; + tdOnClick = null; + } else { + trOnClick = null; + tdOnClick = null; + } + } - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { + var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); + + nodes.unshift(React.createElement('td', { + key: 'selection', + style: columnStyles, + className: 'griddle-select griddle-select-cell', + onClick: tdOnClick + }, React.createElement('input', { + type: 'checkbox', + checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), + onChange: this.handleSelectionChange, + ref: 'selected' + }))); + } - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + //Get the row from the row settings. + var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; - /** Built-in value references. */ - var splice = arrayProto.splice; + if (that.props.isChildRow) { + className = "child-row"; + } else if (that.props.hasChildren) { + className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; + } - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); + return React.createElement('tr', { onClick: trOnClick, className: className }, nodes); + } + }); - /** - * Creates an hash object. - * - * @private - * @constructor - * @returns {Object} Returns the new hash object. - */ - function Hash() {} + module.exports = GridRow; - /** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; - } +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; - } + 'use strict'; - /** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); - } + var forEach = __webpack_require__(188); + var isObject = __webpack_require__(37); + var isArray = __webpack_require__(73); + var isFunction = __webpack_require__(30); + var isPlainObject = __webpack_require__(191); + var forOwn = __webpack_require__(193); - /** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function hashSet(hash, key, value) { - hash[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; - } + // Credits: https://github.com/documentcloud/underscore-contrib + // Sub module: underscore.object.selectors + // License: MIT (https://github.com/documentcloud/underscore-contrib/blob/master/LICENSE) + // https://github.com/documentcloud/underscore-contrib/blob/master/underscore.object.selectors.js - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function MapCache(values) { - var index = -1, - length = values ? values.length : 0; + // Will take a path like 'element[0][1].subElement["Hey!.What?"]["[hey]"]' + // and return ["element", "0", "1", "subElement", "Hey!.What?", "[hey]"] + function keysFromPath(path) { + // from http://codereview.stackexchange.com/a/63010/8176 + /** + * Repeatedly capture either: + * - a bracketed expression, discarding optional matching quotes inside, or + * - an unbracketed expression, delimited by a dot or a bracket. + */ + var re = /\[("|')(.+)\1\]|([^.\[\]]+)/g; - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); + var elements = []; + var result; + while ((result = re.exec(path)) !== null) { + elements.push(result[2] || result[3]); } + return elements; } - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapClear() { - this.__data__ = { - 'hash': new Hash(), - 'map': Map ? new Map() : [], - 'string': new Hash() - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + // Gets the value at any depth in a nested object based on the + // path described by the keys given. Keys may be given as an array + // or as a dot-separated string. + function getPath(obj, ks) { + if (typeof ks == "string") { + if (obj[ks] !== undefined) { + return obj[ks]; + } + ks = keysFromPath(ks); } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); - } - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); - } + var i = -1, + length = ks.length; - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); + // If the obj is null or undefined we have to break as + // a TypeError will result trying to access any property + // Otherwise keep incrementally access the next property in + // ks until complete + while (++i < length && obj != null) { + obj = obj[ks[i]]; } - return Map ? data.map.has(key) : assocHas(data.map, key); + return i === length ? obj : void 0; } - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; - } + // Based on the origin underscore _.pick function + // Credit: https://github.com/jashkenas/underscore/blob/master/underscore.js + function powerPick(object, keys) { + var result = {}, + obj = object, + iteratee; + iteratee = function (key, obj) { + return key in obj; + }; - /** - * - * Creates a set cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values ? values.length : 0; + obj = Object(obj); - this.__data__ = new MapCache(); - while (++index < length) { - this.push(values[index]); + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + if (iteratee(key, obj)) result[key] = getPath(obj, key); } + + return result; } - /** - * Adds `value` to the set cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var map = this.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - hash[value] = HASH_UNDEFINED; - } else { - map.set(value, HASH_UNDEFINED); - } - } - - /** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; - } - - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } - - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } - - /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || type == 'string' && value != '__proto__' || value == null; - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || value !== value && other !== other; - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); - } - - // Avoid inheriting from `Object.prototype` when possible. - Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - - // Add functions to the `MapCache`. - MapCache.prototype.clear = mapClear; - MapCache.prototype['delete'] = mapDelete; - MapCache.prototype.get = mapGet; - MapCache.prototype.has = mapHas; - MapCache.prototype.set = mapSet; - - // Add functions to the `SetCache`. - SetCache.prototype.push = cachePush; - - module.exports = SetCache; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }()))) - -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - 'use strict'; - - var React = __webpack_require__(2); - var ColumnProperties = __webpack_require__(8); - var pick = __webpack_require__(25); - - var GridRowContainer = React.createClass({ - displayName: 'GridRowContainer', - - getDefaultProps: function getDefaultProps() { - return { - "useGriddleStyles": true, - "useGriddleIcons": true, - "isSubGriddle": false, - "columnSettings": null, - "rowSettings": null, - "paddingHeight": null, - "rowHeight": null, - "parentRowCollapsedClassName": "parent-row", - "parentRowExpandedClassName": "parent-row expanded", - "parentRowCollapsedComponent": "▶", - "parentRowExpandedComponent": "▼", - "onRowClick": null, - "multipleSelectionSettings": null - }; - }, - getInitialState: function getInitialState() { - return { - "data": {}, - "showChildren": false - }; - }, - componentWillReceiveProps: function componentWillReceiveProps() { - this.setShowChildren(false); - }, - toggleChildren: function toggleChildren() { - this.setShowChildren(this.state.showChildren === false); - }, - setShowChildren: function setShowChildren(visible) { - this.setState({ - showChildren: visible - }); - }, - verifyProps: function verifyProps() { - if (this.props.columnSettings === null) { - console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be"); - } - }, - render: function render() { - this.verifyProps(); - var that = this; - if (typeof this.props.data === "undefined") { - return React.createElement('tbody', null); - } - var arr = []; - - var columns = this.props.columnSettings.getColumns(); - - arr.push(React.createElement(this.props.rowSettings.rowComponent, { - useGriddleStyles: this.props.useGriddleStyles, - isSubGriddle: this.props.isSubGriddle, - data: this.props.rowSettings.isCustom ? pick(this.props.data, columns) : this.props.data, - rowData: this.props.rowSettings.isCustom ? this.props.data : null, - columnSettings: this.props.columnSettings, - rowSettings: this.props.rowSettings, - hasChildren: that.props.hasChildren, - toggleChildren: that.toggleChildren, - showChildren: that.state.showChildren, - key: that.props.uniqueId + '_base_row', - useGriddleIcons: that.props.useGriddleIcons, - parentRowExpandedClassName: this.props.parentRowExpandedClassName, - parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, - parentRowExpandedComponent: this.props.parentRowExpandedComponent, - parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, - paddingHeight: that.props.paddingHeight, - rowHeight: that.props.rowHeight, - onRowClick: that.props.onRowClick, - multipleSelectionSettings: this.props.multipleSelectionSettings })); - - var children = null; - - if (that.state.showChildren) { - children = that.props.hasChildren && this.props.data["children"].map(function (row, index) { - var key = that.props.rowSettings.getRowKey(row, index); - - if (typeof row["children"] !== "undefined") { - var Griddle = that.constructor.Griddle; - return React.createElement('tr', { key: key, style: { paddingLeft: 5 } }, React.createElement('td', { colSpan: that.props.columnSettings.getVisibleColumnCount(), className: 'griddle-parent', style: that.props.useGriddleStyles ? { border: "none", "padding": "0 0 0 5px" } : null }, React.createElement(Griddle, { - rowMetadata: { key: 'id' }, - isSubGriddle: true, - results: [row], - columns: that.props.columnSettings.getColumns(), - tableClassName: that.props.tableClassName, - parentRowExpandedClassName: that.props.parentRowExpandedClassName, - parentRowCollapsedClassName: that.props.parentRowCollapsedClassName, - showTableHeading: false, - showPager: false, - columnMetadata: that.props.columnSettings.columnMetadata, - parentRowExpandedComponent: that.props.parentRowExpandedComponent, - parentRowCollapsedComponent: that.props.parentRowCollapsedComponent, - paddingHeight: that.props.paddingHeight, - rowHeight: that.props.rowHeight - }))); - } - - return React.createElement(that.props.rowSettings.rowComponent, { - useGriddleStyles: that.props.useGriddleStyles, - isSubGriddle: that.props.isSubGriddle, - data: row, - columnSettings: that.props.columnSettings, - isChildRow: true, - columnMetadata: that.props.columnSettings.columnMetadata, - key: key - }); - }); - } - - return that.props.hasChildren === false ? arr[0] : React.createElement('tbody', null, that.state.showChildren ? arr.concat(children) : arr); - } - }); - - module.exports = GridRowContainer; - -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.1.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var baseFlatten = __webpack_require__(19), - rest = __webpack_require__(20); - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * The base implementation of `_.pick` without support for individual - * property names. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, props) { - object = Object(object); - return arrayReduce(props, function (result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = rest(function (object, props) { - return object == null ? {} : basePick(object, baseFlatten(props, 1)); - }); - - module.exports = pick; - -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _createClass = (function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); - } - }return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; - }; - })(); - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - - var _uniqueId = __webpack_require__(27); - - var RowProperties = (function () { - function RowProperties() { - var rowMetadata = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var rowComponent = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var isCustom = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; - - _classCallCheck(this, RowProperties); - - this.rowMetadata = rowMetadata; - this.rowComponent = rowComponent; - this.isCustom = isCustom; - // assign unique Id to each griddle instance - } - - _createClass(RowProperties, [{ - key: 'getRowKey', - value: function getRowKey(row, key) { - var uniqueId; - - if (this.hasRowMetadataKey()) { - uniqueId = row[this.rowMetadata.key]; - } else { - uniqueId = _uniqueId("grid_row"); - } - - //todo: add error handling - - return uniqueId; - } - }, { - key: 'hasRowMetadataKey', - value: function hasRowMetadataKey() { - return this.hasRowMetadata() && this.rowMetadata.key !== null && this.rowMetadata.key !== undefined; - } - }, { - key: 'getBodyRowMetadataClass', - value: function getBodyRowMetadataClass(rowData) { - if (this.hasRowMetadata() && this.rowMetadata.bodyCssClassName !== null && this.rowMetadata.bodyCssClassName !== undefined) { - if (typeof this.rowMetadata.bodyCssClassName === 'function') { - return this.rowMetadata.bodyCssClassName(rowData); - } else { - return this.rowMetadata.bodyCssClassName; - } - } - return null; - } - }, { - key: 'getHeaderRowMetadataClass', - value: function getHeaderRowMetadataClass() { - return this.hasRowMetadata() && this.rowMetadata.headerCssClassName !== null && this.rowMetadata.headerCssClassName !== undefined ? this.rowMetadata.headerCssClassName : null; - } - }, { - key: 'hasRowMetadata', - value: function hasRowMetadata() { - return this.rowMetadata !== null; - } - }]); - - return RowProperties; - })(); - - module.exports = RowProperties; - -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 3.2.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var root = __webpack_require__(28); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Built-in value references. */ - var Symbol = root.Symbol; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = Symbol ? symbolProto.toString : undefined; - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (value == null) { - return ''; - } - if (isSymbol(value)) { - return Symbol ? symbolToString.call(value) : ''; - } - var result = value + ''; - return result == '0' && 1 / value == -INFINITY ? '-0' : result; - } - - /** - * Generates a unique ID. If `prefix` is provided the ID is appended to it. - * - * @static - * @memberOf _ - * @category Util - * @param {string} [prefix] The value to prefix the ID with. - * @returns {string} Returns the unique ID. - * @example - * - * _.uniqueId('contact_'); - * // => 'contact_104' - * - * _.uniqueId(); - * // => '105' - */ - function uniqueId(prefix) { - var id = ++idCounter; - return toString(prefix) + id; - } - - module.exports = uniqueId; - -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(module, global) {/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used to determine if values are of the language type `Object`. */ - 'use strict'; - - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType ? exports : undefined; - - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType ? module : undefined; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof undefined] && undefined); - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || freeWindow !== (thisGlobal && thisGlobal.window) && freeWindow || freeSelf || thisGlobal || Function('return this')(); - - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return value && value.Object === Object ? value : null; - } - - module.exports = root; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }()))) - -/***/ }, -/* 29 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - "use strict"; - - var React = __webpack_require__(2); - - var GridFilter = React.createClass({ - displayName: "GridFilter", - - getDefaultProps: function getDefaultProps() { - return { - "placeholderText": "" - }; - }, - handleChange: function handleChange(event) { - this.props.changeFilter(event.target.value); - }, - render: function render() { - return React.createElement("div", { className: "filter-container" }, React.createElement("input", { type: "text", name: "filter", placeholder: this.props.placeholderText, className: "form-control", onChange: this.handleChange })); - } - }); - - module.exports = GridFilter; - -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - 'use strict'; - - var React = __webpack_require__(2); - var assign = __webpack_require__(31); - - //needs props maxPage, currentPage, nextFunction, prevFunction - var GridPagination = React.createClass({ - displayName: 'GridPagination', - - getDefaultProps: function getDefaultProps() { - return { - "maxPage": 0, - "nextText": "", - "previousText": "", - "currentPage": 0, - "useGriddleStyles": true, - "nextClassName": "griddle-next", - "previousClassName": "griddle-previous", - "nextIconComponent": null, - "previousIconComponent": null - }; - }, - pageChange: function pageChange(event) { - this.props.setPage(parseInt(event.target.value, 10) - 1); - }, - render: function render() { - var previous = ""; - var next = ""; - - if (this.props.currentPage > 0) { - previous = React.createElement('button', { type: 'button', onClick: this.props.previous, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 0 0 10px" } : null }, this.props.previousIconComponent, this.props.previousText); - } - - if (this.props.currentPage !== this.props.maxPage - 1) { - next = React.createElement('button', { type: 'button', onClick: this.props.next, style: this.props.useGriddleStyles ? { "color": "#222", border: "none", background: "none", margin: "0 10px 0 0" } : null }, this.props.nextText, this.props.nextIconComponent); - } - - var leftStyle = null; - var middleStyle = null; - var rightStyle = null; - - if (this.props.useGriddleStyles === true) { - var baseStyle = { - "float": "left", - minHeight: "1px", - marginTop: "5px" - }; - - rightStyle = assign({ textAlign: "right", width: "34%" }, baseStyle); - middleStyle = assign({ textAlign: "center", width: "33%" }, baseStyle); - leftStyle = assign({ width: "33%" }, baseStyle); - } - - var options = []; - - for (var i = 1; i <= this.props.maxPage; i++) { - options.push(React.createElement('option', { value: i, key: i }, i)); - } - - return React.createElement('div', { style: this.props.useGriddleStyles ? { minHeight: "35px" } : null }, React.createElement('div', { className: this.props.previousClassName, style: leftStyle }, previous), React.createElement('div', { className: 'griddle-page', style: middleStyle }, React.createElement('select', { value: this.props.currentPage + 1, onChange: this.pageChange }, options), ' / ', this.props.maxPage), React.createElement('div', { className: this.props.nextClassName, style: rightStyle }, next)); - } - }); - - module.exports = GridPagination; - -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.0.6 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var keys = __webpack_require__(32), - rest = __webpack_require__(20); - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ - var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { - object[key] = value; - } - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return rest(function (object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; - - return value === proto; - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || value !== value && other !== other; - } - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - var assign = createAssigner(function (object, source) { - if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - module.exports = assign; - -/***/ }, -/* 32 */ -/***/ function(module, exports) { - - /** - * lodash 4.0.5 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used as references for various `Number` constants. */ - 'use strict'; - - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]'; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Built-in value references. */ - var getPrototypeOf = Object.getPrototypeOf, - propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = Object.keys; - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || typeof object == 'object' && key in object && getPrototypeOf(object) === null; - } - - /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && !(skipIndexes && (key == 'length' || isIndex(key, length))) && !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; - } - - module.exports = keys; - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - 'use strict'; - - var React = __webpack_require__(2); - var includes = __webpack_require__(34); - var without = __webpack_require__(35); - var find = __webpack_require__(15); - - var GridSettings = React.createClass({ - displayName: 'GridSettings', - - getDefaultProps: function getDefaultProps() { - return { - "columns": [], - "columnMetadata": [], - "selectedColumns": [], - "settingsText": "", - "maxRowsText": "", - "resultsPerPage": 0, - "enableToggleCustom": false, - "useCustomComponent": false, - "useGriddleStyles": true, - "toggleCustomComponent": function toggleCustomComponent() {} - }; - }, - setPageSize: function setPageSize(event) { - var value = parseInt(event.target.value, 10); - this.props.setPageSize(value); - }, - handleChange: function handleChange(event) { - var columnName = event.target.dataset ? event.target.dataset.name : event.target.getAttribute('data-name'); - if (event.target.checked === true && includes(this.props.selectedColumns, columnName) === false) { - this.props.selectedColumns.push(columnName); - this.props.setColumns(this.props.selectedColumns); - } else { - /* redraw with the selected columns minus the one just unchecked */ - this.props.setColumns(without(this.props.selectedColumns, columnName)); - } - }, - render: function render() { - var that = this; - - var nodes = []; - //don't show column selector if we're on a custom component - if (that.props.useCustomComponent === false) { - nodes = this.props.columns.map(function (col, index) { - var checked = includes(that.props.selectedColumns, col); - //check column metadata -- if this one is locked make it disabled and don't put an onChange event - var meta = find(that.props.columnMetadata, { columnName: col }); - var displayName = col; - - if (typeof meta !== "undefined" && typeof meta.displayName !== "undefined" && meta.displayName != null) { - displayName = meta.displayName; - } - - if (typeof meta !== "undefined" && meta != null && meta.locked) { - return React.createElement('div', { className: 'column checkbox' }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', disabled: true, name: 'check', checked: checked, 'data-name': col }), displayName)); - } else if (typeof meta !== "undefined" && meta != null && typeof meta.visible !== "undefined" && meta.visible === false) { - return null; - } - return React.createElement('div', { className: 'griddle-column-selection checkbox', key: col, style: that.props.useGriddleStyles ? { "float": "left", width: "20%" } : null }, React.createElement('label', null, React.createElement('input', { type: 'checkbox', name: 'check', onChange: that.handleChange, checked: checked, 'data-name': col }), displayName)); - }); - } - - var toggleCustom = that.props.enableToggleCustom ? React.createElement('div', { className: 'form-group' }, React.createElement('label', { htmlFor: 'maxRows' }, React.createElement('input', { type: 'checkbox', checked: this.props.useCustomComponent, onChange: this.props.toggleCustomComponent }), ' ', this.props.enableCustomFormatText)) : ""; - - var setPageSize = this.props.showSetPageSize ? React.createElement('div', null, React.createElement('label', { htmlFor: 'maxRows' }, this.props.maxRowsText, ':', React.createElement('select', { onChange: this.setPageSize, value: this.props.resultsPerPage }, React.createElement('option', { value: '5' }, '5'), React.createElement('option', { value: '10' }, '10'), React.createElement('option', { value: '25' }, '25'), React.createElement('option', { value: '50' }, '50'), React.createElement('option', { value: '100' }, '100')))) : ""; - - return React.createElement('div', { className: 'griddle-settings', style: this.props.useGriddleStyles ? { backgroundColor: "#FFF", border: "1px solid #DDD", color: "#222", padding: "10px", marginBottom: "10px" } : null }, React.createElement('h6', null, this.props.settingsText), React.createElement('div', { className: 'griddle-columns', style: this.props.useGriddleStyles ? { clear: "both", display: "table", width: "100%", borderBottom: "1px solid #EDEDED", marginBottom: "10px" } : null }, nodes), setPageSize, toggleCustom); - } - }); - - module.exports = GridSettings; - -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var keys = __webpack_require__(32); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function (key) { - return object[key]; - }); - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while (fromRight ? index-- : ++index < length) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max; - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Checks if `value` is in `collection`. If `collection` is a string it's checked - * for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object ? baseValues(object, keys(object)) : []; - } - - module.exports = includes; - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.1.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var baseDifference = __webpack_require__(22), - rest = __webpack_require__(20); - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ - var without = rest(function (array, values) { - return isArrayLikeObject(array) ? baseDifference(array, values) : []; - }); - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - module.exports = without; - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - "use strict"; - - var React = __webpack_require__(2); - - var GridNoData = React.createClass({ - displayName: "GridNoData", - - getDefaultProps: function getDefaultProps() { - return { - "noDataMessage": "No Data" - }; - }, - render: function render() { - var that = this; - - return React.createElement("div", null, this.props.noDataMessage); - } - }); - - module.exports = GridNoData; - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - 'use strict'; - - var React = __webpack_require__(2); - var ColumnProperties = __webpack_require__(8); - var deep = __webpack_require__(38); - var isFunction = __webpack_require__(42); - var fromPairs = __webpack_require__(43); - var assign = __webpack_require__(31); - var defaults = __webpack_require__(44); - var toPairs = __webpack_require__(47); - var without = __webpack_require__(35); - - var GridRow = React.createClass({ - displayName: 'GridRow', - - getDefaultProps: function getDefaultProps() { - return { - "isChildRow": false, - "showChildren": false, - "data": {}, - "columnSettings": null, - "rowSettings": null, - "hasChildren": false, - "useGriddleStyles": true, - "useGriddleIcons": true, - "isSubGriddle": false, - "paddingHeight": null, - "rowHeight": null, - "parentRowCollapsedClassName": "parent-row", - "parentRowExpandedClassName": "parent-row expanded", - "parentRowCollapsedComponent": "▶", - "parentRowExpandedComponent": "▼", - "onRowClick": null, - "multipleSelectionSettings": null - }; - }, - handleClick: function handleClick(e) { - if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) { - this.props.onRowClick(this, e); - } else if (this.props.hasChildren) { - this.props.toggleChildren(); - } - }, - handleSelectionChange: function handleSelectionChange(e) { - //hack to get around warning that's not super useful in this case - return; - }, - handleSelectClick: function handleSelectClick(e) { - if (this.props.multipleSelectionSettings.isMultipleSelection) { - if (e.target.type === "checkbox") { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, this.refs.selected.checked); - } else { - this.props.multipleSelectionSettings.toggleSelectRow(this.props.data, !this.refs.selected.checked); - } - } - }, - verifyProps: function verifyProps() { - if (this.props.columnSettings === null) { - console.error("gridRow: The columnSettings prop is null and it shouldn't be"); - } - }, - render: function render() { - var _this = this; - - this.verifyProps(); - var that = this; - var columnStyles = null; - - if (this.props.useGriddleStyles) { - columnStyles = { - margin: "0", - padding: that.props.paddingHeight + "px 5px " + that.props.paddingHeight + "px 5px", - height: that.props.rowHeight ? this.props.rowHeight - that.props.paddingHeight * 2 + "px" : null, - backgroundColor: "#FFF", - borderTopColor: "#DDD", - color: "#222" - }; - } - - var columns = this.props.columnSettings.getColumns(); - - // make sure that all the columns we need have default empty values - // otherwise they will get clipped - var defaultValues = fromPairs(columns, []); - - // creates a 'view' on top the data so we will not alter the original data but will allow us to add default values to missing columns - var dataView = assign({}, this.props.data); - - defaults(dataView, defaultValues); - var data = toPairs(deep.pick(dataView, without(columns, 'children'))); - var nodes = data.map(function (col, index) { - var returnValue = null; - var meta = _this.props.columnSettings.getColumnMetadataByName(col[0]); - - //todo: Make this not as ridiculous looking - var firstColAppend = index === 0 && _this.props.hasChildren && _this.props.showChildren === false && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px", marginRight: "5px" } : null }, _this.props.parentRowCollapsedComponent) : index === 0 && _this.props.hasChildren && _this.props.showChildren && _this.props.useGriddleIcons ? React.createElement('span', { style: _this.props.useGriddleStyles ? { fontSize: "10px" } : null }, _this.props.parentRowExpandedComponent) : ""; - - if (index === 0 && _this.props.isChildRow && _this.props.useGriddleStyles) { - columnStyles = assign(columnStyles, { paddingLeft: 10 }); - } - - if (_this.props.columnSettings.hasColumnMetadata() && typeof meta !== 'undefined' && meta !== null) { - if (typeof meta.customComponent !== 'undefined' && meta.customComponent !== null) { - var customComponent = React.createElement(meta.customComponent, { data: col[1], rowData: dataView, metadata: meta }); - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, customComponent); - } else { - returnValue = React.createElement('td', { onClick: _this.handleClick, className: meta.cssClassName, key: index, style: columnStyles }, firstColAppend, col[1]); - } - } - - return returnValue || React.createElement('td', { onClick: _this.handleClick, key: index, style: columnStyles }, firstColAppend, col[1]); - }); - - if (nodes && this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection) { - var selectedRowIds = this.props.multipleSelectionSettings.getSelectedRowIds(); - - nodes.unshift(React.createElement('td', { key: 'selection', style: columnStyles }, React.createElement('input', { - type: 'checkbox', - checked: this.props.multipleSelectionSettings.getIsRowChecked(dataView), - onChange: this.handleSelectionChange, - ref: 'selected' }))); - } - - //Get the row from the row settings. - var className = that.props.rowSettings && that.props.rowSettings.getBodyRowMetadataClass(that.props.data) || "standard-row"; - - if (that.props.isChildRow) { - className = "child-row"; - } else if (that.props.hasChildren) { - className = that.props.showChildren ? this.props.parentRowExpandedClassName : this.props.parentRowCollapsedClassName; - } - return React.createElement('tr', { onClick: this.props.multipleSelectionSettings && this.props.multipleSelectionSettings.isMultipleSelection ? this.handleSelectClick : null, className: className }, nodes); - } - }); - - module.exports = GridRow; - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var forEach = __webpack_require__(39); - var isObject = __webpack_require__(40); - var isArray = __webpack_require__(41); - var isFunction = __webpack_require__(42); - - // Credits: https://github.com/documentcloud/underscore-contrib - // Sub module: underscore.object.selectors - // License: MIT (https://github.com/documentcloud/underscore-contrib/blob/master/LICENSE) - // https://github.com/documentcloud/underscore-contrib/blob/master/underscore.object.selectors.js - - // Will take a path like 'element[0][1].subElement["Hey!.What?"]["[hey]"]' - // and return ["element", "0", "1", "subElement", "Hey!.What?", "[hey]"] - function keysFromPath(path) { - // from http://codereview.stackexchange.com/a/63010/8176 - /** - * Repeatedly capture either: - * - a bracketed expression, discarding optional matching quotes inside, or - * - an unbracketed expression, delimited by a dot or a bracket. - */ - var re = /\[("|')(.+)\1\]|([^.\[\]]+)/g; - - var elements = []; - var result; - while ((result = re.exec(path)) !== null) { - elements.push(result[2] || result[3]); - } - return elements; - } - - // Gets the value at any depth in a nested object based on the - // path described by the keys given. Keys may be given as an array - // or as a dot-separated string. - function getPath(obj, ks) { - ks = typeof ks == "string" ? keysFromPath(ks) : ks; - - var i = -1, - length = ks.length; - - // If the obj is null or undefined we have to break as - // a TypeError will result trying to access any property - // Otherwise keep incrementally access the next property in - // ks until complete - while (++i < length && obj != null) { - obj = obj[ks[i]]; - } - return i === length ? obj : void 0; - } - - // Based on the origin underscore _.pick function - // Credit: https://github.com/jashkenas/underscore/blob/master/underscore.js - function powerPick(object, keys) { - var result = {}, - obj = object, - iteratee; - iteratee = function (key, obj) { - return key in obj; - }; - - obj = Object(obj); - - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - if (iteratee(key, obj)) result[key] = getPath(obj, key); - } - - return result; - } - - // Gets all the keys for a flattened object structure. - // Doesn't flatten arrays. - // Input: - // { - // a: { - // x: 1, - // y: 2 - // }, - // b: [3, 4], - // c: 5 - // } - // Output: - // [ - // "a.x", - // "a.y", - // "b", - // "c" - // ] - function getKeys(obj, prefix) { - var keys = []; - - forEach(obj, function (value, key) { - var fullKey = prefix ? prefix + "." + key : key; - if (isObject(value) && !isArray(value) && !isFunction(value)) { - keys = keys.concat(getKeys(value, fullKey)); - } else { - keys.push(fullKey); - } - }); - - return keys; - } - - module.exports = { - pick: powerPick, - getAt: getPath, - keys: getKeys - }; - -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.1.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var baseEach = __webpack_require__(10); - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the array-like object. - */ - function baseCastFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(value) { - * console.log(value); - * }); - * // => logs `1` then `2` - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ - function forEach(collection, iteratee) { - return typeof iteratee == 'function' && isArray(collection) ? arrayEach(collection, iteratee) : baseEach(collection, baseCastFunction(iteratee)); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * This method returns the first argument given to it. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ - function identity(value) { - return value; - } - - module.exports = forEach; - -/***/ }, -/* 40 */ -/***/ function(module, exports) { - - /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - 'use strict'; - - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - module.exports = isObject; - -/***/ }, -/* 41 */ -/***/ function(module, exports) { - - /** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - "use strict"; - - var isArray = Array.isArray; - - module.exports = isArray; - -/***/ }, -/* 42 */ -/***/ function(module, exports) { - - /** - * lodash 3.0.8 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** `Object#toString` result references. */ - 'use strict'; - - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - module.exports = isFunction; - -/***/ }, -/* 43 */ -/***/ function(module, exports) { - - /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - "use strict"; - - function fromPairs(pairs) { - var index = -1, - length = pairs ? pairs.length : 0, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - module.exports = fromPairs; - -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var assignInWith = __webpack_require__(45), - rest = __webpack_require__(20); - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { - return srcValue; - } - return objValue; - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || value !== value && other !== other; - } - - /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = rest(function (args) { - args.push(undefined, assignInDefaults); - return apply(assignInWith, undefined, args); - }); - - module.exports = defaults; - -/***/ }, -/* 45 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.0.5 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var keysIn = __webpack_require__(46), - rest = __webpack_require__(20); - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { - object[key] = value; - } - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return rest(function (object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { - return eq(object[index], value); - } - return false; - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || value !== value && other !== other; - } - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); - }); - - module.exports = assignInWith; - -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(module, global) {/** - * lodash 4.1.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** Used as references for various `Number` constants. */ - 'use strict'; - - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]'; + // Gets all the keys for a flattened object structure. + // Doesn't flatten arrays. + // Input: + // { + // a: { + // x: 1, + // y: 2 + // }, + // b: [3, 4], + // c: 5 + // } + // Output: + // [ + // "a.x", + // "a.y", + // "b", + // "c" + // ] + function getKeys(obj, prefix) { + var keys = []; - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + forEach(obj, function (value, key) { + var fullKey = prefix ? prefix + "." + key : key; + if (isObject(value) && !isArray(value) && !isFunction(value) && !(value instanceof Date)) { + keys = keys.concat(getKeys(value, fullKey)); + } else { + keys.push(fullKey); + } + }); - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; + return keys; + } - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType ? exports : undefined; + // Recursivly traverse plain objects and arrays calling `fn` on each + // non-object/non-array leaf node. + function iterObject(thing, fn) { + if (isArray(thing)) { + forEach(thing, function (item) { + iterObject(item, fn); + }); + } else if (isPlainObject(thing)) { + forOwn(thing, function (item) { + iterObject(item, fn); + }); + } else { + fn(thing); + } + } - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType ? module : undefined; + // Recursivly traverse plain objects and arrays and build a list of all + // non-object/non-array leaf nodes. + // + // Input: + // { "array": [1, "two", {"tree": 3}], "string": "a string" } + // + // Output: + // [1, 'two', 3, 'a string'] + // + function getObjectValues(thing) { + var results = []; + iterObject(thing, function (value) { + results.push(value); + }); + return results; + } - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + module.exports = { + pick: powerPick, + getAt: getPath, + keys: getKeys, + getObjectValues: getObjectValues + }; - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); + 'use strict'; - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof undefined] && undefined); + var arrayEach = __webpack_require__(189), + baseEach = __webpack_require__(125), + castFunction = __webpack_require__(190), + isArray = __webpack_require__(73); /** - * Used as a reference to the global object. + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || freeWindow !== (thisGlobal && thisGlobal.window) && freeWindow || freeSelf || thisGlobal || Function('return this')(); - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * Checks if `value` is a global object. + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return value && value.Object === Object ? value : null; - } - - /** - * Checks if `value` is a valid array-like index. + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ - function isIndex(value, length) { - value = typeof value == 'number' || reIsUint.test(value) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); } + module.exports = forEach; + +/***/ }, +/* 189 */ +/***/ function(module, exports) { + /** - * Converts `iterator` to an array. + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. * * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. */ - function iteratorToArray(iterator) { - var data, - result = []; + "use strict"; + + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; - while (!(data = iterator.next()).done) { - result.push(data.value); + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } } - return result; + return array; } - /** Used for built-in method references. */ - var objectProto = Object.prototype; + module.exports = arrayEach; - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }, +/* 190 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + 'use strict'; - /** Built-in value references. */ - var Reflect = root.Reflect, - enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; + var identity = __webpack_require__(120); /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * Casts `value` to `identity` if it's not a function. * * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. */ - function baseKeysIn(object) { - object = object == null ? object : Object(object); - - var result = []; - for (var key in object) { - result.push(key); - } - return result; + function castFunction(value) { + return typeof value == 'function' ? value : identity; } - // Fallback for IE < 9 with es6-shim. - if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function (object) { - return iteratorToArray(enumerate(object)); - }; - } + module.exports = castFunction; - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; - } +/***/ }, +/* 191 */ +/***/ function(module, exports, __webpack_require__) { - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); + 'use strict'; - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } + var baseGetTag = __webpack_require__(31), + getPrototype = __webpack_require__(192), + isObjectLike = __webpack_require__(82); - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + /** `Object#toString` result references. */ + var objectTag = '[object Object]'; - return value === proto; - } + /** Used for built-in method references. */ + var funcProto = Function.prototype, + objectProto = Object.prototype; - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); /** - * Checks if `value` is classified as an `Array` object. + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ - * @type {Function} + * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false + * function Foo() { + * this.a = 1; + * } * - * _.isArray('abc'); + * _.isPlainObject(new Foo); * // => false * - * _.isArray(_.noop); + * _.isPlainObject([1, 2, 3]); * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true * - * _.isArrayLike(document.body.children); + * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * - * _.isArrayLike('abc'); + * _.isPlainObject(Object.create(null)); * // => true - * - * _.isArrayLike(_.noop); - * // => false */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } + module.exports = isPlainObject; + +/***/ }, +/* 192 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var overArg = __webpack_require__(95); + + /** Built-in value references. */ + var getPrototype = overArg(Object.getPrototypeOf, Object); + + module.exports = getPrototype; + +/***/ }, +/* 193 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseForOwn = __webpack_require__(126), + castFunction = __webpack_require__(190); /** - * Checks if `value` is classified as a `Function` object. + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight * @example * - * _.isFunction(_); - * // => true + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.isFunction(/abc/); - * // => false + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); } + module.exports = forOwn; + +/***/ }, +/* 194 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var assignValue = __webpack_require__(164), + baseZipObject = __webpack_require__(195); + /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. * @example * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); } + module.exports = zipObject; + +/***/ }, +/* 195 */ +/***/ function(module, exports) { + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * - * _.isObject(null); - * // => false + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + "use strict"; + + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; } + module.exports = baseZipObject; + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var apply = __webpack_require__(148), + assignInWith = __webpack_require__(197), + baseRest = __webpack_require__(146), + customDefaultsAssignIn = __webpack_require__(201); + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep * @example * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } + var defaults = baseRest(function (args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); + }); + + module.exports = defaults; + +/***/ }, +/* 197 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var copyObject = __webpack_require__(166), + createAssigner = __webpack_require__(167), + keysIn = __webpack_require__(198); /** - * Checks if `value` is classified as a `String` primitive or object. + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith * @example * - * _.isString('abc'); - * // => true + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } * - * _.isString(1); - * // => false + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; - } + var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + module.exports = assignInWith; + +/***/ }, +/* 198 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayLikeKeys = __webpack_require__(78), + baseKeysIn = __webpack_require__(199), + isArrayLike = __webpack_require__(96); /** * Creates an array of the own and inherited enumerable property names of `object`. @@ -11728,6 +8623,7 @@ return /******/ (function(modules) { // webpackBootstrap * * @static * @memberOf _ + * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. @@ -11744,63 +8640,195 @@ return /******/ (function(modules) { // webpackBootstrap * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + module.exports = keysIn; + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isObject = __webpack_require__(37), + isPrototype = __webpack_require__(93), + nativeKeysIn = __webpack_require__(200); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } - module.exports = keysIn; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }()))) + module.exports = baseKeysIn; + +/***/ }, +/* 200 */ +/***/ function(module, exports) { + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + "use strict"; + + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + module.exports = nativeKeysIn; + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var eq = __webpack_require__(18); + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { + return srcValue; + } + return objValue; + } + + module.exports = customDefaultsAssignIn; + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var createToPairs = __webpack_require__(203), + keys = __webpack_require__(77); + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + module.exports = toPairs; /***/ }, -/* 47 */ +/* 203 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.1.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var keys = __webpack_require__(32); + var baseToPairs = __webpack_require__(204), + getTag = __webpack_require__(97), + mapToArray = __webpack_require__(67), + setToPairs = __webpack_require__(205); + + /** `Object#toString` result references. */ + var mapTag = '[object Map]', + setTag = '[object Set]'; /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; + function createToPairs(keysFunc) { + return function (object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; } + module.exports = createToPairs; + +/***/ }, +/* 204 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayMap = __webpack_require__(9); + /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. @@ -11808,7 +8836,7 @@ return /******/ (function(modules) { // webpackBootstrap * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. + * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function (key) { @@ -11816,35 +8844,35 @@ return /******/ (function(modules) { // webpackBootstrap }); } + module.exports = baseToPairs; + +/***/ }, +/* 205 */ +/***/ function(module, exports) { + /** - * Creates an array of own enumerable key-value pairs for `object` which - * can be consumed by `_.fromPairs`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; + * Converts `set` to its value-value pairs. * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. */ - function toPairs(object) { - return baseToPairs(object, keys(object)); + "use strict"; + + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function (value) { + result[++index] = [value, value]; + }); + return result; } - module.exports = toPairs; + module.exports = setToPairs; /***/ }, -/* 48 */ +/* 206 */ /***/ function(module, exports, __webpack_require__) { /* @@ -11890,7 +8918,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomRowComponentContainer; /***/ }, -/* 49 */ +/* 207 */ /***/ function(module, exports, __webpack_require__) { /* @@ -11902,6 +8930,16 @@ return /******/ (function(modules) { // webpackBootstrap */ "use strict"; + var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i];for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + }return target; + }; + var React = __webpack_require__(2); var CustomPaginationContainer = React.createClass({ @@ -11913,7 +8951,8 @@ return /******/ (function(modules) { // webpackBootstrap "nextText": "", "previousText": "", "currentPage": 0, - "customPagerComponent": {} + "customPagerComponent": {}, + "customPagerComponentOptions": {} }; }, render: function render() { @@ -11924,270 +8963,98 @@ return /******/ (function(modules) { // webpackBootstrap return React.createElement("div", null); } - return React.createElement(that.props.customPagerComponent, { maxPage: this.props.maxPage, nextText: this.props.nextText, previousText: this.props.previousText, currentPage: this.props.currentPage, setPage: this.props.setPage, previous: this.props.previous, next: this.props.next }); + return React.createElement(that.props.customPagerComponent, _extends({}, this.props.customPagerComponentOptions, { maxPage: this.props.maxPage, nextText: this.props.nextText, previousText: this.props.previousText, currentPage: this.props.currentPage, setPage: this.props.setPage, previous: this.props.previous, next: this.props.next })); } }); module.exports = CustomPaginationContainer; /***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { - - /* - See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE - */ - "use strict"; - - var React = __webpack_require__(2); - - var CustomFilterContainer = React.createClass({ - displayName: "CustomFilterContainer", - - getDefaultProps: function getDefaultProps() { - return { - "placeholderText": "" - }; - }, - render: function render() { - var that = this; - - if (typeof that.props.customFilterComponent !== 'function') { - console.log("Couldn't find valid template."); - return React.createElement("div", null); - } - - return React.createElement(that.props.customFilterComponent, { - changeFilter: this.props.changeFilter, - results: this.props.results, - currentResults: this.props.currentResults, - placeholderText: this.props.placeholderText }); - } - }); - - module.exports = CustomFilterContainer; - -/***/ }, -/* 51 */ +/* 208 */ /***/ function(module, exports, __webpack_require__) { - - /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - 'use strict'; - - var baseSlice = __webpack_require__(52); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = guard || n === undefined ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; + + /* + See License / Disclaimer https://raw.githubusercontent.com/DynamicTyped/Griddle/master/LICENSE + */ + "use strict"; + + var React = __webpack_require__(2); + + var CustomFilterContainer = React.createClass({ + displayName: "CustomFilterContainer", + + getDefaultProps: function getDefaultProps() { + return { + "placeholderText": "" + }; + }, + render: function render() { + var that = this; + + if (typeof that.props.customFilterComponent !== 'function') { + console.log("Couldn't find valid template."); + return React.createElement("div", null); + } + + return React.createElement(that.props.customFilterComponent, { + changeFilter: this.props.changeFilter, + results: this.props.results, + currentResults: this.props.currentResults, + placeholderText: this.props.placeholderText }); } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; - } + }); + + module.exports = CustomFilterContainer; + +/***/ }, +/* 209 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseSlice = __webpack_require__(210), + toInteger = __webpack_require__(136); /** - * Converts `value` to a number. + * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * _.toNumber(3); - * // => 3 + * _.drop([1, 2, 3]); + * // => [2, 3] * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 + * _.drop([1, 2, 3], 2); + * // => [3] * - * _.toNumber(Infinity); - * // => Infinity + * _.drop([1, 2, 3], 5); + * // => [] * - * _.toNumber('3'); - * // => 3 + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + n = guard || n === undefined ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); } module.exports = drop; /***/ }, -/* 52 */ +/* 210 */ /***/ function(module, exports) { - /** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - /** * The base implementation of `_.slice` without an iteratee call guard. * @@ -12223,63 +9090,24 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = baseSlice; /***/ }, -/* 53 */ +/* 211 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseSlice = __webpack_require__(52); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** Used for built-in method references. */ - var objectProto = Object.prototype; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + var baseSlice = __webpack_require__(210), + toInteger = __webpack_require__(136); /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ + * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * @@ -12296,7 +9124,7 @@ return /******/ (function(modules) { // webpackBootstrap * // => [1, 2, 3] */ function dropRight(array, n, guard) { - var length = array ? array.length : 0; + var length = array == null ? 0 : array.length; if (!length) { return []; } @@ -12305,1081 +9133,1364 @@ return /******/ (function(modules) { // webpackBootstrap return baseSlice(array, 0, n < 0 ? 0 : n); } - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } + module.exports = dropRight; + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseSlice = __webpack_require__(210), + toInteger = __webpack_require__(136); /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. * @example * - * _.isObject({}); - * // => true + * _.take([1, 2, 3]); + * // => [1] * - * _.isObject([1, 2, 3]); - * // => true + * _.take([1, 2, 3], 2); + * // => [1, 2] * - * _.isObject(_.noop); - * // => true + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] * - * _.isObject(null); - * // => false + * _.take([1, 2, 3], 0); + * // => [] */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = guard || n === undefined ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); } + module.exports = take; + +/***/ }, +/* 213 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseSlice = __webpack_require__(210); + /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * Gets all but the last element of `array`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. * @example * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 + * _.initial([1, 2, 3]); + * // => [1, 2] */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; } + module.exports = initial; + +/***/ }, +/* 214 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayMap = __webpack_require__(9), + baseIntersection = __webpack_require__(215), + baseRest = __webpack_require__(146), + castArrayLikeObject = __webpack_require__(216); + /** - * Converts `value` to a number. + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. * @example * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 + * _.intersection([2, 1], [2, 3]); + * // => [2] */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; + var intersection = baseRest(function (arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; + }); + + module.exports = intersection; + +/***/ }, +/* 215 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var SetCache = __webpack_require__(60), + arrayIncludes = __webpack_require__(157), + arrayIncludesWith = __webpack_require__(161), + arrayMap = __webpack_require__(9), + baseUnary = __webpack_require__(90), + cacheHas = __webpack_require__(64); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMin = Math.min; + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined; } - if (typeof value != 'string') { - return value === 0 ? value : +value; + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = comparator || value !== 0 ? value : 0; + if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + return result; } - module.exports = dropRight; + module.exports = baseIntersection; /***/ }, -/* 54 */ +/* 216 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseSlice = __webpack_require__(52); - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; + var isArrayLikeObject = __webpack_require__(162); - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; + module.exports = castArrayLikeObject; - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; +/***/ }, +/* 217 */ +/***/ function(module, exports, __webpack_require__) { - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; + 'use strict'; - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; + var baseKeys = __webpack_require__(92), + getTag = __webpack_require__(97), + isArguments = __webpack_require__(80), + isArray = __webpack_require__(73), + isArrayLike = __webpack_require__(96), + isBuffer = __webpack_require__(83), + isPrototype = __webpack_require__(93), + isTypedArray = __webpack_require__(87); - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; + /** `Object#toString` result references. */ + var mapTag = '[object Map]', + setTag = '[object Set]'; /** Used for built-in method references. */ var objectProto = Object.prototype; - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; /** - * Creates a slice of `array` with `n` elements taken from the beginning. + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * - * _.take([1, 2, 3]); - * // => [1] + * _.isEmpty(null); + * // => true * - * _.take([1, 2, 3], 2); - * // => [1, 2] + * _.isEmpty(true); + * // => true * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] + * _.isEmpty(1); + * // => true * - * _.take([1, 2, 3], 0); - * // => [] + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; + function isEmpty(value) { + if (value == null) { + return true; } - n = guard || n === undefined ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); + if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; } + module.exports = isEmpty; + +/***/ }, +/* 218 */ +/***/ function(module, exports) { + /** - * Checks if `value` is classified as a `Function` object. + * Checks if `value` is `null`. * * @static * @memberOf _ + * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * - * _.isFunction(_); + * _.isNull(null); * // => true * - * _.isFunction(/abc/); + * _.isNull(void 0); * // => false */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + "use strict"; + + function isNull(value) { + return value === null; } + module.exports = isNull; + +/***/ }, +/* 219 */ +/***/ function(module, exports) { + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * Checks if `value` is `undefined`. * * @static + * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); + * _.isUndefined(void 0); * // => true * - * _.isObject(null); + * _.isUndefined(null); * // => false */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + "use strict"; + + function isUndefined(value) { + return value === undefined; } + module.exports = isUndefined; + +/***/ }, +/* 220 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayMap = __webpack_require__(9), + baseClone = __webpack_require__(221), + baseUnset = __webpack_require__(244), + castPath = __webpack_require__(108), + copyObject = __webpack_require__(166), + customOmitClone = __webpack_require__(247), + flatRest = __webpack_require__(173), + getAllKeysIn = __webpack_require__(229); + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + /** - * Converts `value` to an integer. + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * **Note:** This method is considerably slower than `_.pick`. * * @static + * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. * @example * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * _.toInteger('3'); - * // => 3 + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; + var omit = flatRest(function (object, paths) { + var result = {}; + if (object == null) { + return result; } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; + var isDeep = false; + paths = arrayMap(paths, function (path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; - } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + module.exports = omit; + +/***/ }, +/* 221 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Stack = __webpack_require__(13), + arrayEach = __webpack_require__(189), + assignValue = __webpack_require__(164), + baseAssign = __webpack_require__(222), + baseAssignIn = __webpack_require__(223), + cloneBuffer = __webpack_require__(224), + copyArray = __webpack_require__(225), + copySymbols = __webpack_require__(226), + copySymbolsIn = __webpack_require__(227), + getAllKeys = __webpack_require__(70), + getAllKeysIn = __webpack_require__(229), + getTag = __webpack_require__(97), + initCloneArray = __webpack_require__(230), + initCloneByTag = __webpack_require__(231), + initCloneObject = __webpack_require__(242), + isArray = __webpack_require__(73), + isBuffer = __webpack_require__(83), + isObject = __webpack_require__(37), + keys = __webpack_require__(77); + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); } - if (typeof value != 'string') { - return value === 0 ? value : +value; + if (result !== undefined) { + return result; } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || isFunc && !object) { + result = isFlat || isFunc ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack()); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function (subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; } - module.exports = take; + module.exports = baseClone; /***/ }, -/* 55 */ +/* 222 */ /***/ function(module, exports, __webpack_require__) { + 'use strict'; + + var copyObject = __webpack_require__(166), + keys = __webpack_require__(77); + /** - * lodash 4.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + module.exports = baseAssign; + +/***/ }, +/* 223 */ +/***/ function(module, exports, __webpack_require__) { + 'use strict'; - var baseSlice = __webpack_require__(52); + var copyObject = __webpack_require__(166), + keysIn = __webpack_require__(198); - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + module.exports = baseAssignIn; - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; +/***/ }, +/* 224 */ +/***/ function(module, exports, __webpack_require__) { - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + /* WEBPACK VAR INJECTION */(function(module) {'use strict'; - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; + var root = __webpack_require__(33); - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ - var objectToString = objectProto.toString; + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + module.exports = cloneBuffer; + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)(module))) + +/***/ }, +/* 225 */ +/***/ function(module, exports) { /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] + * Copies the values of `source` to `array`. * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; + "use strict"; + + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; } - n = guard || n === undefined ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); + return array; } + module.exports = copyArray; + +/***/ }, +/* 226 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var copyObject = __webpack_require__(166), + getSymbols = __webpack_require__(74); + /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example + * Copies own symbols of `source` to `object`. * - * _.initial([1, 2, 3]); - * // => [1, 2] + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ - function initial(array) { - return dropRight(array, 1); + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); } + module.exports = copySymbols; + +/***/ }, +/* 227 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var copyObject = __webpack_require__(166), + getSymbolsIn = __webpack_require__(228); + /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example + * Copies own and inherited symbols of `source` to `object`. * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); } + module.exports = copySymbolsIn; + +/***/ }, +/* 228 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var arrayPush = __webpack_require__(72), + getPrototype = __webpack_require__(192), + getSymbols = __webpack_require__(74), + stubArray = __webpack_require__(76); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true + * Creates an array of the own and inherited enumerable symbols of `object`. * - * _.isObject(_.noop); - * // => true + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + module.exports = getSymbolsIn; + +/***/ }, +/* 229 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseGetAllKeys = __webpack_require__(71), + getSymbolsIn = __webpack_require__(228), + keysIn = __webpack_require__(198); + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. * - * _.isObject(null); - * // => false + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); } + module.exports = getAllKeysIn; + +/***/ }, +/* 230 */ +/***/ function(module, exports) { + + /** Used for built-in method references. */ + 'use strict'; + + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * Initializes an array clone. * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; } - var remainder = value % 1; - return value === value ? remainder ? value - remainder : value : 0; + return result; } - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 + module.exports = initCloneArray; + +/***/ }, +/* 231 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var cloneArrayBuffer = __webpack_require__(232), + cloneDataView = __webpack_require__(233), + cloneMap = __webpack_require__(234), + cloneRegExp = __webpack_require__(237), + cloneSet = __webpack_require__(238), + cloneSymbol = __webpack_require__(240), + cloneTypedArray = __webpack_require__(241); + + /** `Object#toString` result references. */ + var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** + * Initializes an object clone based on its `toStringTag`. * - * _.toNumber(Infinity); - * // => Infinity + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * - * _.toNumber('3'); - * // => 3 + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; - } + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); - module.exports = initial; + case boolTag: + case dateTag: + return new Ctor(+object); -/***/ }, -/* 56 */ -/***/ function(module, exports) { + case dataViewTag: + return cloneDataView(object, isDeep); - /** - * lodash 4.1.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ + case float32Tag:case float64Tag: + case int8Tag:case int16Tag:case int32Tag: + case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag: + return cloneTypedArray(object, isDeep); - /** Used as references for various `Number` constants. */ - 'use strict'; + case mapTag: + return cloneMap(object, isDeep, cloneFunc); - var MAX_SAFE_INTEGER = 9007199254740991; + case numberTag: + case stringTag: + return new Ctor(object); - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - stringTag = '[object String]'; + case regexpTag: + return cloneRegExp(object); - /** Used for built-in method references. */ - var objectProto = Object.prototype; + case setTag: + return cloneSet(object, isDeep, cloneFunc); - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + case symbolTag: + return cloneSymbol(object); + } + } - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; + module.exports = initCloneByTag; - /** Built-in value references. */ - var propertyIsEnumerable = objectProto.propertyIsEnumerable; +/***/ }, +/* 232 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Uint8Array = __webpack_require__(66); /** - * The base implementation of `_.property` without support for deep paths. + * Creates a clone of `arrayBuffer`. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. */ - function baseProperty(key) { - return function (object) { - return object == null ? undefined : object[key]; - }; + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; } + module.exports = cloneArrayBuffer; + +/***/ }, +/* 233 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var cloneArrayBuffer = __webpack_require__(232); + /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. + * Creates a clone of `dataView`. * * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. */ - var getLength = baseProperty('length'); + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + module.exports = cloneDataView; + +/***/ }, +/* 234 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var addMapEntry = __webpack_require__(235), + arrayReduce = __webpack_require__(236), + mapToArray = __webpack_require__(67); + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1; /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true + * Creates a clone of `map`. * - * _.isArguments([1, 2, 3]); - * // => false + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor()); } - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; + module.exports = cloneMap; + +/***/ }, +/* 235 */ +/***/ function(module, exports) { /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true + * Adds the key-value `pair` to `map`. * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + "use strict"; + + function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; } + module.exports = addMapEntry; + +/***/ }, +/* 236 */ +/***/ function(module, exports) { + /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. * - * _.isArrayLikeObject(_.noop); - * // => false + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + "use strict"; + + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; } + module.exports = arrayReduce; + +/***/ }, +/* 237 */ +/***/ function(module, exports) { + + /** Used to match `RegExp` flags from their coerced string values. */ + "use strict"; + + var reFlags = /\w*$/; + /** - * Checks if `value` is an empty collection or object. A value is considered - * empty if it's an `arguments` object, array, string, or jQuery-like collection - * with a length of `0` or has no own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false + * Creates a clone of `regexp`. * - * _.isEmpty({ 'a': 1 }); - * // => false + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. */ - function isEmpty(value) { - if (isArrayLike(value) && (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { - return !value.length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; } + module.exports = cloneRegExp; + +/***/ }, +/* 238 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var addSetEntry = __webpack_require__(239), + arrayReduce = __webpack_require__(236), + setToArray = __webpack_require__(68); + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1; + /** - * Checks if `value` is classified as a `Function` object. + * Creates a clone of `set`. * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor()); } + module.exports = cloneSet; + +/***/ }, +/* 239 */ +/***/ function(module, exports) { + /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false + * Adds `value` to `set`. * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + "use strict"; + + function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; } + module.exports = addSetEntry; + +/***/ }, +/* 240 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Symbol = __webpack_require__(32); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true + * Creates a clone of the `symbol` object. * - * _.isObject(null); - * // => false + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } + module.exports = cloneSymbol; + +/***/ }, +/* 241 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var cloneArrayBuffer = __webpack_require__(232); + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false + * Creates a clone of `typedArray`. * - * _.isObjectLike(null); - * // => false + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } + module.exports = cloneTypedArray; + +/***/ }, +/* 242 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseCreate = __webpack_require__(243), + getPrototype = __webpack_require__(192), + isPrototype = __webpack_require__(93); + /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example + * Initializes an object clone. * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. */ - function isString(value) { - return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + function initCloneObject(object) { + return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } - module.exports = isEmpty; + module.exports = initCloneObject; /***/ }, -/* 57 */ -/***/ function(module, exports) { +/* 243 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isObject = __webpack_require__(37); + + /** Built-in value references. */ + var objectCreate = Object.create; /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. */ + var baseCreate = (function () { + function object() {} + return function (proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object(); + object.prototype = undefined; + return result; + }; + })(); + + module.exports = baseCreate; + +/***/ }, +/* 244 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var castPath = __webpack_require__(108), + last = __webpack_require__(245), + parent = __webpack_require__(246), + toKey = __webpack_require__(116); /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true + * The base implementation of `_.unset`. * - * _.isNull(void 0); - * // => false + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ - "use strict"; - - function isNull(value) { - return value === null; + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; } - module.exports = isNull; + module.exports = baseUnset; /***/ }, -/* 58 */ +/* 245 */ /***/ function(module, exports) { /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - - /** - * Checks if `value` is `undefined`. + * Gets the last element of `array`. * * @static * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. * @example * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false + * _.last([1, 2, 3]); + * // => 3 */ "use strict"; - function isUndefined(value) { - return value === undefined; + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; } - module.exports = isUndefined; + module.exports = last; /***/ }, -/* 59 */ +/* 246 */ /***/ function(module, exports, __webpack_require__) { - /** - * lodash 4.1.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ 'use strict'; - var baseDifference = __webpack_require__(22), - baseFlatten = __webpack_require__(19), - keysIn = __webpack_require__(46), - rest = __webpack_require__(20); + var baseGet = __webpack_require__(107), + baseSlice = __webpack_require__(210); /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * Gets the parent value at `path` of `object`. * * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; + module.exports = parent; - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } +/***/ }, +/* 247 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var isPlainObject = __webpack_require__(191); /** - * The base implementation of `_.pick` without support for individual - * property names. + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. * * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ - function basePick(object, props) { - object = Object(object); - return arrayReduce(props, function (result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; } + module.exports = customOmitClone; + +/***/ }, +/* 248 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var baseOrderBy = __webpack_require__(142), + isArray = __webpack_require__(73); + /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays. - * @returns {Object} Returns the new object. + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - var omit = rest(function (object, props) { - if (object == null) { - return {}; + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; } - props = arrayMap(baseFlatten(props, 1), String); - return basePick(object, baseDifference(keysIn(object), props)); - }); + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } - module.exports = omit; + module.exports = orderBy; /***/ } /******/ ]) diff --git a/styling.html b/styling.html index e77c8db..83e6f0f 100644 --- a/styling.html +++ b/styling.html @@ -29,8 +29,8 @@ - - + + diff --git a/subgrids.html b/subgrids.html index 3ff33c4..950b2fd 100644 --- a/subgrids.html +++ b/subgrids.html @@ -29,8 +29,8 @@ - - + +