diff --git a/dist/omniscient.js b/dist/omniscient.js index bfa777e..4bb82f7 100644 --- a/dist/omniscient.js +++ b/dist/omniscient.js @@ -1,428 +1,2097 @@ /** -* Omniscient.js v2.1.0 +* Omniscient.js v3.0.0 * Authors: @torgeir,@mikaelbr ***************************************/ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.omniscient=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o: ' + str); - }; -} +(function (global){ +"use strict"; + +var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null), + extend = _dereq_('extend-object'); + +var shouldComponentUpdate = _dereq_('./shouldupdate'); +var hiddenCursorField = "__singleCursor"; + +module.exports = factory(); +module.exports.withDefaults = factory; +function factory (options) { + var debug; + options = options || {}; + var _shouldComponentUpdate = options.shouldComponentUpdate; + var _isCursor = options.isCursor || shouldComponentUpdate.isCursor; + var _isImmutable = options.isImmutable || shouldComponentUpdate.isImmutable; + var _isJsx = !!options.jsx; + + if (!_shouldComponentUpdate) { + _shouldComponentUpdate = shouldComponentUpdate.withDefaults(options); + } -function component (displayName, mixins, render) { - var options = createDefaultArguments(displayName, mixins, render); - var methodStatics = pickStaticMixins(options.mixins); + ComponentCreator.debug = debugFn; + ComponentCreator.shouldComponentUpdate = _shouldComponentUpdate; + return ComponentCreator; + + function ComponentCreator (displayName, mixins, render) { + var options = createDefaultArguments(displayName, mixins, render); + var methodStatics = pickStaticMixins(options.mixins); + + var componentObject = { + displayName: options.displayName || options.render.name, + mixins: options.mixins, + render: function render () { + if (debug) debug.call(this, 'render'); + // If `props[cursor]` is defined than it's just boxed cursor + // in which case we unbox it. + var input = this.props[hiddenCursorField] || this.props; + return options.render.call(this, input, this.props.statics); + } + }; - var componentObject = { - displayName: options.displayName, - mixins: options.mixins, - render: function render () { - if (debug) debug.call(this, 'render'); - return options.render.call(this, this.props, this.props.statics); + if (methodStatics) { + componentObject.statics = methodStatics; + removeOldStaticMethods(options.mixins); + } + + var Component = React.createClass(componentObject); + if (_isJsx) { + return Component; } - }; - if (methodStatics) { - componentObject.statics = methodStatics; - removeOldStaticMethods(options.mixins); + var create = function (key, props, statics) { + var inputCursor; + var children = toArray(arguments).filter(React.isValidElement); + + if (typeof key === 'object') { + statics = props; + props = key; + key = void 0; + } + + if (!props) { + props = { }; + } + + // If passed props is just a cursor we box it by making + // props with `props[hiddenCursorField]` set to given `props` so that + // render will know how to unbox it. Note that __singleCursor proprety + // name is used to make sure that render won't unbox props in case user + // passed on with conflicting proprety name. + if (_isCursor(props) || _isImmutable(props)) { + inputCursor = props; + props = {}; + props[hiddenCursorField] = inputCursor; + } + + if (!!statics && !props.statics) { + props.statics = statics; + } + + if (key) { + props.key = key; + } + + if (!!children.length) { + props.children = children; + } + + return React.createElement(Component, props); + }; + + create.jsx = Component; + + if (methodStatics) { + create = extend(create, methodStatics); + } + + return create; } - var Component = React.createClass(componentObject); + function debugFn (pattern, logFn) { + debug = shouldComponentUpdate.withDefaults().debug(pattern, logFn); + } - var create = function (key, props) { - var children = toArray(arguments).filter(React.isValidElement); + function createDefaultArguments (displayName, mixins, render) { - if (typeof key === 'object') { - props = key; - key = void 0; + // (render) + if (typeof displayName === 'function') { + render = displayName; + mixins = []; + displayName = void 0; } - if (!props) { - props = { }; + // (mixins, render) + if (typeof displayName === 'object' && typeof mixins === 'function') { + render = mixins; + mixins = displayName; + displayName = void 0; } - if (isCursor(props)) { - props = { cursor: props }; + // (displayName, render) + if (typeof displayName === 'string' && typeof mixins === 'function') { + render = mixins; + mixins = []; } - if (key) { - props.key = key; + // Else (displayName, mixins, render) + + if (!Array.isArray(mixins)) { + mixins = [mixins]; } - if (!!children.length) { - props.children = children; + if (!hasShouldComponentUpdate(mixins)) { + mixins = [{ + shouldComponentUpdate: _shouldComponentUpdate + }].concat(mixins); } - return React.createElement(Component, props); - }; + return { + displayName: displayName, + mixins: mixins, + render: render + }; + } +} - create.jsx = Component; +function pickStaticMixins (mixins) { + var filtered = mixins.filter(function (obj) { + return !!obj.statics; + }); - if (methodStatics) { - create = extend(create, methodStatics); + if (!filtered.length) { + return void 0; } - return create; -}; + var statics = {}; + filtered.forEach(function (obj) { + statics = extend(statics, obj.statics); + }); -function shouldComponentUpdate (nextProps, nextState) { - var isEqualState = module.exports.isEqualState; + return statics; +} - var isNotIgnorable = not(or(isStatics, isChildren)); +function removeOldStaticMethods (mixins) { + mixins.filter(function (obj) { + return !!obj.statics; + }).forEach(function (obj) { + delete obj.statics; + }); +} - var nextCursors = filterKeyValue(guaranteeObject(nextProps), isNotIgnorable), - currentCursors = filterKeyValue(guaranteeObject(this.props), isNotIgnorable); +function hasShouldComponentUpdate (mixins) { + return mixins.some(function (mixin) { + return !!mixin.shouldComponentUpdate; + }); +} + +function toArray (args) { + return Array.prototype.slice.call(args); +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./shouldupdate":22,"extend-object":2}],2:[function(_dereq_,module,exports){ +var arr = []; +var each = arr.forEach; +var slice = arr.slice; + + +module.exports = function(obj) { + each.call(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + } + }); + return obj; +}; + +},{}],3:[function(_dereq_,module,exports){ +/** + * 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 + */ +var baseIsEqual = _dereq_('lodash._baseisequal'), + bindCallback = _dereq_('lodash._bindcallback'); - var nextCursorsKeys = Object.keys(nextCursors), - currentCursorsKeys = Object.keys(currentCursors); +/** + * 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 && (value === 0 ? ((1 / value) > 0) : !isObject(value)); +} - if (currentCursorsKeys.length !== nextCursorsKeys.length) { - if (debug) debug.call(this, 'shouldComponentUpdate => true (number of cursors differ)'); - return true; +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. If `customizer` is provided it is invoked to compare values. + * If `customizer` returns `undefined` comparisons are handled by the method + * instead. The `customizer` is bound to `thisArg` and invoked with three + * arguments; (value, other [, index|key]). + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. Provide a customizer function to extend support + * for comparing other values. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * object == other; + * // => false + * + * _.isEqual(object, other); + * // => true + * + * // using a customizer callback + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqual(array, other, function(value, other) { + * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; + * }); + * // => true + */ +function isEqual(value, other, customizer, thisArg) { + customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3); + if (!customizer && isStrictComparable(value) && isStrictComparable(other)) { + return value === other; } + var result = customizer ? customizer(value, other) : undefined; + return typeof result == 'undefined' ? baseIsEqual(value, other, customizer) : !!result; +} + +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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 + */ +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 type == 'function' || (value && type == 'object') || false; +} - if (hasDifferentKeys(currentCursorsKeys, currentCursors, nextCursors)) { - if (debug) debug.call(this, 'shouldComponentUpdate => true (cursors have different keys)'); - return true; +module.exports = isEqual; + +},{"lodash._baseisequal":4,"lodash._bindcallback":10}],4:[function(_dereq_,module,exports){ +/** + * 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 + */ +var isArray = _dereq_('lodash.isarray'), + isTypedArray = _dereq_('lodash.istypedarray'), + keys = _dereq_('lodash.keys'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ +var objToString = objectProto.toString; + +/** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isWhere] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, isWhere, stackA, stackB) { + // Exit early for identical values. + if (value === other) { + // Treat `+0` vs. `-0` as not equal. + return value !== 0 || (1 / value == 1 / other); } + var valType = typeof value, + othType = typeof other; + + // Exit early for unlike primitive values. + if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') || + value == null || other == null) { + // Return `false` unless both values are `NaN`. + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isWhere, stackA, stackB); +} - if (hasChangedCursors(currentCursors, nextCursors)) { - if (debug) debug.call(this, 'shouldComponentUpdate => true (cursors have changed)'); - return true; +/** + * 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 {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isWhere] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, isWhere, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; - if (!isEqualState(this.state, nextState)) { - if (debug) debug.call(this, 'shouldComponentUpdate => true (state has changed)'); - return true; + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); } + var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - if (hasChangedProperties(currentCursors, nextCursors)) { - if (debug) debug.call(this, 'shouldComponentUpdate => true (properties have changed)'); - return true; + if (valWrapped || othWrapped) { + return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isWhere, stackA, stackB); } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isWhere, stackA, stackB); + + stackA.pop(); + stackB.pop(); - if (debug) debug.call(this, 'shouldComponentUpdate => false'); + return result; +} +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @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 comparing arrays. + * @param {boolean} [isWhere] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, isWhere, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length, + result = true; + + if (arrLength != othLength && !(isWhere && othLength > arrLength)) { + return false; + } + // Deep compare the contents, ignoring non-numeric properties. + while (result && ++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + result = undefined; + if (customizer) { + result = isWhere + ? customizer(othValue, arrValue, index) + : customizer(arrValue, othValue, index); + } + if (typeof result == 'undefined') { + // Recursively compare arrays (susceptible to call stack limits). + if (isWhere) { + var othIndex = othLength; + while (othIndex--) { + othValue = other[othIndex]; + result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); + if (result) { + break; + } + } + } else { + result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isWhere, stackA, stackB); + } + } + } + return !!result; +} + +/** + * 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} value The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag) { + switch (tag) { + 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; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + // But, treat `-0` vs. `+0` as not equal. + : (object == 0 ? ((1 / object) == (1 / other)) : object == +other); + + 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 + ''); + } return false; } -function guaranteeObject (prop) { - if (!prop) { - return {}; +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @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 comparing values. + * @param {boolean} [isWhere] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, isWhere, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isWhere) { + return false; + } + var hasCtor, + index = -1; + + while (++index < objLength) { + var key = objProps[index], + result = hasOwnProperty.call(other, key); + + if (result) { + var objValue = object[key], + othValue = other[key]; + + result = undefined; + if (customizer) { + result = isWhere + ? customizer(othValue, objValue, key) + : customizer(objValue, othValue, key); + } + if (typeof result == 'undefined') { + // Recursively compare objects (susceptible to call stack limits). + result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isWhere, stackA, stackB); + } + } + if (!result) { + return false; + } + hasCtor || (hasCtor = key == 'constructor'); } + if (!hasCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; - if (isCursor(prop)) { - return { _dummy_key: prop }; + // 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)) { + return false; + } } + return true; +} + +module.exports = baseIsEqual; + +},{"lodash.isarray":5,"lodash.istypedarray":6,"lodash.keys":7}],5:[function(_dereq_,module,exports){ +/** + * 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 + */ - if (typeof prop !== 'object') { - return { _dummy_key: prop }; +/** `Object#toString` result references. */ +var arrayTag = '[object Array]', + funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Used to match `RegExp` special characters. + * See this [article on `RegExp` characters](http://www.regular-expressions.info/characters.html#special) + * for more details. + */ +var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, + reHasRegExpChars = RegExp(reRegExpChars.source); + +/** + * Converts `value` to a string if it is not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + if (typeof value == 'string') { + return value; } + return value == null ? '' : (value + ''); +} - return prop; +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; } -function hasDifferentKeys (currentCursorsKeys, currentCursors, nextCursors) { - return !currentCursorsKeys.every(function existsInBoth (key) { - return typeof currentCursors[key] !== 'undefined' && typeof nextCursors[key] !== 'undefined'; - }); +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reNative = RegExp('^' + + escapeRegExp(objToString) + .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray; + +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * Checks if `value` is a valid array-like length. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @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 + * + * (function() { return _.isArray(arguments); })(); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return (isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag) || false; +}; + +/** + * 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 (objToString.call(value) == funcTag) { + return reNative.test(fnToString.call(value)); + } + return (isObjectLike(value) && reHostCtor.test(value)) || false; } -function hasChangedCursors (current, next) { - current = filterKeyValue(current, isCursor); - next = filterKeyValue(next, isCursor); +/** + * Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*", + * "+", "(", ")", "[", "]", "{" and "}" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = baseToString(string); + return (string && reHasRegExpChars.test(string)) + ? string.replace(reRegExpChars, '\\$&') + : string; +} - var isEqualCursor = module.exports.isEqualCursor; +module.exports = isArray; - for (var key in current) - if (!isEqualCursor(current[key], next[key])) - return true; - return false; +},{}],6:[function(_dereq_,module,exports){ +/** + * 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 + */ + +/** `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]', + 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[dateTag] = typedArrayTags[errorTag] = +typedArrayTags[funcTag] = typedArrayTags[mapTag] = +typedArrayTags[numberTag] = typedArrayTags[objectTag] = +typedArrayTags[regexpTag] = typedArrayTags[setTag] = +typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; } -function hasChangedProperties (current, next) { - current = filterKeyValue(current, not(isCursor)); - next = filterKeyValue(next, not(isCursor)); +/** Used for native method references. */ +var objectProto = Object.prototype; - for (var key in current) - if (!deepEqual(current[key], next[key])) - return true; - return false; +/** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ +var objToString = objectProto.toString; + +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * Checks if `value` is a valid array-like length. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * 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 + * + * _.isTypedArray([]); + * // => false + */ +function isTypedArray(value) { + return (isObjectLike(value) && isLength(value.length) && typedArrayTags[objToString.call(value)]) || false; } -function createDefaultArguments (displayName, mixins, render) { +module.exports = isTypedArray; - // (render) - if (typeof displayName === 'function') { - render = displayName; - mixins = []; - displayName = void 0; - } +},{}],7:[function(_dereq_,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.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var isArguments = _dereq_('lodash.isarguments'), + isArray = _dereq_('lodash.isarray'), + isNative = _dereq_('lodash.isnative'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - // (mixins, render) - if (typeof displayName === 'object' && typeof mixins === 'function') { - render = mixins; - mixins = displayName; - displayName = void 0; +/** Native method references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys; + +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * An object environment feature flags. + * + * @static + * @memberOf _ + * @type Object + */ +var support = {}; + +(function(x) { + + /** + * Detect if `arguments` object indexes are non-enumerable. + * + * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object + * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat + * `arguments` object indexes as non-enumerable and fail `hasOwnProperty` + * checks for indexes that exceed their function's formal parameters with + * associated values of `0`. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); + } catch(e) { + support.nonEnumArgs = true; } +}(0, 0)); - // (displayName, render) - if (typeof displayName === 'string' && typeof mixins === 'function') { - render = mixins; - mixins = []; +/** + * 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 = +value; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on ES `ToLength`. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to inspect. + * @returns {Array} Returns the array of property names. + */ +function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = length && isLength(length) && + (isArray(object) || (support.nonEnumArgs && isArguments(object))); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } } + return result; +} - // Else (displayName, mixins, render) +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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 + */ +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 type == 'function' || (value && type == 'object') || false; +} - if (!Array.isArray(mixins)) { - mixins = [mixins]; +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @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'] + */ +var keys = !nativeKeys ? shimKeys : function(object) { + if (object) { + var Ctor = object.constructor, + length = object.length; + } + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && (length && isLength(length)))) { + return shimKeys(object); } + return isObject(object) ? nativeKeys(object) : []; +}; - if (!hasShouldComponentUpdate(mixins)) { - var ShouldComponentUpdate = { - shouldComponentUpdate: module.exports.shouldComponentUpdate - }; - mixins = [ShouldComponentUpdate].concat(mixins); +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype == object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } + return result; +} - return { - displayName: displayName, - mixins: mixins, - render: render - }; +module.exports = keys; + +},{"lodash.isarguments":8,"lodash.isarray":5,"lodash.isnative":9}],8:[function(_dereq_,module,exports){ +/** + * 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 + */ + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; } -function pickStaticMixins (mixins) { - var filtered = mixins.filter(function (obj) { - return !!obj.statics; - }); +/** Used for native method references. */ +var objectProto = Object.prototype; - if (!filtered.length) { - return void 0; +/** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ +var objToString = objectProto.toString; + +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * Checks if `value` is a valid array-like length. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as 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 + * + * (function() { return _.isArguments(arguments); })(); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + var length = isObjectLike(value) ? value.length : undefined; + return (isLength(length) && objToString.call(value) == argsTag) || false; +} + +module.exports = isArguments; + +},{}],9:[function(_dereq_,module,exports){ +/** + * 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 + */ + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Used to match `RegExp` special characters. + * See this [article on `RegExp` characters](http://www.regular-expressions.info/characters.html#special) + * for more details. + */ +var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, + reHasRegExpChars = RegExp(reRegExpChars.source); + +/** + * Converts `value` to a string if it is not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + if (typeof value == 'string') { + return value; } + return value == null ? '' : (value + ''); +} - var statics = {}; - filtered.forEach(function (obj) { - statics = extend(statics, obj.statics); - }); +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; +} - return statics; +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reNative = RegExp('^' + + escapeRegExp(objToString) + .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * 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 (objToString.call(value) == funcTag) { + return reNative.test(fnToString.call(value)); + } + return (isObjectLike(value) && reHostCtor.test(value)) || false; } -function removeOldStaticMethods (mixins) { - mixins.filter(function (obj) { - return !!obj.statics; - }).forEach(function (obj) { - delete obj.statics; - }); +/** + * Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*", + * "+", "(", ")", "[", "]", "{" and "}" in `string`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = baseToString(string); + return (string && reHasRegExpChars.test(string)) + ? string.replace(reRegExpChars, '\\$&') + : string; } -function extend (original, extension) { - for (key in extension) { - if (extension.hasOwnProperty(key) && !original[key]) { - original[key] = extension[key]; - } +module.exports = isNative; + +},{}],10:[function(_dereq_,module,exports){ +/** + * 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 + */ + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; } - return original; + if (typeof thisArg == 'undefined') { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; } -function hasShouldComponentUpdate (mixins) { - return !!mixins.filter(function (mixin) { - return !!mixin.shouldComponentUpdate; - }).length; +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; } -function isCursor (potential) { - return potential && - ((typeof potential.deref === 'function') || (typeof potential.__deref === 'function')); +module.exports = bindCallback; + +},{}],11:[function(_dereq_,module,exports){ +/** + * 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 + */ +var baseFlatten = _dereq_('lodash._baseflatten'), + bindCallback = _dereq_('lodash._bindcallback'), + pickByArray = _dereq_('lodash._pickbyarray'), + pickByCallback = _dereq_('lodash._pickbycallback'); + +/** + * Creates an object composed of the picked `object` properties. Property + * names may be specified as individual arguments or as arrays of property + * names. If `predicate` is provided it is invoked for each property of `object` + * picking the properties `predicate` returns truthy for. The predicate is + * bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|...(string|string[])} [predicate] The function invoked per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.pick(object, 'user'); + * // => { 'user': 'fred' } + * + * _.pick(object, _.isString); + * // => { 'user': 'fred' } + */ +function pick(object, predicate, thisArg) { + if (object == null) { + return {}; + } + return typeof predicate == 'function' + ? pickByCallback(object, bindCallback(predicate, thisArg, 3)) + : pickByArray(object, baseFlatten(arguments, false, false, 1)); } -function unCursor(cursor) { - if (!isCursor(cursor)) { - return cursor; +module.exports = pick; + +},{"lodash._baseflatten":12,"lodash._bindcallback":15,"lodash._pickbyarray":16,"lodash._pickbycallback":17}],12:[function(_dereq_,module,exports){ +/** + * 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 + */ +var isArguments = _dereq_('lodash.isarguments'), + isArray = _dereq_('lodash.isarray'); + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; +} + +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * The base implementation of `_.flatten` with added support for restricting + * flattening and specifying the start index. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param {boolean} [isStrict] Restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, isDeep, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index]; + + if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { + if (isDeep) { + // Recursively flatten arrays (susceptible to call stack limits). + value = baseFlatten(value, isDeep, isStrict); + } + var valIndex = -1, + valLength = value.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[++resIndex] = value[valIndex]; + } + } else if (!isStrict) { + result[++resIndex] = value; + } } + return result; +} + +/** + * Checks if `value` is a valid array-like length. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = baseFlatten; + +},{"lodash.isarguments":13,"lodash.isarray":14}],13:[function(_dereq_,module,exports){ +arguments[4][8][0].apply(exports,arguments) +},{"dup":8}],14:[function(_dereq_,module,exports){ +arguments[4][5][0].apply(exports,arguments) +},{"dup":5}],15:[function(_dereq_,module,exports){ +arguments[4][10][0].apply(exports,arguments) +},{"dup":10}],16:[function(_dereq_,module,exports){ +/** + * 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 + */ - if (typeof cursor.deref === 'function') { - return cursor.deref(); +/** + * A specialized version of `_.pick` that picks `object` properties specified + * by the `props` array. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property names to pick. + * @returns {Object} Returns the new object. + */ +function pickByArray(object, props) { + object = toObject(object); + + var index = -1, + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } } + return result; +} - return cursor.__deref(); +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); } -function filterKeyValue (object, predicate) { - var key, filtered = {}; - for (key in object) - if (predicate(object[key], key)) - filtered[key] = object[key]; - return filtered; +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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 + */ +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 type == 'function' || (value && type == 'object') || false; } -function not (fn) { - return function () { - return !fn.apply(fn, arguments); - }; +module.exports = pickByArray; + +},{}],17:[function(_dereq_,module,exports){ +/** + * 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 + */ +var baseFor = _dereq_('lodash._basefor'), + keysIn = _dereq_('lodash.keysin'); + +/** + * The base implementation of `_.forIn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForIn(object, iteratee) { + return baseFor(object, iteratee, keysIn); } -function isStatics (val, key) { - return key === 'statics'; +/** + * A specialized version of `_.pick` that picks `object` properties `predicate` + * returns truthy for. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per iteration. + * @returns {Object} Returns the new object. + */ +function pickByCallback(object, predicate) { + var result = {}; + baseForIn(object, function(value, key, object) { + if (predicate(value, key, object)) { + result[key] = value; + } + }); + return result; } -function isChildren (val, key) { - return key === 'children'; +module.exports = pickByCallback; + +},{"lodash._basefor":18,"lodash.keysin":19}],18:[function(_dereq_,module,exports){ +/** + * 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 `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iterator functions may exit iteration early by explicitly + * returning `false`. + * + * @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 baseFor(object, iteratee, keysFunc) { + var index = -1, + iterable = toObject(object), + props = keysFunc(object), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; } -function or (fn1, fn2) { - return function () { - return fn1.apply(null, arguments) || fn2.apply(null, arguments); - }; +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); } -function toArray (args) { - return Array.prototype.slice.call(args); +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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 + */ +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 type == 'function' || (value && type == 'object') || false; } -},{"deep-equal":2,"react":undefined}],2:[function(_dereq_,module,exports){ -var pSlice = Array.prototype.slice; -var objectKeys = _dereq_('./lib/keys.js'); -var isArguments = _dereq_('./lib/is_arguments.js'); +module.exports = baseFor; + +},{}],19:[function(_dereq_,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.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var isArguments = _dereq_('lodash.isarguments'), + isArray = _dereq_('lodash.isarray'); -var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; +/** Used for native method references. */ +var objectProto = Object.prototype; - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; +/** Native method references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); +/** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * for more details. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * An object environment feature flags. + * + * @static + * @memberOf _ + * @type Object + */ +var support = {}; + +(function(x) { + + /** + * Detect if `arguments` object indexes are non-enumerable. + * + * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object + * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat + * `arguments` object indexes as non-enumerable and fail `hasOwnProperty` + * checks for indexes that exceed their function's formal parameters with + * associated values of `0`. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); + } catch(e) { + support.nonEnumArgs = true; } +}(0, 0)); + +/** + * 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 = +value; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; } -function isUndefinedOrNull(value) { - return value === null || value === undefined; +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on ES `ToLength`. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } -function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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 + */ +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 type == 'function' || (value && type == 'object') || false; } -function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype == object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; + return result; +} + +module.exports = keysIn; + +},{"lodash.isarguments":20,"lodash.isarray":21}],20:[function(_dereq_,module,exports){ +arguments[4][8][0].apply(exports,arguments) +},{"dup":8}],21:[function(_dereq_,module,exports){ +arguments[4][5][0].apply(exports,arguments) +},{"dup":5}],22:[function(_dereq_,module,exports){ +"use strict"; + +var filter = _dereq_('lodash.pick'), + isEqual = _dereq_('lodash.isequal'); + +module.exports = factory(); +module.exports.withDefaults = factory; + +function factory (methods) { + var debug; + methods = methods || {}; + + var _isCursor = methods.isCursor || isCursor, + _isEqualCursor = methods.isEqualCursor || isEqualCursor, + _isEqualState = methods.isEqualState || isEqualState, + _isEqualProps = methods.isEqualProps || isEqualProps, + _isImmutable = methods.isImmutable || isImmutable, + _unCursor = methods.unCursor || unCursor; + + shouldComponentUpdate.isCursor = _isCursor; + shouldComponentUpdate.isEqualState = _isEqualState; + shouldComponentUpdate.isEqualProps = _isEqualProps; + shouldComponentUpdate.isEqualCursor = _isEqualCursor; + shouldComponentUpdate.isImmutable = _isImmutable; + shouldComponentUpdate.debug = debugFn; + + return shouldComponentUpdate; + + function shouldComponentUpdate (nextProps, nextState) { + var isNotIgnorable = not(or(isStatics, isChildren)); + + var nextCursors = filter(nextProps, isNotIgnorable), + currentCursors = filter(this.props, isNotIgnorable); + + var nextCursorsKeys = Object.keys(nextCursors), + currentCursorsKeys = Object.keys(currentCursors); + + if (currentCursorsKeys.length !== nextCursorsKeys.length) { + if (debug) debug.call(this, 'shouldComponentUpdate => true (number of cursors differ)'); + return true; } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; + + if (hasDifferentKeys(currentCursorsKeys, currentCursors, nextCursors)) { + if (debug) debug.call(this, 'shouldComponentUpdate => true (cursors have different keys)'); + return true; } - return true; + + if (hasChangedCursors(currentCursors, nextCursors)) { + if (debug) debug.call(this, 'shouldComponentUpdate => true (cursors have changed)'); + return true; + } + + if (!_isEqualState(this.state, nextState)) { + if (debug) debug.call(this, 'shouldComponentUpdate => true (state has changed)'); + return true; + } + + if (hasChangedProperties(currentCursors, nextCursors)) { + if (debug) debug.call(this, 'shouldComponentUpdate => true (properties have changed)'); + return true; + } + + if (debug) debug.call(this, 'shouldComponentUpdate => false'); + + return false; } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't + + function hasChangedCursors (current, next) { + current = filter(current, _isCursor); + next = filter(next, _isCursor); + + for (var key in current) { + if (!_isEqualCursor(current[key], next[key])) { + return true; + } + } return false; } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) + + function hasChangedProperties (current, next) { + current = filter(current, not(_isCursor)); + next = filter(next, not(_isCursor)); + + for (var key in current) { + if (!_isEqualProps(current[key], next[key])) { + return true; + } + } return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; + + function isEqualState (value, other) { + return isEqual(value, other, function (current, next) { + if (_isImmutable(current) && _isImmutable(next)) { + return current === next; + } + if (_isImmutable(current) || _isImmutable(next)) { + return false; + } + return void 0; + }); + } + + function isEqualProps (value, other) { + return isEqual(value, other, function (current, next) { + if (_isCursor(current) && _isCursor(next)) { + return isEqualCursor(current, next); + } + if (_isCursor(current) || _isCursor(next)) { + return false; + } + if (_isImmutable(current) && _isImmutable(next)) { + return current === next; + } + if (_isImmutable(current) || _isImmutable(next)) { + return false; + } + return void 0; + }); + } + + function isEqualCursor (a, b) { + return _unCursor(a) === _unCursor(b); + } + + function debugFn (pattern, logFn) { + if (typeof pattern === 'function') { + logFn = pattern; + pattern = void 0; + } + + var logger = logFn; + if (!logger && console.debug) { + logger = console.debug.bind(console); + } + if (!logger && console.info) { + logger = console.info.bind(console); + } + + var regex = new RegExp(pattern || '.*'); + debug = function (str) { + var element = this._currentElement; + if (this._reactInternalInstance && this._reactInternalInstance._currentElement) { + element = this._reactInternalInstance._currentElement; + } + var key = element && element.key ? ' key=' + element.key : ''; + var name = this.constructor.displayName; + if (!key && !name) { + name = 'Unknown'; + } + var tag = name + key; + if (regex.test(tag)) logger('<' + tag + '>: ' + str); + }; + return debug; } - return true; } -},{"./lib/is_arguments.js":3,"./lib/keys.js":4}],3:[function(_dereq_,module,exports){ -var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) -})() == '[object Arguments]'; -exports = module.exports = supportsArgumentsClass ? supported : unsupported; +var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; +function isImmutable(maybeIterable) { + return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); +} -exports.supported = supported; -function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -}; +function unCursor(cursor) { + return cursor.deref(); +} -exports.unsupported = unsupported; -function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; -}; +function isCursor (potential) { + return potential && typeof potential.deref === 'function'; +} -},{}],4:[function(_dereq_,module,exports){ -exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; +function hasDifferentKeys (currentCursorsKeys, currentCursors, nextCursors) { + return !currentCursorsKeys.every(function existsInBoth (key) { + return typeof currentCursors[key] !== 'undefined' && typeof nextCursors[key] !== 'undefined'; + }); +} -exports.shim = shim; -function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; +function not (fn) { + return function () { + return !fn.apply(fn, arguments); + }; +} + +function isStatics (_, key) { + return key === 'statics'; +} + +function isChildren (_, key) { + return key === 'children'; +} + +function or (fn1, fn2) { + return function () { + return fn1.apply(null, arguments) || fn2.apply(null, arguments); + }; } -},{}]},{},[1])(1) +},{"lodash.isequal":3,"lodash.pick":11}]},{},[1])(1) }); \ No newline at end of file diff --git a/dist/omniscient.min.js b/dist/omniscient.min.js index 8c663fe..431f17c 100644 --- a/dist/omniscient.min.js +++ b/dist/omniscient.min.js @@ -1,5 +1,5 @@ /** -* Omniscient.js v2.1.0 +* Omniscient.js v3.0.0 * Authors: @torgeir,@mikaelbr ***************************************/ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.omniscient=e()}}(function(){return function e(t,n,r){function o(i,f){if(!n[i]){if(!t[i]){var s="function"==typeof require&&require;if(!f&&s)return s(i,!0);if(u)return u(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var a=n[i]={exports:{}};t[i][0].call(a.exports,function(e){var n=t[i][1][e];return o(n?n:e)},a,a.exports,e,t,n,r)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i true (number of cursors differ)"),!0):u(p,a,c)?(C&&C.call(this,"shouldComponentUpdate => true (cursors have different keys)"),!0):i(a,c)?(C&&C.call(this,"shouldComponentUpdate => true (cursors have changed)"),!0):r(this.state,n)?f(a,c)?(C&&C.call(this,"shouldComponentUpdate => true (properties have changed)"),!0):(C&&C.call(this,"shouldComponentUpdate => false"),!1):(C&&C.call(this,"shouldComponentUpdate => true (state has changed)"),!0)}function o(e){return e?d(e)?{_dummy_key:e}:"object"!=typeof e?{_dummy_key:e}:e:{}}function u(e,t,n){return!e.every(function(e){return"undefined"!=typeof t[e]&&"undefined"!=typeof n[e]})}function i(e,n){e=h(e,d),n=h(n,d);var r=t.exports.isEqualCursor;for(var o in e)if(!r(e[o],n[o]))return!0;return!1}function f(e,t){e=h(e,m(d)),t=h(t,m(d));for(var n in e)if(!k(e[n],t[n]))return!0;return!1}function s(e,n,r){if("function"==typeof e&&(r=e,n=[],e=void 0),"object"==typeof e&&"function"==typeof n&&(r=n,n=e,e=void 0),"string"==typeof e&&"function"==typeof n&&(r=n,n=[]),Array.isArray(n)||(n=[n]),!p(n)){var o={shouldComponentUpdate:t.exports.shouldComponentUpdate};n=[o].concat(n)}return{displayName:e,mixins:n,render:r}}function c(e){var t=e.filter(function(e){return!!e.statics});if(!t.length)return void 0;var n={};return t.forEach(function(e){n=l(n,e.statics)}),n}function a(e){e.filter(function(e){return!!e.statics}).forEach(function(e){delete e.statics})}function l(e,t){for(key in t)t.hasOwnProperty(key)&&!e[key]&&(e[key]=t[key]);return e}function p(e){return!!e.filter(function(e){return!!e.shouldComponentUpdate}).length}function d(e){return e&&("function"==typeof e.deref||"function"==typeof e.__deref)}function y(e){return d(e)?"function"==typeof e.deref?e.deref():e.__deref():e}function h(e,t){var n,r={};for(n in e)t(e[n],n)&&(r[n]=e[n]);return r}function m(e){return function(){return!e.apply(e,arguments)}}function g(e,t){return"statics"===t}function v(e,t){return"children"===t}function b(e,t){return function(){return e.apply(null,arguments)||t.apply(null,arguments)}}function x(e){return Array.prototype.slice.call(e)}var j=window.React,k=e("deep-equal");t.exports=n,t.exports.shouldComponentUpdate=r,t.exports.isEqualState=function(){return k.apply(this,arguments)},t.exports.isEqualCursor=function(e,t){return y(e)===y(t)},t.exports.isCursor=d;var C;t.exports.debug=function(e){var t=new RegExp(e||".*");C=function(e){var n=this._currentElement&&this._currentElement.key?" key="+this._currentElement.key:"",r=this.constructor.displayName,o=r+n;(n||r)&&t.test(o)&&console.debug("<"+o+">: "+e)}}},{"deep-equal":2,react:void 0}],2:[function(e,t){function n(e){return null===e||void 0===e}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,o){var c,a;if(n(e)||n(t))return!1;if(e.prototype!==t.prototype)return!1;if(f(e))return f(t)?(e=u.call(e),t=u.call(t),s(e,t,o)):!1;if(r(e)){if(!r(t))return!1;if(e.length!==t.length)return!1;for(c=0;c=0;c--)if(l[c]!=p[c])return!1;for(c=l.length-1;c>=0;c--)if(a=l[c],!s(e[a],t[a],o))return!1;return!0}var u=Array.prototype.slice,i=e("./lib/keys.js"),f=e("./lib/is_arguments.js"),s=t.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},{"./lib/is_arguments.js":3,"./lib/keys.js":4}],3:[function(e,t,n){function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var u="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=t.exports=u?r:o,n.supported=r,n.unsupported=o},{}],4:[function(e,t,n){function r(e){var t=[];for(var n in e)t.push(n);return t}n=t.exports="function"==typeof Object.keys?Object.keys:r,n.shim=r},{}]},{},[1])(1)}); \ No newline at end of file +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.omniscient=t()}}(function(){return function t(n,r,e){function o(a,i){if(!r[a]){if(!n[a]){var c="function"==typeof require&&require;if(!i&&c)return c(a,!0);if(u)return u(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=r[a]={exports:{}};n[a][0].call(f.exports,function(t){var r=n[a][1][t];return o(r?r:t)},f,f.exports,t,n,r,e)}return r[a].exports}for(var u="function"==typeof require&&require,a=0;a0:!o(t))}function e(t,n,e,o){if(e="function"==typeof e&&a(e,o,3),!e&&r(t)&&r(n))return t===n;var i=e?e(t,n):void 0;return"undefined"==typeof i?u(t,n,e):!!i}function o(t){var n=typeof t;return"function"==n||t&&"object"==n||!1}var u=t("lodash._baseisequal"),a=t("lodash._bindcallback");n.exports=e},{"lodash._baseisequal":4,"lodash._bindcallback":10}],4:[function(t,n){function r(t,n,o,u,a,i){if(t===n)return 0!==t||1/t==1/n;var c=typeof t,s=typeof n;return"function"!=c&&"object"!=c&&"function"!=s&&"object"!=s||null==t||null==n?t!==t&&n!==n:e(t,n,r,o,u,a,i)}function e(t,n,r,e,s,p,d){var y=i(t),h=i(n),v=l,g=l;y||(v=x.call(t),v==f?v=b:v!=b&&(y=c(t))),h||(g=x.call(n),g==f?g=b:g!=b&&(h=c(n)));var m=v==b,E=g==b,_=v==g;if(_&&!y&&!m)return u(t,n,v);var w=m&&j.call(t,"__wrapped__"),A=E&&j.call(n,"__wrapped__");if(w||A)return r(w?t.value():t,A?n.value():n,e,s,p,d);if(!_)return!1;p||(p=[]),d||(d=[]);for(var k=p.length;k--;)if(p[k]==t)return d[k]==n;p.push(t),d.push(n);var C=(y?o:a)(t,n,r,e,s,p,d);return p.pop(),d.pop(),C}function o(t,n,r,e,o,u,a){var i=-1,c=t.length,s=n.length,f=!0;if(c!=s&&!(o&&s>c))return!1;for(;f&&++i-1&&t%1==0&&v>=t}function u(t){return null==t?!1:y.call(t)==c?h.test(d.call(t)):e(t)&&s.test(t)||!1}function a(t){return t=r(t),t&&l.test(t)?t.replace(f,"\\$&"):t}var i="[object Array]",c="[object Function]",s=/^\[object .+?Constructor\]$/,f=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(f.source),p=Object.prototype,d=Function.prototype.toString,y=p.toString,h=RegExp("^"+a(y).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),b=u(b=Array.isArray)&&b,v=Math.pow(2,53)-1,g=b||function(t){return e(t)&&o(t.length)&&y.call(t)==i||!1};n.exports=g},{}],6:[function(t,n){function r(t){return t&&"object"==typeof t||!1}function e(t){return"number"==typeof t&&t>-1&&t%1==0&&q>=t}function o(t){return r(t)&&e(t.length)&&O[I.call(t)]||!1}var u="[object Arguments]",a="[object Array]",i="[object Boolean]",c="[object Date]",s="[object Error]",f="[object Function]",l="[object Map]",p="[object Number]",d="[object Object]",y="[object RegExp]",h="[object Set]",b="[object String]",v="[object WeakMap]",g="[object ArrayBuffer]",m="[object Float32Array]",j="[object Float64Array]",x="[object Int8Array]",E="[object Int16Array]",_="[object Int32Array]",w="[object Uint8Array]",A="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",O={};O[m]=O[j]=O[x]=O[E]=O[_]=O[w]=O[A]=O[k]=O[C]=!0,O[u]=O[a]=O[g]=O[i]=O[c]=O[s]=O[f]=O[l]=O[p]=O[d]=O[y]=O[h]=O[b]=O[v]=!1;var U=Object.prototype,I=U.toString,q=Math.pow(2,53)-1;n.exports=o},{}],7:[function(t,n){function r(t,n){return t=+t,n=null==n?y:n,t>-1&&t%1==0&&n>t}function e(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function o(t){for(var n=a(t),o=n.length,u=o&&t.length,s=u&&e(u)&&(c(t)||h.nonEnumArgs&&i(t)),f=-1,p=[];++f0;++a-1&&t%1==0&&c>=t}function o(t){var n=r(t)?t.length:void 0;return e(n)&&i.call(t)==u||!1}var u="[object Arguments]",a=Object.prototype,i=a.toString,c=Math.pow(2,53)-1;n.exports=o},{}],9:[function(t,n){function r(t){return"string"==typeof t?t:null==t?"":t+""}function e(t){return t&&"object"==typeof t||!1}function o(t){return null==t?!1:p.call(t)==a?d.test(l.call(t)):e(t)&&i.test(t)||!1}function u(t){return t=r(t),t&&s.test(t)?t.replace(c,"\\$&"):t}var a="[object Function]",i=/^\[object .+?Constructor\]$/,c=/[.*+?^${}()|[\]\/\\]/g,s=RegExp(c.source),f=Object.prototype,l=Function.prototype.toString,p=f.toString,d=RegExp("^"+u(p).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.exports=o},{}],10:[function(t,n){function r(t,n,r){if("function"!=typeof t)return e;if("undefined"==typeof n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 3:return function(r,e,o){return t.call(n,r,e,o)};case 4:return function(r,e,o,u){return t.call(n,r,e,o,u)};case 5:return function(r,e,o,u,a){return t.call(n,r,e,o,u,a)}}return function(){return t.apply(n,arguments)}}function e(t){return t}n.exports=r},{}],11:[function(t,n){function r(t,n,r){return null==t?{}:"function"==typeof n?a(t,o(n,r,3)):u(t,e(arguments,!1,!1,1))}var e=t("lodash._baseflatten"),o=t("lodash._bindcallback"),u=t("lodash._pickbyarray"),a=t("lodash._pickbycallback");n.exports=r},{"lodash._baseflatten":12,"lodash._bindcallback":15,"lodash._pickbyarray":16,"lodash._pickbycallback":17}],12:[function(t,n){function r(t){return t&&"object"==typeof t||!1}function e(t,n,i,c){for(var s=(c||0)-1,f=t.length,l=-1,p=[];++s-1&&t%1==0&&i>=t}var u=t("lodash.isarguments"),a=t("lodash.isarray"),i=Math.pow(2,53)-1;n.exports=e},{"lodash.isarguments":13,"lodash.isarray":14}],13:[function(t,n,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],14:[function(t,n,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],15:[function(t,n,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],16:[function(t,n){function r(t,n){t=e(t);for(var r=-1,o=n.length,u={};++r-1&&t%1==0&&n>t}function e(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function o(t){var n=typeof t;return"function"==n||t&&"object"==n||!1}function u(t){if(null==t)return[];o(t)||(t=Object(t));var n=t.length;n=n&&e(n)&&(i(t)||p.nonEnumArgs&&a(t))&&n||0;for(var u=t.constructor,c=-1,f="function"==typeof u&&u.prototype==t,l=Array(n),d=n>0;++c true (number of cursors differ)"),!0):a(y,u,o)?(g&&g.call(this,"shouldComponentUpdate => true (cursors have different keys)"),!0):r(u,o)?(g&&g.call(this,"shouldComponentUpdate => true (cursors have changed)"),!0):x(this.state,n)?d(u,o)?(g&&g.call(this,"shouldComponentUpdate => true (properties have changed)"),!0):(g&&g.call(this,"shouldComponentUpdate => false"),!1):(g&&g.call(this,"shouldComponentUpdate => true (state has changed)"),!0)}function r(t,n){t=l(t,m),n=l(n,m);for(var r in t)if(!j(t[r],n[r]))return!0;return!1}function d(t,n){t=l(t,i(m)),n=l(n,i(m));for(var r in t)if(!E(t[r],n[r]))return!0;return!1}function y(t,n){return p(t,n,function(t,n){return _(t)&&_(n)?t===n:_(t)||_(n)?!1:void 0})}function h(t,n){return p(t,n,function(t,n){return m(t)&&m(n)?b(t,n):m(t)||m(n)?!1:_(t)&&_(n)?t===n:_(t)||_(n)?!1:void 0})}function b(t,n){return w(t)===w(n)}function v(t,n){"function"==typeof t&&(n=t,t=void 0);var r=n;!r&&console.debug&&(r=console.debug.bind(console)),!r&&console.info&&(r=console.info.bind(console));var e=new RegExp(t||".*");return g=function(t){var n=this._currentElement;this._reactInternalInstance&&this._reactInternalInstance._currentElement&&(n=this._reactInternalInstance._currentElement);var o=n&&n.key?" key="+n.key:"",u=this.constructor.displayName;o||u||(u="Unknown");var a=u+o;e.test(a)&&r("<"+a+">: "+t)}}var g;t=t||{};var m=t.isCursor||u,j=t.isEqualCursor||b,x=t.isEqualState||y,E=t.isEqualProps||h,_=t.isImmutable||e,w=t.unCursor||o;return n.isCursor=m,n.isEqualState=x,n.isEqualProps=E,n.isEqualCursor=j,n.isImmutable=_,n.debug=v,n}function e(t){return!(!t||!t[d])}function o(t){return t.deref()}function u(t){return t&&"function"==typeof t.deref}function a(t,n,r){return!t.every(function(t){return"undefined"!=typeof n[t]&&"undefined"!=typeof r[t]})}function i(t){return function(){return!t.apply(t,arguments)}}function c(t,n){return"statics"===n}function s(t,n){return"children"===n}function f(t,n){return function(){return t.apply(null,arguments)||n.apply(null,arguments)}}var l=t("lodash.pick"),p=t("lodash.isequal");n.exports=r(),n.exports.withDefaults=r;var d="@@__IMMUTABLE_ITERABLE__@@"},{"lodash.isequal":3,"lodash.pick":11}]},{},[1])(1)}); \ No newline at end of file