From cb5b2c6a5a87bbd91e5f9f227e8c427baf003a87 Mon Sep 17 00:00:00 2001 From: Akshay Anand Date: Tue, 16 Jul 2019 20:34:11 -0400 Subject: [PATCH] inline node modules for esm --- bili.config.js | 1 + dev/main.js | 6 +- dist/vue-good-table.cjs.js | 12222 +++++++++++++++++++++++++++++++---- dist/vue-good-table.esm.js | 12210 ++++++++++++++++++++++++++++++---- dist/vue-good-table.js | 2 +- dist/vue-good-table.min.js | 2 +- 6 files changed, 22171 insertions(+), 2272 deletions(-) diff --git a/bili.config.js b/bili.config.js index 784a4594..620bdca2 100644 --- a/bili.config.js +++ b/bili.config.js @@ -31,4 +31,5 @@ module.exports = { css: false, }, }, + bundleNodeModules: true, }; diff --git a/dev/main.js b/dev/main.js index f2e15042..8856fc95 100644 --- a/dev/main.js +++ b/dev/main.js @@ -1,9 +1,9 @@ // eslint-disable-next-line import/no-extraneous-dependencies import Vue from 'vue'; import App from './App.vue'; -// import VueGoodTable from '../dist/vue-good-table.esm'; -// import '../dist/vue-good-table.css'; -import VueGoodTable from '../src'; +import VueGoodTable from '../dist/vue-good-table.esm'; +import '../dist/vue-good-table.css'; +// import VueGoodTable from '../src'; Vue.use(VueGoodTable); diff --git a/dist/vue-good-table.cjs.js b/dist/vue-good-table.cjs.js index e3412867..87ef715e 100644 --- a/dist/vue-good-table.cjs.js +++ b/dist/vue-good-table.cjs.js @@ -1,5 +1,5 @@ /** - * vue-good-table v2.17.1 + * vue-good-table v2.17.2 * (c) 2018-present xaksis * https://github.com/xaksis/vue-good-table * Released under the MIT License. @@ -9,17 +9,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var each = _interopDefault(require('lodash.foreach')); -var assign = _interopDefault(require('lodash.assign')); -var cloneDeep = _interopDefault(require('lodash.clonedeep')); -var filter = _interopDefault(require('lodash.filter')); -var isEqual = _interopDefault(require('lodash.isequal')); -var diacriticless = _interopDefault(require('diacriticless')); -var __vue_normalize__ = _interopDefault(require('vue-runtime-helpers/dist/normalize-component.js')); -var dateFns = require('date-fns'); - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { @@ -92,1267 +81,11226 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -var escapeRegExp = function escapeRegExp(str) { - return str.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&'); -}; - -var defaultType = { - format: function format(x) { - return x; - }, - filterPredicate: function filterPredicate(rowval, filter) { - var skipDiacritics = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ - // take care of nulls - if (typeof rowval === 'undefined' || rowval === null) { - return false; - } // row value +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; - var rowValue = skipDiacritics ? String(rowval).toLowerCase() : diacriticless(escapeRegExp(String(rowval)).toLowerCase()); // search term +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; - var searchTerm = skipDiacritics ? filter.toLowerCase() : diacriticless(escapeRegExp(filter).toLowerCase()); // comparison +/** + * 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 ? array.length : 0; - return rowValue.indexOf(searchTerm) > -1; - }, - compare: function compare(x, y) { - function cook(d) { - if (typeof d === 'undefined' || d === null) return ''; - return diacriticless(d.toLowerCase()); + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } + } + return array; +} - x = cook(x); - y = cook(y); - if (x < y) return -1; - if (x > y) return 1; - return 0; +/** + * 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; +} -// -// -// -// -// -// -// -// -// -// -var script = { - name: 'VgtPaginationPageInfo', - props: { - currentPage: { - "default": 1 - }, - lastPage: { - "default": 1 - }, - totalRecords: { - "default": 0 - }, - ofText: { - "default": 'of', - type: String - }, - pageText: { - "default": 'page', - type: String - } - }, - data: function data() { - return {}; - }, - computed: { - pageInfo: function pageInfo() { - return "".concat(this.ofText, " ").concat(this.lastPage); - } - }, - methods: { - changePage: function changePage(event) { - var value = parseInt(event.target.value, 10); //! invalid number +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} - if (Number.isNaN(value) || value > this.lastPage || value < 1) { - event.target.value = this.currentPage; - return false; - } //* valid number +/** Used for built-in method references. */ +var objectProto = Object.prototype; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - event.target.value = value; - this.$emit('page-changed', value); +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); } - }, - mounted: function mounted() {}, - components: {} -}; + } + return result; +} -/* script */ -var __vue_script__ = script; -/* template */ +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); -var __vue_render__ = function __vue_render__() { - var _vm = this; +/** + * 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`. + * + * @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`. + */ +var baseFor = createBaseFor(); - var _h = _vm.$createElement; +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} - var _c = _vm._self._c || _h; +/** + * The base implementation of `_.keys` 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 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; +} - return _c('div', { - staticClass: "footer__navigation__page-info" - }, [_vm._v("\n " + _vm._s(_vm.pageText) + " "), _c('input', { - staticClass: "footer__navigation__page-info__current-entry", - attrs: { - "type": "text" - }, - domProps: { - "value": _vm.currentPage - }, - on: { - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @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 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); - $event.stopPropagation(); - return _vm.changePage($event); + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; } } - }), _vm._v(" " + _vm._s(_vm.pageInfo) + "\n")]); -}; + return collection; + }; +} -var __vue_staticRenderFns__ = []; -/* style */ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +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; + }; +} -var __vue_inject_styles__ = undefined; -/* scoped */ +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} -var __vue_scope_id__ = "data-v-9a8cd1f4"; -/* module identifier */ +/** + * 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; -var __vue_module_identifier__ = undefined; -/* functional template */ + return value === proto; +} -var __vue_is_functional_template__ = false; -/* style inject */ +/** + * 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`. + * + * **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 _ + * @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 + * + * _([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) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, typeof iteratee == 'function' ? iteratee : identity); +} -/* style inject SSR */ +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} -var VgtPaginationPageInfo = __vue_normalize__({ - render: __vue_render__, - staticRenderFns: __vue_staticRenderFns__ -}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined); +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; -// -var DEFAULT_ROWS_PER_PAGE_DROPDOWN = [10, 20, 30, 40, 50]; -var script$1 = { - name: 'VgtPagination', - props: { - styleClass: { - "default": 'table table-bordered' - }, - total: { - "default": null - }, - perPage: {}, - rtl: { - "default": false - }, - customRowsPerPageDropdown: { - "default": function _default() { - return []; - } - }, - paginateDropdownAllowAll: { - "default": true - }, - mode: { - "default": 'records' - }, - // text options - nextText: { - "default": 'Next' - }, - prevText: { - "default": 'Prev' - }, - rowsPerPageText: { - "default": 'Rows per page:' - }, - ofText: { - "default": 'of' - }, - pageText: { - "default": 'page' - }, - allText: { - "default": 'All' - } - }, - data: function data() { - return { - currentPage: 1, - prevPage: 0, - currentPerPage: 10, - rowsPerPageOptions: [] - }; - }, - watch: { - perPage: { - handler: function handler(newValue, oldValue) { - this.handlePerPage(); - this.perPageChanged(); - }, - immediate: true - }, - customRowsPerPageDropdown: function customRowsPerPageDropdown() { - this.handlePerPage(); - } - }, - computed: { - // Number of pages - pagesCount: function pagesCount() { - var quotient = Math.floor(this.total / this.currentPerPage); - var remainder = this.total % this.currentPerPage; - return remainder === 0 ? quotient : quotient + 1; - }, - // Current displayed items - paginatedInfo: function paginatedInfo() { +/** + * 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 _ + * @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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +var lodash_foreach = forEach; + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER$1 = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag$1 = '[object Arguments]', + funcTag$1 = '[object Function]', + genTag$1 = '[object GeneratorFunction]'; + +/** Used to detect unsigned integer values. */ +var reIsUint$1 = /^(?:0|[1-9]\d*)$/; + +/** + * 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 {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +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); +} + +/** + * 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$1(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg$1(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty$1 = objectProto$1.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var propertyIsEnumerable$1 = objectProto$1.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys$1 = overArg$1(Object.keys, Object), + nativeMax = Math.max; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable$1.call({ 'valueOf': 1 }, 'valueOf'); + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys$1(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray$1(value) || isArguments$1(value)) + ? baseTimes$1(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty$1.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex$1(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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. + * + * @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$1.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * The base implementation of `_.keys` 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 baseKeys$1(object) { + if (!isPrototype$1(object)) { + return nativeKeys$1(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty$1.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @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 baseRest(func, start) { + 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] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * 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) { + 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) + : undefined; + + assignValue(object, key, newValue === undefined ? source[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 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; + }); +} + +/** + * 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$1(value, length) { + length = length == null ? MAX_SAFE_INTEGER$1 : length; + return !!length && + (typeof value == 'number' || reIsUint$1.test(value)) && + (value > -1 && value % 1 == 0 && value < 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$1(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike$1(object) && isIndex$1(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$1(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$1; + + return value === proto; +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments$1(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject$1(value) && hasOwnProperty$1.call(value, 'callee') && + (!propertyIsEnumerable$1.call(value, 'callee') || objectToString$1.call(value) == argsTag$1); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray$1 = 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 _ + * @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 isArrayLike$1(value) { + return value != null && isLength$1(value.length) && !isFunction$1(value); +} + +/** + * 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 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$1(value) { + return isObjectLike$1(value) && isArrayLike$1(value); +} + +/** + * 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$1(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject$1(value) ? objectToString$1.call(value) : ''; + return tag == funcTag$1 || tag == genTag$1; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength$1(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; +} + +/** + * 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 an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject$1(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 _ + * @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 isObjectLike$1(value) { + return !!value && typeof value == '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 _ + * @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 + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype$1(source) || isArrayLike$1(source)) { + copyObject(source, keys$1(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty$1.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +/** + * 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/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 keys$1(object) { + return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys$1(object); +} + +var lodash_assign = assign; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var lodash_clonedeep = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** 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__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `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]', + promiseTag = '[object Promise]', + 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 match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +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; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * 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 ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * 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 ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * 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; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * 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; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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) : ''; +}()); + +/** 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 resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * 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); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + return getMapData(this, key)['delete'](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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * 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) { + return this.__data__['delete'](key); +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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 cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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. + * + * @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; + } +} + +/** + * 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 -1; +} + +/** + * 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); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including 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 baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + 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)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return 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); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(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, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * 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} 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 baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * 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) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @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 cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @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 cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * 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) { + 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) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * 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; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +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 = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + 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; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +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; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @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 initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * 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 == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 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 _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 a buffer. + * + * @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; + +/** + * 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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @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 stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = cloneDeep; +}); + +var lodash_filter = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** 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; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `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]', + promiseTag = '[object Promise]', + 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 match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == '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('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array ? array.length : 0, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * 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 ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * 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 accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * 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; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * 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; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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) : ''; +}()); + +/** 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 resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(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; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * 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); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + return getMapData(this, key)['delete'](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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array 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; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * 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) { + return this.__data__['delete'](key); +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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 cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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 -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @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 baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +/** + * 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`. + * + * @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`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * 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] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` 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 baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @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`. + */ +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); +} + +/** + * 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 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`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + 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; + + 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__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * 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; + + 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]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * 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) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * 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); +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +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, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @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 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; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +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; + }; +} + +/** + * 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 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`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // 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 & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // 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 (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + 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} 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`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, 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 & PARTIAL_COMPARE_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 |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * 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 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`. + */ +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; + + 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); + + 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, customizer, bitmask, 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; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * 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; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +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 = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + 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; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @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 hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(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 suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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 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); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + 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; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * 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 _ + * @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 + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // 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 filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate)); +} + +/** + * 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 `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @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 = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + 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); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 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 _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 _ + * @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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @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 + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * 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 process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @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 get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @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 + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @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 + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = filter; +}); + +var lodash_isequal = createCommonjsModule(function (module, exports) { +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** 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__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + 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 match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == '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) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * 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 == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * 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; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @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 cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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 detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +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]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * 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; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * 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); + + 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; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +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]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * 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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +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; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * 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; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * 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__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +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; + + 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); + } + } + return result; +} + +/** + * 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 -1; +} + +/** + * 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} 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 baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @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 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); +} + +/** + * 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); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + 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__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + 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); +} + +/** + * 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)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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 {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 equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // 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; + + stack.set(array, other); + stack.set(other, array); + + // 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; + } + } + stack['delete'](array); + stack['delete'](other); + 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} 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; +} + +/** + * 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 {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 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; + + 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); + + 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; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * 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; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + 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; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +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; + }; +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * 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 == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @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; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.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 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * 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; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 != null && (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 _ + * @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 isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @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 + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @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 stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; +}); + +// all diacritics +var diacritics = + { + 'a' : ['a','à','á','â','ã','ä','å','æ','ā','ă','ą','ǎ','ǟ','ǡ','ǻ','ȁ','ȃ','ȧ','ɐ','ɑ','ɒ','ͣ','а','ӑ','ӓ','ᵃ','ᵄ','ᶏ','ḁ','ẚ','ạ','ả','ấ','ầ','ẩ','ẫ','ậ','ắ','ằ','ẳ','ẵ','ặ','ₐ','ⱥ','a'], + 'A' : ['A','À','Á','Â','Ã','Ä','Å','Ā','Ă','Ą','Ǎ','Ǟ','Ǡ','Ǻ','Ȁ','Ȃ','Ȧ','Ⱥ','А','Ӑ','Ӓ','ᴀ','ᴬ','Ḁ','Ạ','Ả','Ấ','Ầ','Ẩ','Ẫ','Ậ','Ắ','Ằ','Ẳ','Ẵ','Ặ','A'], + + 'b' : ['b','ƀ','ƃ','ɓ','ᖯ','ᵇ','ᵬ','ᶀ','ḃ','ḅ','ḇ','b'], + 'B' : ['B','Ɓ','Ƃ','Ƀ','ʙ','ᛒ','ᴃ','ᴮ','ᴯ','Ḃ','Ḅ','Ḇ','B'], + + 'c' : ['c','ç','ć','ĉ','ċ','č','ƈ','ȼ','ɕ','ͨ','ᴄ','ᶜ','ḉ','ↄ','c'], + 'C' : ['C','Ç','Ć','Ĉ','Ċ','Č','Ƈ','Ȼ','ʗ','Ḉ','C'], + + 'd' : ['d','ď','đ','Ƌ','ƌ','ȡ','ɖ','ɗ','ͩ','ᵈ','ᵭ','ᶁ','ᶑ','ḋ','ḍ','ḏ','ḑ','ḓ','d'], + 'D' : ['D','Ď','Đ','Ɖ','Ɗ','ᴰ','Ḋ','Ḍ','Ḏ','Ḑ','Ḓ','D'], + + 'e' : ['e','è','é','ê','ë','ē','ĕ','ė','ę','ě','ǝ','ȅ','ȇ','ȩ','ɇ','ɘ','ͤ','ᵉ','ᶒ','ḕ','ḗ','ḙ','ḛ','ḝ','ẹ','ẻ','ẽ','ế','ề','ể','ễ','ệ','ₑ','e'], + 'E' : ['E','È','É','Ê','Ë','Ē','Ĕ','Ė','Ę','Ě','Œ','Ǝ','Ɛ','Ȅ','Ȇ','Ȩ','Ɇ','ɛ','ɜ','ɶ','Є','Э','э','є','Ӭ','ӭ','ᴇ','ᴈ','ᴱ','ᴲ','ᵋ','ᵌ','ᶓ','ᶔ','ᶟ','Ḕ','Ḗ','Ḙ','Ḛ','Ḝ','Ẹ','Ẻ','Ẽ','Ế','Ề','Ể','Ễ','Ệ','E','𐐁','𐐩'], + + 'f' : ['f','ƒ','ᵮ','ᶂ','ᶠ','ḟ','f'], + 'F' : ['F','Ƒ','Ḟ','ⅎ','F'], + + 'g' : ['g','ĝ','ğ','ġ','ģ','ǥ','ǧ','ǵ','ɠ','ɡ','ᵍ','ᵷ','ᵹ','ᶃ','ᶢ','ḡ','g'], + 'G' : ['G','Ĝ','Ğ','Ġ','Ģ','Ɠ','Ǥ','Ǧ','Ǵ','ɢ','ʛ','ᴳ','Ḡ','G'], + + 'h' : ['h','ĥ','ħ','ƕ','ȟ','ɥ','ɦ','ʮ','ʯ','ʰ','ʱ','ͪ','Һ','һ','ᑋ','ᶣ','ḣ','ḥ','ḧ','ḩ','ḫ','ⱨ','h'], + 'H' : ['H','Ĥ','Ħ','Ȟ','ʜ','ᕼ','ᚺ','ᚻ','ᴴ','Ḣ','Ḥ','Ḧ','Ḩ','Ḫ','Ⱨ','H'], + + 'i' : ['i','ì','í','î','ï','ĩ','ī','ĭ','į','ǐ','ȉ','ȋ','ɨ','ͥ','ᴉ','ᵎ','ᵢ','ᶖ','ᶤ','ḭ','ḯ','ỉ','ị','i'], + 'I' : ['I','Ì','Í','Î','Ï','Ĩ','Ī','Ĭ','Į','İ','Ǐ','Ȉ','Ȋ','ɪ','І','ᴵ','ᵻ','ᶦ','ᶧ','Ḭ','Ḯ','Ỉ','Ị','I'], + + 'j' : ['j','ĵ','ǰ','ɉ','ʝ','ʲ','ᶡ','ᶨ','j'], + 'J' : ['J','Ĵ','ᴊ','ᴶ','J'], + + 'k' : ['k','ķ','ƙ','ǩ','ʞ','ᵏ','ᶄ','ḱ','ḳ','ḵ','ⱪ','k'], + 'K' : ['K','Ķ','Ƙ','Ǩ','ᴷ','Ḱ','Ḳ','Ḵ','Ⱪ','K'], + + 'l' : ['l','ĺ','ļ','ľ','ŀ','ł','ƚ','ȴ','ɫ','ɬ','ɭ','ˡ','ᶅ','ᶩ','ᶪ','ḷ','ḹ','ḻ','ḽ','ℓ','ⱡ'], + 'L' : ['L','Ĺ','Ļ','Ľ','Ŀ','Ł','Ƚ','ʟ','ᴌ','ᴸ','ᶫ','Ḷ','Ḹ','Ḻ','Ḽ','Ⱡ','Ɫ'], + + 'm' : ['m','ɯ','ɰ','ɱ','ͫ','ᴟ','ᵐ','ᵚ','ᵯ','ᶆ','ᶬ','ᶭ','ḿ','ṁ','ṃ','㎡','㎥','m'], + 'M' : ['M','Ɯ','ᴍ','ᴹ','Ḿ','Ṁ','Ṃ','M'], + + 'n' : ['n','ñ','ń','ņ','ň','ʼn','ƞ','ǹ','ȵ','ɲ','ɳ','ᵰ','ᶇ','ᶮ','ᶯ','ṅ','ṇ','ṉ','ṋ','ⁿ','n'], + 'N' : ['N','Ñ','Ń','Ņ','Ň','Ɲ','Ǹ','Ƞ','ɴ','ᴎ','ᴺ','ᴻ','ᶰ','Ṅ','Ṇ','Ṉ','Ṋ','N'], + + 'o' : ['o','ò','ó','ô','õ','ö','ø','ō','ŏ','ő','ơ','ǒ','ǫ','ǭ','ǿ','ȍ','ȏ','ȫ','ȭ','ȯ','ȱ','ɵ','ͦ','о','ӧ','ө','ᴏ','ᴑ','ᴓ','ᴼ','ᵒ','ᶱ','ṍ','ṏ','ṑ','ṓ','ọ','ỏ','ố','ồ','ổ','ỗ','ộ','ớ','ờ','ở','ỡ','ợ','ₒ','o','𐐬'], + 'O' : ['O','Ò','Ó','Ô','Õ','Ö','Ø','Ō','Ŏ','Ő','Ɵ','Ơ','Ǒ','Ǫ','Ǭ','Ǿ','Ȍ','Ȏ','Ȫ','Ȭ','Ȯ','Ȱ','О','Ӧ','Ө','Ṍ','Ṏ','Ṑ','Ṓ','Ọ','Ỏ','Ố','Ồ','Ổ','Ỗ','Ộ','Ớ','Ờ','Ở','Ỡ','Ợ','O','𐐄'], + + 'p' : ['p','ᵖ','ᵱ','ᵽ','ᶈ','ṕ','ṗ','p'], + 'P' : ['P','Ƥ','ᴘ','ᴾ','Ṕ','Ṗ','Ᵽ','P'], + + 'q' : ['q','ɋ','ʠ','ᛩ','q'], + 'Q' : ['Q','Ɋ','Q'], + + 'r' : ['r','ŕ','ŗ','ř','ȑ','ȓ','ɍ','ɹ','ɻ','ʳ','ʴ','ʵ','ͬ','ᵣ','ᵲ','ᶉ','ṙ','ṛ','ṝ','ṟ'], + 'R' : ['R','Ŕ','Ŗ','Ř','Ʀ','Ȑ','Ȓ','Ɍ','ʀ','ʁ','ʶ','ᚱ','ᴙ','ᴚ','ᴿ','Ṙ','Ṛ','Ṝ','Ṟ','Ɽ'], + + 's' : ['s','ś','ŝ','ş','š','ș','ʂ','ᔆ','ᶊ','ṡ','ṣ','ṥ','ṧ','ṩ','s'], + 'S' : ['S','Ś','Ŝ','Ş','Š','Ș','ȿ','ˢ','ᵴ','Ṡ','Ṣ','Ṥ','Ṧ','Ṩ','S'], + + 't' : ['t','ţ','ť','ŧ','ƫ','ƭ','ț','ʇ','ͭ','ᵀ','ᵗ','ᵵ','ᶵ','ṫ','ṭ','ṯ','ṱ','ẗ','t'], + 'T' : ['T','Ţ','Ť','Ƭ','Ʈ','Ț','Ⱦ','ᴛ','ᵀ','Ṫ','Ṭ','Ṯ','Ṱ','T'], + + 'u' : ['u','ù','ú','û','ü','ũ','ū','ŭ','ů','ű','ų','ư','ǔ','ǖ','ǘ','ǚ','ǜ','ȕ','ȗ','ͧ','ߎ','ᵘ','ᵤ','ṳ','ṵ','ṷ','ṹ','ṻ','ụ','ủ','ứ','ừ','ử','ữ','ự','u'], + 'U' : ['U','Ù','Ú','Û','Ü','Ũ','Ū','Ŭ','Ů','Ű','Ų','Ư','Ǔ','Ǖ','Ǘ','Ǚ','Ǜ','Ȕ','Ȗ','Ʉ','ᴜ','ᵁ','ᵾ','Ṳ','Ṵ','Ṷ','Ṹ','Ṻ','Ụ','Ủ','Ứ','Ừ','Ử','Ữ','Ự','U'], + + 'v' : ['v','ʋ','ͮ','ᵛ','ᵥ','ᶹ','ṽ','ṿ','ⱱ','v','ⱴ'], + 'V' : ['V','Ʋ','Ʌ','ʌ','ᴠ','ᶌ','Ṽ','Ṿ','V'], + + 'w' : ['w','ŵ','ʷ','ᵂ','ẁ','ẃ','ẅ','ẇ','ẉ','ẘ','ⱳ','w'], + 'W' : ['W','Ŵ','ʍ','ᴡ','Ẁ','Ẃ','Ẅ','Ẇ','Ẉ','Ⱳ','W'], + + 'x' : ['x','̽','͓','ᶍ','ͯ','ẋ','ẍ','ₓ','x'], + 'X' : ['X','ˣ','ͯ','Ẋ','Ẍ','☒','✕','✖','✗','✘','X'], + + 'y' : ['y','ý','ÿ','ŷ','ȳ','ɏ','ʸ','ẏ','ỳ','ỵ','ỷ','ỹ','y'], + 'Y' : ['Y','Ý','Ŷ','Ÿ','Ƴ','ƴ','Ȳ','Ɏ','ʎ','ʏ','Ẏ','Ỳ','Ỵ','Ỷ','Ỹ','Y'], + + 'z' : ['z','ź','ż','ž','ƶ','ȥ','ɀ','ʐ','ʑ','ᙆ','ᙇ','ᶻ','ᶼ','ᶽ','ẑ','ẓ','ẕ','ⱬ','z'], + 'Z' : ['Z','Ź','Ż','Ž','Ƶ','Ȥ','ᴢ','ᵶ','Ẑ','Ẓ','Ẕ','Ⱬ','Z'] + }; + +/* + * Main function of the module which removes all diacritics from the received text + */ +var diacriticless = function (text) { + var result = []; + + // iterate over all the characters of the received text + for(var i=0; i 2 && arguments[2] !== undefined ? arguments[2] : false; + + // take care of nulls + if (typeof rowval === 'undefined' || rowval === null) { + return false; + } // row value + + + var rowValue = skipDiacritics ? String(rowval).toLowerCase() : diacriticless(escapeRegExp(String(rowval)).toLowerCase()); // search term + + var searchTerm = skipDiacritics ? filter.toLowerCase() : diacriticless(escapeRegExp(filter).toLowerCase()); // comparison + + return rowValue.indexOf(searchTerm) > -1; + }, + compare: function compare(x, y) { + function cook(d) { + if (typeof d === 'undefined' || d === null) return ''; + return diacriticless(d.toLowerCase()); + } + + x = cook(x); + y = cook(y); + if (x < y) return -1; + if (x > y) return 1; + return 0; + } +}; + +// +// +// +// +// +// +// +// +// +// +var script = { + name: 'VgtPaginationPageInfo', + props: { + currentPage: { + "default": 1 + }, + lastPage: { + "default": 1 + }, + totalRecords: { + "default": 0 + }, + ofText: { + "default": 'of', + type: String + }, + pageText: { + "default": 'page', + type: String + } + }, + data: function data() { + return {}; + }, + computed: { + pageInfo: function pageInfo() { + return "".concat(this.ofText, " ").concat(this.lastPage); + } + }, + methods: { + changePage: function changePage(event) { + var value = parseInt(event.target.value, 10); //! invalid number + + if (Number.isNaN(value) || value > this.lastPage || value < 1) { + event.target.value = this.currentPage; + return false; + } //* valid number + + + event.target.value = value; + this.$emit('page-changed', value); + } + }, + mounted: function mounted() {}, + components: {} +}; + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier +/* server only */ +, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; +} + +var normalizeComponent_1 = normalizeComponent; + +/* script */ +var __vue_script__ = script; +/* template */ + +var __vue_render__ = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('div', { + staticClass: "footer__navigation__page-info" + }, [_vm._v("\n " + _vm._s(_vm.pageText) + " "), _c('input', { + staticClass: "footer__navigation__page-info__current-entry", + attrs: { + "type": "text" + }, + domProps: { + "value": _vm.currentPage + }, + on: { + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + $event.stopPropagation(); + return _vm.changePage($event); + } + } + }), _vm._v(" " + _vm._s(_vm.pageInfo) + "\n")]); +}; + +var __vue_staticRenderFns__ = []; +/* style */ + +var __vue_inject_styles__ = undefined; +/* scoped */ + +var __vue_scope_id__ = "data-v-9a8cd1f4"; +/* module identifier */ + +var __vue_module_identifier__ = undefined; +/* functional template */ + +var __vue_is_functional_template__ = false; +/* style inject */ + +/* style inject SSR */ + +var VgtPaginationPageInfo = normalizeComponent_1({ + render: __vue_render__, + staticRenderFns: __vue_staticRenderFns__ +}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined); + +// +var DEFAULT_ROWS_PER_PAGE_DROPDOWN = [10, 20, 30, 40, 50]; +var script$1 = { + name: 'VgtPagination', + props: { + styleClass: { + "default": 'table table-bordered' + }, + total: { + "default": null + }, + perPage: {}, + rtl: { + "default": false + }, + customRowsPerPageDropdown: { + "default": function _default() { + return []; + } + }, + paginateDropdownAllowAll: { + "default": true + }, + mode: { + "default": 'records' + }, + // text options + nextText: { + "default": 'Next' + }, + prevText: { + "default": 'Prev' + }, + rowsPerPageText: { + "default": 'Rows per page:' + }, + ofText: { + "default": 'of' + }, + pageText: { + "default": 'page' + }, + allText: { + "default": 'All' + } + }, + data: function data() { + return { + currentPage: 1, + prevPage: 0, + currentPerPage: 10, + rowsPerPageOptions: [] + }; + }, + watch: { + perPage: { + handler: function handler(newValue, oldValue) { + this.handlePerPage(); + this.perPageChanged(); + }, + immediate: true + }, + customRowsPerPageDropdown: function customRowsPerPageDropdown() { + this.handlePerPage(); + } + }, + computed: { + // Number of pages + pagesCount: function pagesCount() { + var quotient = Math.floor(this.total / this.currentPerPage); + var remainder = this.total % this.currentPerPage; + return remainder === 0 ? quotient : quotient + 1; + }, + // Current displayed items + paginatedInfo: function paginatedInfo() { var first = (this.currentPage - 1) * this.currentPerPage + 1; var last = Math.min(this.total, this.currentPage * this.currentPerPage); - if (last === 0) { - first = 0; - } + if (last === 0) { + first = 0; + } + + return "".concat(first, " - ").concat(last, " ").concat(this.ofText, " ").concat(this.total); + }, + // Can go to next page + nextIsPossible: function nextIsPossible() { + return this.currentPage < this.pagesCount; + }, + // Can go to previous page + prevIsPossible: function prevIsPossible() { + return this.currentPage > 1; + } + }, + methods: { + // Change current page + changePage: function changePage(pageNumber) { + var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) { + this.prevPage = this.currentPage; + this.currentPage = pageNumber; + if (emit) this.pageChanged(); + } + }, + // Go to next page + nextPage: function nextPage() { + if (this.nextIsPossible) { + this.prevPage = this.currentPage; + ++this.currentPage; + this.pageChanged(); + } + }, + // Go to previous page + previousPage: function previousPage() { + if (this.prevIsPossible) { + this.prevPage = this.currentPage; + --this.currentPage; + this.pageChanged(); + } + }, + // Indicate page changing + pageChanged: function pageChanged() { + this.$emit('page-changed', { + currentPage: this.currentPage, + prevPage: this.prevPage + }); + }, + // Indicate per page changing + perPageChanged: function perPageChanged() { + // go back to first page + this.$emit('per-page-changed', { + currentPerPage: this.currentPerPage + }); + this.changePage(1, false); + }, + // Handle per page changing + handlePerPage: function handlePerPage() { + //* if there's a custom dropdown then we use that + if (this.customRowsPerPageDropdown !== null && Array.isArray(this.customRowsPerPageDropdown) && this.customRowsPerPageDropdown.length !== 0) { + this.rowsPerPageOptions = this.customRowsPerPageDropdown; + } else { + //* otherwise we use the default rows per page dropdown + this.rowsPerPageOptions = lodash_clonedeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN); + } + + if (this.perPage) { + this.currentPerPage = this.perPage; // if perPage doesn't already exist, we add it + + var found = false; + + for (var i = 0; i < this.rowsPerPageOptions.length; i++) { + if (this.rowsPerPageOptions[i] === this.perPage) { + found = true; + } + } + + if (!found && this.perPage !== -1) { + this.rowsPerPageOptions.unshift(this.perPage); + } + } else { + // reset to default + this.currentPerPage = 10; + } + } + }, + mounted: function mounted() {}, + components: { + 'pagination-page-info': VgtPaginationPageInfo + } +}; + +/* script */ +var __vue_script__$1 = script$1; +/* template */ + +var __vue_render__$1 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('div', { + staticClass: "vgt-wrap__footer vgt-clearfix" + }, [_c('div', { + staticClass: "footer__row-count vgt-pull-left" + }, [_c('span', { + staticClass: "footer__row-count__label" + }, [_vm._v(_vm._s(_vm.rowsPerPageText))]), _vm._v(" "), _c('select', { + directives: [{ + name: "model", + rawName: "v-model", + value: _vm.currentPerPage, + expression: "currentPerPage" + }], + staticClass: "footer__row-count__select", + attrs: { + "autocomplete": "off", + "name": "perPageSelect" + }, + on: { + "change": [function ($event) { + var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) { + return o.selected; + }).map(function (o) { + var val = "_value" in o ? o._value : o.value; + return val; + }); + _vm.currentPerPage = $event.target.multiple ? $$selectedVal : $$selectedVal[0]; + }, _vm.perPageChanged] + } + }, [_vm._l(_vm.rowsPerPageOptions, function (option, idx) { + return _c('option', { + key: 'rows-dropdown-option-' + idx, + domProps: { + "value": option + } + }, [_vm._v("\n " + _vm._s(option) + "\n ")]); + }), _vm._v(" "), _vm.paginateDropdownAllowAll ? _c('option', { + domProps: { + "value": _vm.total + } + }, [_vm._v(_vm._s(_vm.allText))]) : _vm._e()], 2)]), _vm._v(" "), _c('div', { + staticClass: "footer__navigation vgt-pull-right" + }, [_c('a', { + staticClass: "footer__navigation__page-btn", + "class": { + disabled: !_vm.prevIsPossible + }, + attrs: { + "href": "javascript:undefined", + "tabindex": "0" + }, + on: { + "click": function click($event) { + $event.preventDefault(); + $event.stopPropagation(); + return _vm.previousPage($event); + } + } + }, [_c('span', { + staticClass: "chevron", + "class": { + 'left': !_vm.rtl, + 'right': _vm.rtl + } + }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _vm.mode === 'pages' ? _c('pagination-page-info', { + attrs: { + "totalRecords": _vm.total, + "lastPage": _vm.pagesCount, + "currentPage": _vm.currentPage, + "ofText": _vm.ofText, + "pageText": _vm.pageText + }, + on: { + "page-changed": _vm.changePage + } + }) : _c('div', { + staticClass: "footer__navigation__info" + }, [_vm._v(_vm._s(_vm.paginatedInfo))]), _vm._v(" "), _c('a', { + staticClass: "footer__navigation__page-btn", + "class": { + disabled: !_vm.nextIsPossible + }, + attrs: { + "href": "javascript:undefined", + "tabindex": "0" + }, + on: { + "click": function click($event) { + $event.preventDefault(); + $event.stopPropagation(); + return _vm.nextPage($event); + } + } + }, [_c('span', [_vm._v(_vm._s(_vm.nextText))]), _vm._v(" "), _c('span', { + staticClass: "chevron", + "class": { + 'right': !_vm.rtl, + 'left': _vm.rtl + } + })])], 1)]); +}; + +var __vue_staticRenderFns__$1 = []; +/* style */ + +var __vue_inject_styles__$1 = undefined; +/* scoped */ + +var __vue_scope_id__$1 = undefined; +/* module identifier */ + +var __vue_module_identifier__$1 = undefined; +/* functional template */ + +var __vue_is_functional_template__$1 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtPagination = normalizeComponent_1({ + render: __vue_render__$1, + staticRenderFns: __vue_staticRenderFns__$1 +}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, undefined, undefined); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +var script$2 = { + name: 'VgtGlobalSearch', + props: ['value', 'searchEnabled', 'globalSearchPlaceholder'], + data: function data() { + return { + globalSearchTerm: null + }; + }, + computed: { + showControlBar: function showControlBar() { + if (this.searchEnabled) return true; + if (this.$slots && this.$slots['internal-table-actions']) return true; + return false; + } + }, + methods: { + updateValue: function updateValue(value) { + this.$emit('input', value); + this.$emit('on-keyup', value); + }, + entered: function entered(value) { + this.$emit('on-enter', value); + } + } +}; + +/* script */ +var __vue_script__$2 = script$2; +/* template */ + +var __vue_render__$2 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _vm.showControlBar ? _c('div', { + staticClass: "vgt-global-search vgt-clearfix" + }, [_c('div', { + staticClass: "vgt-global-search__input vgt-pull-left" + }, [_vm.searchEnabled ? _c('span', { + staticClass: "input__icon" + }, [_c('div', { + staticClass: "magnifying-glass" + })]) : _vm._e(), _vm._v(" "), _vm.searchEnabled ? _c('input', { + staticClass: "vgt-input vgt-pull-left", + attrs: { + "type": "text", + "placeholder": _vm.globalSearchPlaceholder + }, + domProps: { + "value": _vm.value + }, + on: { + "input": function input($event) { + return _vm.updateValue($event.target.value); + }, + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + return _vm.entered($event.target.value); + } + } + }) : _vm._e()]), _vm._v(" "), _c('div', { + staticClass: "vgt-global-search__actions vgt-pull-right" + }, [_vm._t("internal-table-actions")], 2)]) : _vm._e(); +}; + +var __vue_staticRenderFns__$2 = []; +/* style */ + +var __vue_inject_styles__$2 = undefined; +/* scoped */ + +var __vue_scope_id__$2 = undefined; +/* module identifier */ + +var __vue_module_identifier__$2 = undefined; +/* functional template */ + +var __vue_is_functional_template__$2 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtGlobalSearch = normalizeComponent_1({ + render: __vue_render__$2, + staticRenderFns: __vue_staticRenderFns__$2 +}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, undefined, undefined); + +var script$3 = { + name: 'VgtFilterRow', + props: ['lineNumbers', 'columns', 'typedColumns', 'globalSearchEnabled', 'selectable', 'mode'], + watch: { + columns: { + handler: function handler(newValue, oldValue) { + if (!lodash_isequal(newValue, oldValue)) { + this.populateInitialFilters(); + } + }, + deep: true, + immediate: true + } + }, + data: function data() { + return { + columnFilters: {}, + timer: null + }; + }, + computed: { + // to create a filter row, we need to + // make sure that there is atleast 1 column + // that requires filtering + hasFilterRow: function hasFilterRow() { + // if (this.mode === 'remote' || !this.globalSearchEnabled) { + for (var i = 0; i < this.columns.length; i++) { + var col = this.columns[i]; + + if (col.filterOptions && col.filterOptions.enabled) { + return true; + } + } // } + + + return false; + } + }, + methods: { + reset: function reset() { + var emitEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + this.columnFilters = {}; + + if (emitEvent) { + this.$emit('filter-changed', this.columnFilters); + } + }, + isFilterable: function isFilterable(column) { + return column.filterOptions && column.filterOptions.enabled; + }, + isDropdown: function isDropdown(column) { + return this.isFilterable(column) && column.filterOptions.filterDropdownItems && column.filterOptions.filterDropdownItems.length; + }, + isDropdownObjects: function isDropdownObjects(column) { + return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) === 'object'; + }, + isDropdownArray: function isDropdownArray(column) { + return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) !== 'object'; + }, + // get column's defined placeholder or default one + getPlaceholder: function getPlaceholder(column) { + var placeholder = this.isFilterable(column) && column.filterOptions.placeholder || "Filter ".concat(column.label); + return placeholder; + }, + updateFiltersOnEnter: function updateFiltersOnEnter(column, value) { + if (this.timer) clearTimeout(this.timer); + this.updateFiltersImmediately(column, value); + }, + updateFiltersOnKeyup: function updateFiltersOnKeyup(column, value) { + // if the trigger is enter, we don't filter on keyup + if (column.filterOptions.trigger === 'enter') return; + this.updateFilters(column, value); + }, + // since vue doesn't detect property addition and deletion, we + // need to create helper function to set property etc + updateFilters: function updateFilters(column, value) { + var _this = this; + + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + _this.updateFiltersImmediately(column, value); + }, 400); + }, + updateFiltersImmediately: function updateFiltersImmediately(column, value) { + this.$set(this.columnFilters, column.field, value); + this.$emit('filter-changed', this.columnFilters); + }, + populateInitialFilters: function populateInitialFilters() { + for (var i = 0; i < this.columns.length; i++) { + var col = this.columns[i]; // lets see if there are initial + // filters supplied by user + + if (this.isFilterable(col) && typeof col.filterOptions.filterValue !== 'undefined' && col.filterOptions.filterValue !== null) { + this.$set(this.columnFilters, col.field, col.filterOptions.filterValue); // this.updateFilters(col, col.filterOptions.filterValue); + + this.$set(col.filterOptions, 'filterValue', undefined); + } + } //* lets emit event once all filters are set + + + this.$emit('filter-changed', this.columnFilters); + } + }, + mounted: function mounted() {} +}; + +/* script */ +var __vue_script__$3 = script$3; +/* template */ + +var __vue_render__$3 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _vm.hasFilterRow ? _c('tr', [_vm.lineNumbers ? _c('th') : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th') : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { + return !column.hidden ? _c('th', { + key: index, + staticClass: "filter-th" + }, [_vm.isFilterable(column) ? _c('div', [!_vm.isDropdown(column) ? _c('input', { + staticClass: "vgt-input", + attrs: { + "type": "text", + "placeholder": _vm.getPlaceholder(column) + }, + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + return _vm.updateFiltersOnEnter(column, $event.target.value); + }, + "input": function input($event) { + return _vm.updateFiltersOnKeyup(column, $event.target.value); + } + } + }) : _vm._e(), _vm._v(" "), _vm.isDropdownArray(column) ? _c('select', { + staticClass: "vgt-select", + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "change": function change($event) { + return _vm.updateFilters(column, $event.target.value); + } + } + }, [_c('option', { + key: "-1", + attrs: { + "value": "" + } + }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { + return _c('option', { + key: i, + domProps: { + "value": option + } + }, [_vm._v("\n " + _vm._s(option) + "\n ")]); + })], 2) : _vm._e(), _vm._v(" "), _vm.isDropdownObjects(column) ? _c('select', { + staticClass: "vgt-select", + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "change": function change($event) { + return _vm.updateFilters(column, $event.target.value, true); + } + } + }, [_c('option', { + key: "-1", + attrs: { + "value": "" + } + }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { + return _c('option', { + key: i, + domProps: { + "value": option.value + } + }, [_vm._v(_vm._s(option.text))]); + })], 2) : _vm._e()]) : _vm._e()]) : _vm._e(); + })], 2) : _vm._e(); +}; + +var __vue_staticRenderFns__$3 = []; +/* style */ + +var __vue_inject_styles__$3 = undefined; +/* scoped */ + +var __vue_scope_id__$3 = "data-v-892cc66c"; +/* module identifier */ + +var __vue_module_identifier__$3 = undefined; +/* functional template */ + +var __vue_is_functional_template__$3 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtFilterRow = normalizeComponent_1({ + render: __vue_render__$3, + staticRenderFns: __vue_staticRenderFns__$3 +}, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, undefined, undefined); + +function getNextSort(currentSort) { + if (currentSort === 'asc') return 'desc'; // if (currentSort === 'desc') return null; + + return 'asc'; +} + +function getIndex(sortArray, column) { + for (var i = 0; i < sortArray.length; i++) { + if (column.field === sortArray[i].field) return i; + } + + return -1; +} + +var primarySort = function (sortArray, column) { + if (sortArray.length && sortArray.length === 1 && sortArray[0].field === column.field) { + var type = getNextSort(sortArray[0].type); + + if (type) { + sortArray[0].type = getNextSort(sortArray[0].type); + } else { + sortArray = []; + } + } else { + sortArray = [{ + field: column.field, + type: 'asc' + }]; + } + + return sortArray; +}; + +var secondarySort = function (sortArray, column) { + //* this means that primary sort exists, we're + //* just adding a secondary sort + var index = getIndex(sortArray, column); + + if (index === -1) { + sortArray.push({ + field: column.field, + type: 'asc' + }); + } else { + var type = getNextSort(sortArray[index].type); + + if (type) { + sortArray[index].type = type; + } else { + sortArray.splice(index, 1); + } + } + + return sortArray; +}; + +// +var script$4 = { + name: 'VgtTableHeader', + props: { + lineNumbers: { + "default": false, + type: Boolean + }, + selectable: { + "default": false, + type: Boolean + }, + allSelected: { + "default": false, + type: Boolean + }, + allSelectedIndeterminate: { + "default": false, + type: Boolean + }, + columns: { + type: Array + }, + mode: { + type: String + }, + typedColumns: {}, + //* Sort related + sortable: { + type: Boolean + }, + // sortColumn: { + // type: Number, + // }, + // sortType: { + // type: String, + // }, + // utility functions + // isSortableColumn: { + // type: Function, + // }, + getClasses: { + type: Function + }, + //* search related + searchEnabled: { + type: Boolean + }, + tableRef: {}, + paginated: {} + }, + watch: { + tableRef: { + handler: function handler() { + this.setColumnStyles(); + }, + immediate: true + }, + paginated: { + handler: function handler() { + if (this.tableRef) { + this.setColumnStyles(); + } + }, + deep: true + } + }, + data: function data() { + return { + timer: null, + checkBoxThStyle: {}, + lineNumberThStyle: {}, + columnStyles: [], + sorts: [] + }; + }, + computed: {}, + methods: { + reset: function reset() { + this.$refs['filter-row'].reset(true); + }, + toggleSelectAll: function toggleSelectAll() { + this.$emit('on-toggle-select-all'); + }, + isSortableColumn: function isSortableColumn(column) { + var sortable = column.sortable; + var isSortable = typeof sortable === 'boolean' ? sortable : this.sortable; + return isSortable; + }, + sort: function sort(e, column) { + //* if column is not sortable, return right here + if (!this.isSortableColumn(column)) return; + + if (e.shiftKey) { + this.sorts = secondarySort(this.sorts, column); + } else { + this.sorts = primarySort(this.sorts, column); + } + + this.$emit('on-sort-change', this.sorts); + }, + setInitialSort: function setInitialSort(sorts) { + this.sorts = sorts; + this.$emit('on-sort-change', this.sorts); + }, + getColumnSort: function getColumnSort(column) { + for (var i = 0; i < this.sorts.length; i += 1) { + if (this.sorts[i].field === column.field) { + return this.sorts[i].type || 'asc'; + } + } + + return null; + }, + getHeaderClasses: function getHeaderClasses(column, index) { + var classes = lodash_assign({}, this.getClasses(index, 'th'), { + 'sorting sorting-desc': this.getColumnSort(column) === 'desc', + 'sorting sorting-asc': this.getColumnSort(column) === 'asc' + }); + return classes; + }, + filterRows: function filterRows(columnFilters) { + this.$emit('filter-changed', columnFilters); + }, + getWidthStyle: function getWidthStyle(dom) { + if (window && window.getComputedStyle) { + var cellStyle = window.getComputedStyle(dom, null); + return { + width: cellStyle.width + }; + } + + return { + width: 'auto' + }; + }, + setColumnStyles: function setColumnStyles() { + var _this = this; + + var colStyles = []; + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + for (var i = 0; i < _this.columns.length; i++) { + if (_this.tableRef) { + var skip = 0; + if (_this.selectable) skip++; + if (_this.lineNumbers) skip++; + var cell = _this.tableRef.rows[0].cells[i + skip]; + colStyles.push(_this.getWidthStyle(cell)); + } else { + colStyles.push({ + minWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', + maxWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', + width: _this.columns[i].width ? _this.columns[i].width : 'auto' + }); + } + } + + _this.columnStyles = colStyles; + }, 200); + }, + getColumnStyle: function getColumnStyle(column, index) { + var styleObject = { + minWidth: column.width ? column.width : 'auto', + maxWidth: column.width ? column.width : 'auto', + width: column.width ? column.width : 'auto' + }; //* if fixed header we need to get width from original table + + if (this.tableRef) { + if (this.selectable) index++; + if (this.lineNumbers) index++; + var cell = this.tableRef.rows[0].cells[index]; + var cellStyle = window.getComputedStyle(cell, null); + styleObject.width = cellStyle.width; + } + + return styleObject; + } + }, + mounted: function mounted() { + window.addEventListener('resize', this.setColumnStyles); + }, + beforeDestroy: function beforeDestroy() { + if (this.timer) clearTimeout(this.timer); + window.removeEventListener('resize', this.setColumnStyles); + }, + components: { + 'vgt-filter-row': VgtFilterRow + } +}; + +/* script */ +var __vue_script__$4 = script$4; +/* template */ + +var __vue_render__$4 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('thead', [_c('tr', [_vm.lineNumbers ? _c('th', { + staticClass: "line-numbers" + }) : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th', { + staticClass: "vgt-checkbox-col" + }, [_c('input', { + attrs: { + "type": "checkbox" + }, + domProps: { + "checked": _vm.allSelected, + "indeterminate": _vm.allSelectedIndeterminate + }, + on: { + "change": _vm.toggleSelectAll + } + })]) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { + return !column.hidden ? _c('th', { + key: index, + "class": _vm.getHeaderClasses(column, index), + style: _vm.columnStyles[index], + on: { + "click": function click($event) { + return _vm.sort($event, column); + } + } + }, [_vm._t("table-column", [_c('span', [_vm._v(_vm._s(column.label))])], { + "column": column + })], 2) : _vm._e(); + })], 2), _vm._v(" "), _c("vgt-filter-row", { + ref: "filter-row", + tag: "tr", + attrs: { + "global-search-enabled": _vm.searchEnabled, + "line-numbers": _vm.lineNumbers, + "selectable": _vm.selectable, + "columns": _vm.columns, + "mode": _vm.mode, + "typed-columns": _vm.typedColumns + }, + on: { + "filter-changed": _vm.filterRows + } + })], 1); +}; + +var __vue_staticRenderFns__$4 = []; +/* style */ + +var __vue_inject_styles__$4 = undefined; +/* scoped */ + +var __vue_scope_id__$4 = "data-v-7068df50"; +/* module identifier */ + +var __vue_module_identifier__$4 = undefined; +/* functional template */ + +var __vue_is_functional_template__$4 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtTableHeader = normalizeComponent_1({ + render: __vue_render__$4, + staticRenderFns: __vue_staticRenderFns__$4 +}, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, undefined, undefined); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +var script$5 = { + name: 'VgtHeaderRow', + props: { + headerRow: { + type: Object + }, + columns: { + type: Array + }, + lineNumbers: { + type: Boolean + }, + selectable: { + type: Boolean + }, + collectFormatted: { + type: Function + }, + formattedRow: { + type: Function + }, + getClasses: { + type: Function + }, + fullColspan: { + type: Number + } + }, + data: function data() { + return {}; + }, + computed: {}, + methods: {}, + mounted: function mounted() {}, + components: {} +}; + +/* script */ +var __vue_script__$5 = script$5; +/* template */ + +var __vue_render__$5 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('tr', [_vm.headerRow.mode === 'span' ? _c('th', { + staticClass: "vgt-left-align vgt-row-header", + attrs: { + "colspan": _vm.fullColspan + } + }, [_vm._t("table-header-row", [_vm.headerRow.html ? _c('span', { + domProps: { + "innerHTML": _vm._s(_vm.headerRow.label) + } + }) : _c('span', [_vm._v("\n " + _vm._s(_vm.headerRow.label) + "\n ")])], { + "row": _vm.headerRow + })], 2) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.lineNumbers ? _c('th', { + staticClass: "vgt-row-header" + }) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.selectable ? _c('th', { + staticClass: "vgt-row-header" + }) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, i) { + return _vm.headerRow.mode !== 'span' && !column.hidden ? _c('th', { + key: i, + staticClass: "vgt-row-header", + "class": _vm.getClasses(i, 'td') + }, [_vm._t("table-header-row", [!column.html ? _c('span', [_vm._v("\n " + _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + "\n ")]) : _vm._e(), _vm._v(" "), column.html ? _c('span', { + domProps: { + "innerHTML": _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + } + }) : _vm._e()], { + "row": _vm.headerRow, + "column": column, + "formattedRow": _vm.formattedRow(_vm.headerRow, true) + })], 2) : _vm._e(); + })], 2); +}; + +var __vue_staticRenderFns__$5 = []; +/* style */ + +var __vue_inject_styles__$5 = undefined; +/* scoped */ + +var __vue_scope_id__$5 = undefined; +/* module identifier */ + +var __vue_module_identifier__$5 = undefined; +/* functional template */ + +var __vue_is_functional_template__$5 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtHeaderRow = normalizeComponent_1({ + render: __vue_render__$5, + staticRenderFns: __vue_staticRenderFns__$5 +}, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, undefined, undefined); + +var MILLISECONDS_IN_HOUR = 3600000; +var MILLISECONDS_IN_MINUTE = 60000; +var DEFAULT_ADDITIONAL_DIGITS = 2; + +var patterns = { + dateTimeDelimeter: /[T ]/, + plainTime: /:/, + + // year tokens + YY: /^(\d{2})$/, + YYY: [ + /^([+-]\d{2})$/, // 0 additional digits + /^([+-]\d{3})$/, // 1 additional digit + /^([+-]\d{4})$/ // 2 additional digits + ], + YYYY: /^(\d{4})/, + YYYYY: [ + /^([+-]\d{4})/, // 0 additional digits + /^([+-]\d{5})/, // 1 additional digit + /^([+-]\d{6})/ // 2 additional digits + ], + + // date tokens + MM: /^-(\d{2})$/, + DDD: /^-?(\d{3})$/, + MMDD: /^-?(\d{2})-?(\d{2})$/, + Www: /^-?W(\d{2})$/, + WwwD: /^-?W(\d{2})-?(\d{1})$/, + + HH: /^(\d{2}([.,]\d*)?)$/, + HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/, + HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/, + + // timezone tokens + timezone: /([Z+-].*)$/, + timezoneZ: /^(Z)$/, + timezoneHH: /^([+-])(\d{2})$/, + timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/ +}; + +/** + * @name toDate + * @category Common Helpers + * @summary Convert the given argument to an instance of Date. + * + * @description + * Convert the given argument to an instance of Date. + * + * If the argument is an instance of Date, the function returns its clone. + * + * If the argument is a number, it is treated as a timestamp. + * + * If an argument is a string, the function tries to parse it. + * Function accepts complete ISO 8601 formats as well as partial implementations. + * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 + * + * If the argument is null, it is treated as an invalid date. + * + * If all above fails, the function passes the given argument to Date constructor. + * + * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. + * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined. + * + * @param {*} argument - the value to convert + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format + * @returns {Date} the parsed date in the local time zone + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Convert string '2014-02-11T11:30:30' to date: + * var result = toDate('2014-02-11T11:30:30') + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert string '+02014101' to date, + * // if the additional number of digits in the extended year format is 1: + * var result = toDate('+02014101', {additionalDigits: 1}) + * //=> Fri Apr 11 2014 00:00:00 + */ +function toDate (argument, dirtyOptions) { + if (arguments.length < 1) { + throw new TypeError('1 argument required, but only ' + arguments.length + ' present') + } + + if (argument === null) { + return new Date(NaN) + } + + var options = dirtyOptions || {}; + + var additionalDigits = options.additionalDigits === undefined ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits); + if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { + throw new RangeError('additionalDigits must be 0, 1 or 2') + } + + // Clone the date + if (argument instanceof Date) { + // Prevent the date to lose the milliseconds when passed to new Date() in IE10 + return new Date(argument.getTime()) + } else if (typeof argument !== 'string') { + return new Date(argument) + } + + var dateStrings = splitDateString(argument); + + var parseYearResult = parseYear(dateStrings.date, additionalDigits); + var year = parseYearResult.year; + var restDateString = parseYearResult.restDateString; + + var date = parseDate(restDateString, year); + + if (date) { + var timestamp = date.getTime(); + var time = 0; + var offset; + + if (dateStrings.time) { + time = parseTime(dateStrings.time); + } + + if (dateStrings.timezone) { + offset = parseTimezone(dateStrings.timezone); + } else { + // get offset accurate to hour in timezones that change offset + offset = new Date(timestamp + time).getTimezoneOffset(); + offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset(); + } + + return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) + } else { + return new Date(argument) + } +} + +function splitDateString (dateString) { + var dateStrings = {}; + var array = dateString.split(patterns.dateTimeDelimeter); + var timeString; + + if (patterns.plainTime.test(array[0])) { + dateStrings.date = null; + timeString = array[0]; + } else { + dateStrings.date = array[0]; + timeString = array[1]; + } + + if (timeString) { + var token = patterns.timezone.exec(timeString); + if (token) { + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timezone = token[1]; + } else { + dateStrings.time = timeString; + } + } + + return dateStrings +} + +function parseYear (dateString, additionalDigits) { + var patternYYY = patterns.YYY[additionalDigits]; + var patternYYYYY = patterns.YYYYY[additionalDigits]; + + var token; + + // YYYY or ±YYYYY + token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString); + if (token) { + var yearString = token[1]; + return { + year: parseInt(yearString, 10), + restDateString: dateString.slice(yearString.length) + } + } + + // YY or ±YYY + token = patterns.YY.exec(dateString) || patternYYY.exec(dateString); + if (token) { + var centuryString = token[1]; + return { + year: parseInt(centuryString, 10) * 100, + restDateString: dateString.slice(centuryString.length) + } + } + + // Invalid ISO-formatted year + return { + year: null + } +} + +function parseDate (dateString, year) { + // Invalid ISO-formatted year + if (year === null) { + return null + } + + var token; + var date; + var month; + var week; + + // YYYY + if (dateString.length === 0) { + date = new Date(0); + date.setUTCFullYear(year); + return date + } + + // YYYY-MM + token = patterns.MM.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + date.setUTCFullYear(year, month); + return date + } + + // YYYY-DDD or YYYYDDD + token = patterns.DDD.exec(dateString); + if (token) { + date = new Date(0); + var dayOfYear = parseInt(token[1], 10); + date.setUTCFullYear(year, 0, dayOfYear); + return date + } + + // YYYY-MM-DD or YYYYMMDD + token = patterns.MMDD.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + var day = parseInt(token[2], 10); + date.setUTCFullYear(year, month, day); + return date + } + + // YYYY-Www or YYYYWww + token = patterns.Www.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + return dayOfISOYear(year, week) + } + + // YYYY-Www-D or YYYYWwwD + token = patterns.WwwD.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + var dayOfWeek = parseInt(token[2], 10) - 1; + return dayOfISOYear(year, week, dayOfWeek) + } + + // Invalid ISO-formatted date + return null +} + +function parseTime (timeString) { + var token; + var hours; + var minutes; + + // hh + token = patterns.HH.exec(timeString); + if (token) { + hours = parseFloat(token[1].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + } + + // hh:mm or hhmm + token = patterns.HHMM.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseFloat(token[2].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + } + + // hh:mm:ss or hhmmss + token = patterns.HHMMSS.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseInt(token[2], 10); + var seconds = parseFloat(token[3].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + + seconds * 1000 + } + + // Invalid ISO-formatted time + return null +} + +function parseTimezone (timezoneString) { + var token; + var absoluteOffset; + + // Z + token = patterns.timezoneZ.exec(timezoneString); + if (token) { + return 0 + } + + // ±hh + token = patterns.timezoneHH.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60; + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + // ±hh:mm or ±hhmm + token = patterns.timezoneHHMM.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10); + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + return 0 +} + +function dayOfISOYear (isoYear, week, day) { + week = week || 0; + day = day || 0; + var date = new Date(0); + date.setUTCFullYear(isoYear, 0, 4); + var fourthOfJanuaryDay = date.getUTCDay() || 7; + var diff = week * 7 + day + 1 - fourthOfJanuaryDay; + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +/** + * @name addMilliseconds + * @category Millisecond Helpers + * @summary Add the specified number of milliseconds to the given date. + * + * @description + * Add the specified number of milliseconds to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of milliseconds to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the milliseconds added + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 750 milliseconds to 10 July 2014 12:45:30.000: + * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) + * //=> Thu Jul 10 2014 12:45:30.750 + */ +function addMilliseconds (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var timestamp = toDate(dirtyDate, dirtyOptions).getTime(); + var amount = Number(dirtyAmount); + return new Date(timestamp + amount) +} + +function cloneObject (dirtyObject) { + dirtyObject = dirtyObject || {}; + var object = {}; + + for (var property in dirtyObject) { + if (dirtyObject.hasOwnProperty(property)) { + object[property] = dirtyObject[property]; + } + } + + return object +} + +var MILLISECONDS_IN_MINUTE$1 = 60000; + +/** + * @name addMinutes + * @category Minute Helpers + * @summary Add the specified number of minutes to the given date. + * + * @description + * Add the specified number of minutes to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the minutes added + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 30 minutes to 10 July 2014 12:00:00: + * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 12:30:00 + */ +function addMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var amount = Number(dirtyAmount); + return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE$1, dirtyOptions) +} + +/** + * @name compareAsc + * @category Common Helpers + * @summary Compare the two dates and return -1, 0 or 1. + * + * @description + * Compare the two dates and return 1 if the first date is after the second, + * -1 if the first date is before the second or 0 if dates are equal. + * + * @param {Date|String|Number} dateLeft - the first date to compare + * @param {Date|String|Number} dateRight - the second date to compare + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Number} the result of the comparison + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Compare 11 February 1987 and 10 July 1989: + * var result = compareAsc( + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ) + * //=> -1 + * + * @example + * // Sort the array of dates: + * var result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareAsc) + * //=> [ + * // Wed Feb 11 1987 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Sun Jul 02 1995 00:00:00 + * // ] + */ +function compareAsc (dirtyDateLeft, dirtyDateRight, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var dateLeft = toDate(dirtyDateLeft, dirtyOptions); + var dateRight = toDate(dirtyDateRight, dirtyOptions); + + var diff = dateLeft.getTime() - dateRight.getTime(); + + if (diff < 0) { + return -1 + } else if (diff > 0) { + return 1 + // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff + } +} + +/** + * @name isValid + * @category Common Helpers + * @summary Is the given date valid? + * + * @description + * Returns false if argument is Invalid Date and true otherwise. + * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * Invalid Date is a Date, whose time value is NaN. + * + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {*} date - the date to check + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Boolean} the date is valid + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // For the valid date: + * var result = isValid(new Date(2014, 1, 31)) + * //=> true + * + * @example + * // For the value, convertable into a date: + * var result = isValid('2014-02-31') + * //=> true + * + * @example + * // For the invalid date: + * var result = isValid(new Date('')) + * //=> false + */ +function isValid (dirtyDate, dirtyOptions) { + if (arguments.length < 1) { + throw new TypeError('1 argument required, but only ' + arguments.length + ' present') + } + + var date = toDate(dirtyDate, dirtyOptions); + return !isNaN(date) +} + +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'less than a second', + other: 'less than {{count}} seconds' + }, + + xSeconds: { + one: '1 second', + other: '{{count}} seconds' + }, + + halfAMinute: 'half a minute', + + lessThanXMinutes: { + one: 'less than a minute', + other: 'less than {{count}} minutes' + }, + + xMinutes: { + one: '1 minute', + other: '{{count}} minutes' + }, + + aboutXHours: { + one: 'about 1 hour', + other: 'about {{count}} hours' + }, + + xHours: { + one: '1 hour', + other: '{{count}} hours' + }, + + xDays: { + one: '1 day', + other: '{{count}} days' + }, - return "".concat(first, " - ").concat(last, " ").concat(this.ofText, " ").concat(this.total); - }, - // Can go to next page - nextIsPossible: function nextIsPossible() { - return this.currentPage < this.pagesCount; - }, - // Can go to previous page - prevIsPossible: function prevIsPossible() { - return this.currentPage > 1; + aboutXMonths: { + one: 'about 1 month', + other: 'about {{count}} months' + }, + + xMonths: { + one: '1 month', + other: '{{count}} months' + }, + + aboutXYears: { + one: 'about 1 year', + other: 'about {{count}} years' + }, + + xYears: { + one: '1 year', + other: '{{count}} years' + }, + + overXYears: { + one: 'over 1 year', + other: 'over {{count}} years' + }, + + almostXYears: { + one: 'almost 1 year', + other: 'almost {{count}} years' + } +}; + +function formatDistance (token, count, options) { + options = options || {}; + + var result; + if (typeof formatDistanceLocale[token] === 'string') { + result = formatDistanceLocale[token]; + } else if (count === 1) { + result = formatDistanceLocale[token].one; + } else { + result = formatDistanceLocale[token].other.replace('{{count}}', count); + } + + if (options.addSuffix) { + if (options.comparison > 0) { + return 'in ' + result + } else { + return result + ' ago' + } + } + + return result +} + +var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; + +function buildShortLongFormat (format) { + return format.replace(tokensToBeShortedPattern, function (token) { + return token.slice(1) + }) +} + +/** + * @name buildFormatLongFn + * @category Locale Helpers + * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * + * @description + * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * Returns a function which takes one of the following tokens as the argument: + * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` + * and returns a long format string written as `format` token strings. + * See [format]{@link https://date-fns.org/docs/format} + * + * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically + * by shortening some of the tokens from corresponding unshortened formats + * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) + * + * @param {Object} obj - the object with long formats written as `format` token strings + * @param {String} obj.LT - time format: hours and minutes + * @param {String} obj.LTS - time format: hours, minutes and seconds + * @param {String} obj.L - short date format: numeric day, month and year + * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) + * @param {String} obj.LL - long date format: day, month in words, and year + * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) + * @param {String} obj.LLL - long date and time format + * @param {String} [obj.lll] - long date and time format (shortened) + * @param {String} obj.LLLL - long date, time and weekday format + * @param {String} [obj.llll] - long date, time and weekday format (shortened) + * @returns {Function} `formatLong` property of the locale + * + * @example + * // For `en-US` locale: + * locale.formatLong = buildFormatLongFn({ + * LT: 'h:mm aa', + * LTS: 'h:mm:ss aa', + * L: 'MM/DD/YYYY', + * LL: 'MMMM D YYYY', + * LLL: 'MMMM D YYYY h:mm aa', + * LLLL: 'dddd, MMMM D YYYY h:mm aa' + * }) + */ +function buildFormatLongFn (obj) { + var formatLongLocale = { + LTS: obj.LTS, + LT: obj.LT, + L: obj.L, + LL: obj.LL, + LLL: obj.LLL, + LLLL: obj.LLLL, + l: obj.l || buildShortLongFormat(obj.L), + ll: obj.ll || buildShortLongFormat(obj.LL), + lll: obj.lll || buildShortLongFormat(obj.LLL), + llll: obj.llll || buildShortLongFormat(obj.LLLL) + }; + + return function (token) { + return formatLongLocale[token] + } +} + +var formatLong = buildFormatLongFn({ + LT: 'h:mm aa', + LTS: 'h:mm:ss aa', + L: 'MM/DD/YYYY', + LL: 'MMMM D YYYY', + LLL: 'MMMM D YYYY h:mm aa', + LLLL: 'dddd, MMMM D YYYY h:mm aa' +}); + +var formatRelativeLocale = { + lastWeek: '[last] dddd [at] LT', + yesterday: '[yesterday at] LT', + today: '[today at] LT', + tomorrow: '[tomorrow at] LT', + nextWeek: 'dddd [at] LT', + other: 'L' +}; + +function formatRelative (token, date, baseDate, options) { + return formatRelativeLocale[token] +} + +/** + * @name buildLocalizeFn + * @category Locale Helpers + * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. + * + * @description + * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale + * used by `format` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * `localize.weekday` function takes the weekday index as argument (0 - Sunday). + * `localize.month` takes the month index (0 - January). + * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @param {Function} [indexCallback] - the callback which takes the resulting function argument + * and converts it into value array index + * @returns {Function} the resulting function + * + * @example + * var timeOfDayValues = { + * uppercase: ['AM', 'PM'], + * lowercase: ['am', 'pm'], + * long: ['a.m.', 'p.m.'] + * } + * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + * // 0 is a.m. array index, 1 is p.m. array index + * return (hours / 12) >= 1 ? 1 : 0 + * }) + * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' + * locale.localize.timeOfDay(5) //=> 'a.m.' + */ +function buildLocalizeFn (values, defaultType, indexCallback) { + return function (dirtyIndex, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var valuesArray = values[type] || values[defaultType]; + var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); + return valuesArray[index] + } +} + +/** + * @name buildLocalizeArrayFn + * @category Locale Helpers + * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * + * @description + * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @returns {Function} the resulting function + * + * @example + * var weekdayValues = { + * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] + * } + * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') + * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] + * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] + */ +function buildLocalizeArrayFn (values, defaultType) { + return function (dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + return values[type] || values[defaultType] + } +} + +// Note: in English, the names of days of the week and months are capitalized. +// If you are making a new locale based on this one, check if the same is true for the language you're working on. +// Generally, formatted dates should look like they are in the middle of a sentence, +// e.g. in Spanish language the weekdays and months should be in the lowercase. +var weekdayValues = { + narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] +}; + +var monthValues = { + short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var timeOfDayValues = { +// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] +// } +// +// And later: +// +// var localize = { +// // The callback takes the hours as the argument and returns the array index +// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { +// if (hours >= 17) { +// return 3 +// } else if (hours >= 12) { +// return 2 +// } else if (hours >= 4) { +// return 1 +// } else { +// return 0 +// } +// }), +// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') +// } +var timeOfDayValues = { + uppercase: ['AM', 'PM'], + lowercase: ['am', 'pm'], + long: ['a.m.', 'p.m.'] +}; + +function ordinalNumber (dirtyNumber, dirtyOptions) { + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`: + // + // var options = dirtyOptions || {} + // var unit = String(options.unit) + // + // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', + // 'dayOfMonth' or 'dayOfWeek' + + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + 'st' + case 2: + return number + 'nd' + case 3: + return number + 'rd' + } + } + return number + 'th' +} + +var localize = { + ordinalNumber: ordinalNumber, + weekday: buildLocalizeFn(weekdayValues, 'long'), + weekdays: buildLocalizeArrayFn(weekdayValues, 'long'), + month: buildLocalizeFn(monthValues, 'long'), + months: buildLocalizeArrayFn(monthValues, 'long'), + timeOfDay: buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + return (hours / 12) >= 1 ? 1 : 0 + }), + timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'long') +}; + +/** + * @name buildMatchFn + * @category Locale Helpers + * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. + * + * @description + * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * The result of the match function will be passed into corresponding parser function + * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). + * + * @param {Object} values - the object with RegExps + * @param {String} defaultType - the default type for the match function + * @returns {Function} the resulting function + * + * @example + * var matchWeekdaysPatterns = { + * narrow: /^(su|mo|tu|we|th|fr|sa)/i, + * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i + * } + * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') + * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] + * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] + */ +function buildMatchFn (patterns, defaultType) { + return function (dirtyString, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var pattern = patterns[type] || patterns[defaultType]; + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name buildParseFn + * @category Locale Helpers + * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. + * + * @description + * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. + * The argument of the resulting function is the result of the corresponding match function + * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). + * + * @param {Object} values - the object with arrays of RegExps + * @param {String} defaultType - the default type for the parser function + * @returns {Function} the resulting function + * + * @example + * var parseWeekdayPatterns = { + * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] + * } + * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') + * var matchResult = locale.match.weekdays('Friday') + * locale.match.weekday(matchResult) //=> 5 + */ +function buildParseFn (patterns, defaultType) { + return function (matchResult, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var patternsArray = patterns[type] || patterns[defaultType]; + var string = matchResult[1]; + + return patternsArray.findIndex(function (pattern) { + return pattern.test(string) + }) + } +} + +/** + * @name buildMatchPatternFn + * @category Locale Helpers + * @summary Build match function from a single RegExp. + * + * @description + * Build match function from a single RegExp. + * Usually used for building `match.ordinalNumbers` property of the locale. + * + * @param {Object} pattern - the RegExp + * @returns {Function} the resulting function + * + * @example + * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) + * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] + */ +function buildMatchPatternFn (pattern) { + return function (dirtyString) { + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name parseDecimal + * @category Locale Helpers + * @summary Parses the match result into decimal number. + * + * @description + * Parses the match result into decimal number. + * Uses the string matched with the first set of parentheses of match RegExp. + * + * @param {Array} matchResult - the object returned by matching function + * @returns {Number} the parsed value + * + * @example + * locale.match = { + * ordinalNumbers: (dirtyString) { + * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) + * }, + * ordinalNumber: parseDecimal + * } + */ +function parseDecimal (matchResult) { + return parseInt(matchResult[1], 10) +} + +var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; + +var matchWeekdaysPatterns = { + narrow: /^(su|mo|tu|we|th|fr|sa)/i, + short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i +}; + +var parseWeekdayPatterns = { + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] +}; + +var matchMonthsPatterns = { + short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i +}; + +var parseMonthPatterns = { + any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var matchTimesOfDayPatterns = { +// long: /^((in the)? (night|morning|afternoon|evening?))/i +// } +// +// var parseTimeOfDayPatterns = { +// any: [/(night|morning)/i, /(afternoon|evening)/i] +// } +var matchTimesOfDayPatterns = { + short: /^(am|pm)/i, + long: /^([ap]\.?\s?m\.?)/i +}; + +var parseTimeOfDayPatterns = { + any: [/^a/i, /^p/i] +}; + +var match = { + ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern), + ordinalNumber: parseDecimal, + weekdays: buildMatchFn(matchWeekdaysPatterns, 'long'), + weekday: buildParseFn(parseWeekdayPatterns, 'any'), + months: buildMatchFn(matchMonthsPatterns, 'long'), + month: buildParseFn(parseMonthPatterns, 'any'), + timesOfDay: buildMatchFn(matchTimesOfDayPatterns, 'long'), + timeOfDay: buildParseFn(parseTimeOfDayPatterns, 'any') +}; + +/** + * @type {Locale} + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + */ +var locale = { + formatDistance: formatDistance, + formatLong: formatLong, + formatRelative: formatRelative, + localize: localize, + match: match, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1 + } +}; + +var MILLISECONDS_IN_DAY = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCDayOfYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var timestamp = date.getTime(); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + var startOfYearTimestamp = date.getTime(); + var difference = timestamp - startOfYearTimestamp; + return Math.floor(difference / MILLISECONDS_IN_DAY) + 1 +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeek (dirtyDate, dirtyOptions) { + var weekStartsOn = 1; + + var date = toDate(dirtyDate, dirtyOptions); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeekYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var year = date.getUTCFullYear(); + + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear, dirtyOptions); + + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear, dirtyOptions); + + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1 + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year + } else { + return year - 1 + } +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeekYear (dirtyDate, dirtyOptions) { + var year = getUTCISOWeekYear(dirtyDate, dirtyOptions); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(year, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + var date = startOfUTCISOWeek(fourthOfJanuary, dirtyOptions); + return date +} + +var MILLISECONDS_IN_WEEK = 604800000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeek (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var diff = startOfUTCISOWeek(date, dirtyOptions).getTime() - startOfUTCISOWeekYear(date, dirtyOptions).getTime(); + + // Round the number of days to the nearest integer + // because the number of milliseconds in a week is not constant + // (e.g. it's different in the week of the daylight saving time clock shift) + return Math.round(diff / MILLISECONDS_IN_WEEK) + 1 +} + +var formatters = { + // Month: 1, 2, ..., 12 + 'M': function (date) { + return date.getUTCMonth() + 1 + }, + + // Month: 1st, 2nd, ..., 12th + 'Mo': function (date, options) { + var month = date.getUTCMonth() + 1; + return options.locale.localize.ordinalNumber(month, {unit: 'month'}) + }, + + // Month: 01, 02, ..., 12 + 'MM': function (date) { + return addLeadingZeros(date.getUTCMonth() + 1, 2) + }, + + // Month: Jan, Feb, ..., Dec + 'MMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'short'}) + }, + + // Month: January, February, ..., December + 'MMMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'long'}) + }, + + // Quarter: 1, 2, 3, 4 + 'Q': function (date) { + return Math.ceil((date.getUTCMonth() + 1) / 3) + }, + + // Quarter: 1st, 2nd, 3rd, 4th + 'Qo': function (date, options) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + return options.locale.localize.ordinalNumber(quarter, {unit: 'quarter'}) + }, + + // Day of month: 1, 2, ..., 31 + 'D': function (date) { + return date.getUTCDate() + }, + + // Day of month: 1st, 2nd, ..., 31st + 'Do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDate(), {unit: 'dayOfMonth'}) + }, + + // Day of month: 01, 02, ..., 31 + 'DD': function (date) { + return addLeadingZeros(date.getUTCDate(), 2) + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': function (date) { + return getUTCDayOfYear(date) + }, + + // Day of year: 1st, 2nd, ..., 366th + 'DDDo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCDayOfYear(date), {unit: 'dayOfYear'}) + }, + + // Day of year: 001, 002, ..., 366 + 'DDDD': function (date) { + return addLeadingZeros(getUTCDayOfYear(date), 3) + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'narrow'}) + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'short'}) + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'long'}) + }, + + // Day of week: 0, 1, ..., 6 + 'd': function (date) { + return date.getUTCDay() + }, + + // Day of week: 0th, 1st, 2nd, ..., 6th + 'do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDay(), {unit: 'dayOfWeek'}) + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': function (date) { + return date.getUTCDay() || 7 + }, + + // ISO week: 1, 2, ..., 53 + 'W': function (date) { + return getUTCISOWeek(date) + }, + + // ISO week: 1st, 2nd, ..., 53th + 'Wo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCISOWeek(date), {unit: 'isoWeek'}) + }, + + // ISO week: 01, 02, ..., 53 + 'WW': function (date) { + return addLeadingZeros(getUTCISOWeek(date), 2) + }, + + // Year: 00, 01, ..., 99 + 'YY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4).substr(2) + }, + + // Year: 1900, 1901, ..., 2099 + 'YYYY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4) + }, + + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': function (date) { + return String(getUTCISOWeekYear(date)).substr(2) + }, + + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': function (date) { + return getUTCISOWeekYear(date) + }, + + // Hour: 0, 1, ... 23 + 'H': function (date) { + return date.getUTCHours() + }, + + // Hour: 00, 01, ..., 23 + 'HH': function (date) { + return addLeadingZeros(date.getUTCHours(), 2) + }, + + // Hour: 1, 2, ..., 12 + 'h': function (date) { + var hours = date.getUTCHours(); + if (hours === 0) { + return 12 + } else if (hours > 12) { + return hours % 12 + } else { + return hours } }, - methods: { - // Change current page - changePage: function changePage(pageNumber) { - var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) { - this.prevPage = this.currentPage; - this.currentPage = pageNumber; - if (emit) this.pageChanged(); - } - }, - // Go to next page - nextPage: function nextPage() { - if (this.nextIsPossible) { - this.prevPage = this.currentPage; - ++this.currentPage; - this.pageChanged(); - } - }, - // Go to previous page - previousPage: function previousPage() { - if (this.prevIsPossible) { - this.prevPage = this.currentPage; - --this.currentPage; - this.pageChanged(); - } - }, - // Indicate page changing - pageChanged: function pageChanged() { - this.$emit('page-changed', { - currentPage: this.currentPage, - prevPage: this.prevPage - }); - }, - // Indicate per page changing - perPageChanged: function perPageChanged() { - // go back to first page - this.$emit('per-page-changed', { - currentPerPage: this.currentPerPage - }); - this.changePage(1, false); - }, - // Handle per page changing - handlePerPage: function handlePerPage() { - //* if there's a custom dropdown then we use that - if (this.customRowsPerPageDropdown !== null && Array.isArray(this.customRowsPerPageDropdown) && this.customRowsPerPageDropdown.length !== 0) { - this.rowsPerPageOptions = this.customRowsPerPageDropdown; - } else { - //* otherwise we use the default rows per page dropdown - this.rowsPerPageOptions = cloneDeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN); - } + // Hour: 01, 02, ..., 12 + 'hh': function (date) { + return addLeadingZeros(formatters['h'](date), 2) + }, + + // Minute: 0, 1, ..., 59 + 'm': function (date) { + return date.getUTCMinutes() + }, + + // Minute: 00, 01, ..., 59 + 'mm': function (date) { + return addLeadingZeros(date.getUTCMinutes(), 2) + }, + + // Second: 0, 1, ..., 59 + 's': function (date) { + return date.getUTCSeconds() + }, + + // Second: 00, 01, ..., 59 + 'ss': function (date) { + return addLeadingZeros(date.getUTCSeconds(), 2) + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': function (date) { + return Math.floor(date.getUTCMilliseconds() / 100) + }, + + // 1/100 of second: 00, 01, ..., 99 + 'SS': function (date) { + return addLeadingZeros(Math.floor(date.getUTCMilliseconds() / 10), 2) + }, + + // Millisecond: 000, 001, ..., 999 + 'SSS': function (date) { + return addLeadingZeros(date.getUTCMilliseconds(), 3) + }, + + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset(), ':') + }, - if (this.perPage) { - this.currentPerPage = this.perPage; // if perPage doesn't already exist, we add it + // Timezone: -0100, +0000, ... +1200 + 'ZZ': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset()) + }, - var found = false; + // Seconds timestamp: 512969520 + 'X': function (date, options) { + var originalDate = options._originalDate || date; + return Math.floor(originalDate.getTime() / 1000) + }, - for (var i = 0; i < this.rowsPerPageOptions.length; i++) { - if (this.rowsPerPageOptions[i] === this.perPage) { - found = true; - } - } + // Milliseconds timestamp: 512969520900 + 'x': function (date, options) { + var originalDate = options._originalDate || date; + return originalDate.getTime() + }, - if (!found && this.perPage !== -1) { - this.rowsPerPageOptions.unshift(this.perPage); - } - } else { - // reset to default - this.currentPerPage = 10; - } - } + // AM, PM + 'A': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'uppercase'}) }, - mounted: function mounted() {}, - components: { - 'pagination-page-info': VgtPaginationPageInfo + + // am, pm + 'a': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'lowercase'}) + }, + + // a.m., p.m. + 'aa': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'long'}) } }; -/* script */ -var __vue_script__$1 = script$1; -/* template */ - -var __vue_render__$1 = function __vue_render__() { - var _vm = this; +function formatTimezone (offset, delimeter) { + delimeter = delimeter || ''; + var sign = offset > 0 ? '-' : '+'; + var absOffset = Math.abs(offset); + var hours = Math.floor(absOffset / 60); + var minutes = absOffset % 60; + return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) +} - var _h = _vm.$createElement; +function addLeadingZeros (number, targetLength) { + var output = Math.abs(number).toString(); + while (output.length < targetLength) { + output = '0' + output; + } + return output +} - var _c = _vm._self._c || _h; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function addUTCMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var amount = Number(dirtyAmount); + date.setUTCMinutes(date.getUTCMinutes() + amount); + return date +} - return _c('div', { - staticClass: "vgt-wrap__footer vgt-clearfix" - }, [_c('div', { - staticClass: "footer__row-count vgt-pull-left" - }, [_c('span', { - staticClass: "footer__row-count__label" - }, [_vm._v(_vm._s(_vm.rowsPerPageText))]), _vm._v(" "), _c('select', { - directives: [{ - name: "model", - rawName: "v-model", - value: _vm.currentPerPage, - expression: "currentPerPage" - }], - staticClass: "footer__row-count__select", - attrs: { - "autocomplete": "off", - "name": "perPageSelect" - }, - on: { - "change": [function ($event) { - var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) { - return o.selected; - }).map(function (o) { - var val = "_value" in o ? o._value : o.value; - return val; - }); - _vm.currentPerPage = $event.target.multiple ? $$selectedVal : $$selectedVal[0]; - }, _vm.perPageChanged] - } - }, [_vm._l(_vm.rowsPerPageOptions, function (option, idx) { - return _c('option', { - key: 'rows-dropdown-option-' + idx, - domProps: { - "value": option - } - }, [_vm._v("\n " + _vm._s(option) + "\n ")]); - }), _vm._v(" "), _vm.paginateDropdownAllowAll ? _c('option', { - domProps: { - "value": _vm.total - } - }, [_vm._v(_vm._s(_vm.allText))]) : _vm._e()], 2)]), _vm._v(" "), _c('div', { - staticClass: "footer__navigation vgt-pull-right" - }, [_c('a', { - staticClass: "footer__navigation__page-btn", - "class": { - disabled: !_vm.prevIsPossible - }, - attrs: { - "href": "javascript:undefined", - "tabindex": "0" - }, - on: { - "click": function click($event) { - $event.preventDefault(); - $event.stopPropagation(); - return _vm.previousPage($event); - } - } - }, [_c('span', { - staticClass: "chevron", - "class": { - 'left': !_vm.rtl, - 'right': _vm.rtl - } - }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _vm.mode === 'pages' ? _c('pagination-page-info', { - attrs: { - "totalRecords": _vm.total, - "lastPage": _vm.pagesCount, - "currentPage": _vm.currentPage, - "ofText": _vm.ofText, - "pageText": _vm.pageText - }, - on: { - "page-changed": _vm.changePage - } - }) : _c('div', { - staticClass: "footer__navigation__info" - }, [_vm._v(_vm._s(_vm.paginatedInfo))]), _vm._v(" "), _c('a', { - staticClass: "footer__navigation__page-btn", - "class": { - disabled: !_vm.nextIsPossible - }, - attrs: { - "href": "javascript:undefined", - "tabindex": "0" - }, - on: { - "click": function click($event) { - $event.preventDefault(); - $event.stopPropagation(); - return _vm.nextPage($event); - } - } - }, [_c('span', [_vm._v(_vm._s(_vm.nextText))]), _vm._v(" "), _c('span', { - staticClass: "chevron", - "class": { - 'right': !_vm.rtl, - 'left': _vm.rtl - } - })])], 1)]); -}; +var longFormattingTokensRegExp = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultFormattingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; -var __vue_staticRenderFns__$1 = []; -/* style */ +/** + * @name format + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. + * + * Accepted tokens: + * | Unit | Token | Result examples | + * |-------------------------|-------|----------------------------------| + * | Month | M | 1, 2, ..., 12 | + * | | Mo | 1st, 2nd, ..., 12th | + * | | MM | 01, 02, ..., 12 | + * | | MMM | Jan, Feb, ..., Dec | + * | | MMMM | January, February, ..., December | + * | Quarter | Q | 1, 2, 3, 4 | + * | | Qo | 1st, 2nd, 3rd, 4th | + * | Day of month | D | 1, 2, ..., 31 | + * | | Do | 1st, 2nd, ..., 31st | + * | | DD | 01, 02, ..., 31 | + * | Day of year | DDD | 1, 2, ..., 366 | + * | | DDDo | 1st, 2nd, ..., 366th | + * | | DDDD | 001, 002, ..., 366 | + * | Day of week | d | 0, 1, ..., 6 | + * | | do | 0th, 1st, ..., 6th | + * | | dd | Su, Mo, ..., Sa | + * | | ddd | Sun, Mon, ..., Sat | + * | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | E | 1, 2, ..., 7 | + * | ISO week | W | 1, 2, ..., 53 | + * | | Wo | 1st, 2nd, ..., 53rd | + * | | WW | 01, 02, ..., 53 | + * | Year | YY | 00, 01, ..., 99 | + * | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | GG | 00, 01, ..., 99 | + * | | GGGG | 1900, 1901, ..., 2099 | + * | AM/PM | A | AM, PM | + * | | a | am, pm | + * | | aa | a.m., p.m. | + * | Hour | H | 0, 1, ... 23 | + * | | HH | 00, 01, ... 23 | + * | | h | 1, 2, ..., 12 | + * | | hh | 01, 02, ..., 12 | + * | Minute | m | 0, 1, ..., 59 | + * | | mm | 00, 01, ..., 59 | + * | Second | s | 0, 1, ..., 59 | + * | | ss | 00, 01, ..., 59 | + * | 1/10 of second | S | 0, 1, ..., 9 | + * | 1/100 of second | SS | 00, 01, ..., 99 | + * | Millisecond | SSS | 000, 001, ..., 999 | + * | Timezone | Z | -01:00, +00:00, ... +12:00 | + * | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | X | 512969520 | + * | Milliseconds timestamp | x | 512969520900 | + * | Long format | LT | 05:30 a.m. | + * | | LTS | 05:30:15 a.m. | + * | | L | 07/02/1995 | + * | | l | 7/2/1995 | + * | | LL | July 2 1995 | + * | | ll | Jul 2 1995 | + * | | LLL | July 2 1995 05:30 a.m. | + * | | lll | Jul 2 1995 05:30 a.m. | + * | | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets are escaped. + * + * The result may vary by locale. + * + * @param {Date|String|Number} date - the original date + * @param {String} format - the string of tokens + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the formatted date string + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.locale` must contain `localize` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Represent 11 February 2014 in middle-endian format: + * var result = format( + * new Date(2014, 1, 11), + * 'MM/DD/YYYY' + * ) + * //=> '02/11/2014' + * + * @example + * // Represent 2 July 2014 in Esperanto: + * import { eoLocale } from 'date-fns/locale/eo' + * var result = format( + * new Date(2014, 6, 2), + * 'Do [de] MMMM YYYY', + * {locale: eoLocale} + * ) + * //=> '2-a de julio 2014' + */ +function format (dirtyDate, dirtyFormatStr, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } -var __vue_inject_styles__$1 = undefined; -/* scoped */ + var formatStr = String(dirtyFormatStr); + var options = dirtyOptions || {}; -var __vue_scope_id__$1 = undefined; -/* module identifier */ + var locale$1 = options.locale || locale; -var __vue_module_identifier__$1 = undefined; -/* functional template */ + if (!locale$1.localize) { + throw new RangeError('locale must contain localize property') + } -var __vue_is_functional_template__$1 = false; -/* style inject */ + if (!locale$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } -/* style inject SSR */ + var localeFormatters = locale$1.formatters || {}; + var formattingTokensRegExp = locale$1.formattingTokensRegExp || defaultFormattingTokensRegExp; + var formatLong = locale$1.formatLong; -var VgtPagination = __vue_normalize__({ - render: __vue_render__$1, - staticRenderFns: __vue_staticRenderFns__$1 -}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, undefined, undefined); + var originalDate = toDate(dirtyDate, options); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -var script$2 = { - name: 'VgtGlobalSearch', - props: ['value', 'searchEnabled', 'globalSearchPlaceholder'], - data: function data() { - return { - globalSearchTerm: null - }; - }, - computed: { - showControlBar: function showControlBar() { - if (this.searchEnabled) return true; - if (this.$slots && this.$slots['internal-table-actions']) return true; - return false; - } - }, - methods: { - updateValue: function updateValue(value) { - this.$emit('input', value); - this.$emit('on-keyup', value); - }, - entered: function entered(value) { - this.$emit('on-enter', value); - } + if (!isValid(originalDate, options)) { + return 'Invalid Date' } -}; -/* script */ -var __vue_script__$2 = script$2; -/* template */ + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 + var timezoneOffset = originalDate.getTimezoneOffset(); + var utcDate = addUTCMinutes(originalDate, -timezoneOffset, options); + + var formatterOptions = cloneObject(options); + formatterOptions.locale = locale$1; + formatterOptions.formatters = formatters; + + // When UTC functions will be implemented, options._originalDate will likely be a part of public API. + // Right now, please don't use it in locales. If you have to use an original date, + // please restore it from `date`, adding a timezone offset to it. + formatterOptions._originalDate = originalDate; + + var result = formatStr + .replace(longFormattingTokensRegExp, function (substring) { + if (substring[0] === '[') { + return substring + } -var __vue_render__$2 = function __vue_render__() { - var _vm = this; + if (substring[0] === '\\') { + return cleanEscapedString(substring) + } - var _h = _vm.$createElement; + return formatLong(substring) + }) + .replace(formattingTokensRegExp, function (substring) { + var formatter = localeFormatters[substring] || formatters[substring]; - var _c = _vm._self._c || _h; + if (formatter) { + return formatter(utcDate, formatterOptions) + } else { + return cleanEscapedString(substring) + } + }); - return _vm.showControlBar ? _c('div', { - staticClass: "vgt-global-search vgt-clearfix" - }, [_c('div', { - staticClass: "vgt-global-search__input vgt-pull-left" - }, [_vm.searchEnabled ? _c('span', { - staticClass: "input__icon" - }, [_c('div', { - staticClass: "magnifying-glass" - })]) : _vm._e(), _vm._v(" "), _vm.searchEnabled ? _c('input', { - staticClass: "vgt-input vgt-pull-left", - attrs: { - "type": "text", - "placeholder": _vm.globalSearchPlaceholder - }, - domProps: { - "value": _vm.value - }, - on: { - "input": function input($event) { - return _vm.updateValue($event.target.value); - }, - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } + return result +} - return _vm.entered($event.target.value); - } - } - }) : _vm._e()]), _vm._v(" "), _c('div', { - staticClass: "vgt-global-search__actions vgt-pull-right" - }, [_vm._t("internal-table-actions")], 2)]) : _vm._e(); -}; +function cleanEscapedString (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} + +/** + * @name subMinutes + * @category Minute Helpers + * @summary Subtract the specified number of minutes from the given date. + * + * @description + * Subtract the specified number of minutes from the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be subtracted + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the mintues subtracted + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Subtract 30 minutes from 10 July 2014 12:00:00: + * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 11:30:00 + */ +function subMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var amount = Number(dirtyAmount); + return addMinutes(dirtyDate, -amount, dirtyOptions) +} -var __vue_staticRenderFns__$2 = []; -/* style */ +var patterns$1 = { + 'M': /^(1[0-2]|0?\d)/, // 0 to 12 + 'D': /^(3[0-1]|[0-2]?\d)/, // 0 to 31 + 'DDD': /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 + 'W': /^(5[0-3]|[0-4]?\d)/, // 0 to 53 + 'YYYY': /^(\d{1,4})/, // 0 to 9999 + 'H': /^(2[0-3]|[0-1]?\d)/, // 0 to 23 + 'm': /^([0-5]?\d)/, // 0 to 59 + 'Z': /^([+-])(\d{2}):(\d{2})/, + 'ZZ': /^([+-])(\d{2})(\d{2})/, + singleDigit: /^(\d)/, + twoDigits: /^(\d{2})/, + threeDigits: /^(\d{3})/, + fourDigits: /^(\d{4})/, + anyDigits: /^(\d+)/ +}; -var __vue_inject_styles__$2 = undefined; -/* scoped */ +function parseDecimal$1 (matchResult) { + return parseInt(matchResult[1], 10) +} -var __vue_scope_id__$2 = undefined; -/* module identifier */ +var parsers = { + // Year: 00, 01, ..., 99 + 'YY': { + unit: 'twoDigitYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, -var __vue_module_identifier__$2 = undefined; -/* functional template */ + // Year: 1900, 1901, ..., 2099 + 'YYYY': { + unit: 'year', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, -var __vue_is_functional_template__$2 = false; -/* style inject */ + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': { + unit: 'isoYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + 1900 + } + }, -/* style inject SSR */ + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': { + unit: 'isoYear', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, -var VgtGlobalSearch = __vue_normalize__({ - render: __vue_render__$2, - staticRenderFns: __vue_staticRenderFns__$2 -}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, undefined, undefined); + // Quarter: 1, 2, 3, 4 + 'Q': { + unit: 'quarter', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, -var script$3 = { - name: 'VgtFilterRow', - props: ['lineNumbers', 'columns', 'typedColumns', 'globalSearchEnabled', 'selectable', 'mode'], - watch: { - columns: { - handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { - this.populateInitialFilters(); - } - }, - deep: true, - immediate: true + // Ordinal quarter + 'Qo': { + unit: 'quarter', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'quarter'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'quarter'}) } }, - data: function data() { - return { - columnFilters: {}, - timer: null - }; + + // Month: 1, 2, ..., 12 + 'M': { + unit: 'month', + match: patterns$1.M, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } }, - computed: { - // to create a filter row, we need to - // make sure that there is atleast 1 column - // that requires filtering - hasFilterRow: function hasFilterRow() { - // if (this.mode === 'remote' || !this.globalSearchEnabled) { - for (var i = 0; i < this.columns.length; i++) { - var col = this.columns[i]; - if (col.filterOptions && col.filterOptions.enabled) { - return true; - } - } // } + // Ordinal month + 'Mo': { + unit: 'month', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'month'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'month'}) - 1 + } + }, + // Month: 01, 02, ..., 12 + 'MM': { + unit: 'month', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } + }, - return false; + // Month: Jan, Feb, ..., Dec + 'MMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + return options.locale.match.month(matchResult, {type: 'short'}) } }, - methods: { - reset: function reset() { - var emitEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - this.columnFilters = {}; - if (emitEvent) { - this.$emit('filter-changed', this.columnFilters); - } + // Month: January, February, ..., December + 'MMMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'long'}) || + options.locale.match.months(string, {type: 'short'}) }, - isFilterable: function isFilterable(column) { - return column.filterOptions && column.filterOptions.enabled; + parse: function (matchResult, options) { + var parseResult = options.locale.match.month(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.month(matchResult, {type: 'short'}); + } + + return parseResult + } + }, + + // ISO week: 1, 2, ..., 53 + 'W': { + unit: 'isoWeek', + match: patterns$1.W, + parse: parseDecimal$1 + }, + + // Ordinal ISO week + 'Wo': { + unit: 'isoWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'isoWeek'}) }, - isDropdown: function isDropdown(column) { - return this.isFilterable(column) && column.filterOptions.filterDropdownItems && column.filterOptions.filterDropdownItems.length; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'isoWeek'}) + } + }, + + // ISO week: 01, 02, ..., 53 + 'WW': { + unit: 'isoWeek', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of week: 0, 1, ..., 6 + 'd': { + unit: 'dayOfWeek', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, + + // Ordinal day of week + 'do': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfWeek'}) }, - isDropdownObjects: function isDropdownObjects(column) { - return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) === 'object'; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfWeek'}) + } + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'narrow'}) }, - isDropdownArray: function isDropdownArray(column) { - return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) !== 'object'; + parse: function (matchResult, options) { + return options.locale.match.weekday(matchResult, {type: 'narrow'}) + } + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) }, - // get column's defined placeholder or default one - getPlaceholder: function getPlaceholder(column) { - var placeholder = this.isFilterable(column) && column.filterOptions.placeholder || "Filter ".concat(column.label); - return placeholder; + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + + return parseResult + } + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'long'}) || + options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) }, - updateFiltersOnEnter: function updateFiltersOnEnter(column, value) { - if (this.timer) clearTimeout(this.timer); - this.updateFiltersImmediately(column, value); + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + } + + return parseResult + } + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': { + unit: 'dayOfISOWeek', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, + + // Day of month: 1, 2, ..., 31 + 'D': { + unit: 'dayOfMonth', + match: patterns$1.D, + parse: parseDecimal$1 + }, + + // Ordinal day of month + 'Do': { + unit: 'dayOfMonth', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfMonth'}) }, - updateFiltersOnKeyup: function updateFiltersOnKeyup(column, value) { - // if the trigger is enter, we don't filter on keyup - if (column.filterOptions.trigger === 'enter') return; - this.updateFilters(column, value); + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfMonth'}) + } + }, + + // Day of month: 01, 02, ..., 31 + 'DD': { + unit: 'dayOfMonth', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': { + unit: 'dayOfYear', + match: patterns$1.DDD, + parse: parseDecimal$1 + }, + + // Ordinal day of year + 'DDDo': { + unit: 'dayOfYear', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfYear'}) }, - // since vue doesn't detect property addition and deletion, we - // need to create helper function to set property etc - updateFilters: function updateFilters(column, value) { - var _this = this; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfYear'}) + } + }, - if (this.timer) clearTimeout(this.timer); - this.timer = setTimeout(function () { - _this.updateFiltersImmediately(column, value); - }, 400); + // Day of year: 001, 002, ..., 366 + 'DDDD': { + unit: 'dayOfYear', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, + + // AM, PM + 'A': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'short'}) }, - updateFiltersImmediately: function updateFiltersImmediately(column, value) { - this.$set(this.columnFilters, column.field, value); - this.$emit('filter-changed', this.columnFilters); + parse: function (matchResult, options) { + return options.locale.match.timeOfDay(matchResult, {type: 'short'}) + } + }, + + // a.m., p.m. + 'aa': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'long'}) || + options.locale.match.timesOfDay(string, {type: 'short'}) }, - populateInitialFilters: function populateInitialFilters() { - for (var i = 0; i < this.columns.length; i++) { - var col = this.columns[i]; // lets see if there are initial - // filters supplied by user + parse: function (matchResult, options) { + var parseResult = options.locale.match.timeOfDay(matchResult, {type: 'long'}); - if (this.isFilterable(col) && typeof col.filterOptions.filterValue !== 'undefined' && col.filterOptions.filterValue !== null) { - this.$set(this.columnFilters, col.field, col.filterOptions.filterValue); // this.updateFilters(col, col.filterOptions.filterValue); + if (parseResult == null) { + parseResult = options.locale.match.timeOfDay(matchResult, {type: 'short'}); + } - this.$set(col.filterOptions, 'filterValue', undefined); - } - } //* lets emit event once all filters are set + return parseResult + } + }, + // Hour: 0, 1, ... 23 + 'H': { + unit: 'hours', + match: patterns$1.H, + parse: parseDecimal$1 + }, - this.$emit('filter-changed', this.columnFilters); - } + // Hour: 00, 01, ..., 23 + 'HH': { + unit: 'hours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 }, - mounted: function mounted() {} -}; -/* script */ -var __vue_script__$3 = script$3; -/* template */ + // Hour: 1, 2, ..., 12 + 'h': { + unit: 'timeOfDayHours', + match: patterns$1.M, + parse: parseDecimal$1 + }, -var __vue_render__$3 = function __vue_render__() { - var _vm = this; + // Hour: 01, 02, ..., 12 + 'hh': { + unit: 'timeOfDayHours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, - var _h = _vm.$createElement; + // Minute: 0, 1, ..., 59 + 'm': { + unit: 'minutes', + match: patterns$1.m, + parse: parseDecimal$1 + }, - var _c = _vm._self._c || _h; + // Minute: 00, 01, ..., 59 + 'mm': { + unit: 'minutes', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, - return _vm.hasFilterRow ? _c('tr', [_vm.lineNumbers ? _c('th') : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th') : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { - return !column.hidden ? _c('th', { - key: index, - staticClass: "filter-th" - }, [_vm.isFilterable(column) ? _c('div', [!_vm.isDropdown(column) ? _c('input', { - staticClass: "vgt-input", - attrs: { - "type": "text", - "placeholder": _vm.getPlaceholder(column) - }, - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } + // Second: 0, 1, ..., 59 + 's': { + unit: 'seconds', + match: patterns$1.m, + parse: parseDecimal$1 + }, - return _vm.updateFiltersOnEnter(column, $event.target.value); - }, - "input": function input($event) { - return _vm.updateFiltersOnKeyup(column, $event.target.value); - } - } - }) : _vm._e(), _vm._v(" "), _vm.isDropdownArray(column) ? _c('select', { - staticClass: "vgt-select", - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "change": function change($event) { - return _vm.updateFilters(column, $event.target.value); - } - } - }, [_c('option', { - key: "-1", - attrs: { - "value": "" - } - }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { - return _c('option', { - key: i, - domProps: { - "value": option - } - }, [_vm._v("\n " + _vm._s(option) + "\n ")]); - })], 2) : _vm._e(), _vm._v(" "), _vm.isDropdownObjects(column) ? _c('select', { - staticClass: "vgt-select", - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "change": function change($event) { - return _vm.updateFilters(column, $event.target.value, true); - } - } - }, [_c('option', { - key: "-1", - attrs: { - "value": "" - } - }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { - return _c('option', { - key: i, - domProps: { - "value": option.value - } - }, [_vm._v(_vm._s(option.text))]); - })], 2) : _vm._e()]) : _vm._e()]) : _vm._e(); - })], 2) : _vm._e(); -}; + // Second: 00, 01, ..., 59 + 'ss': { + unit: 'seconds', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': { + unit: 'milliseconds', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 100 + } + }, -var __vue_staticRenderFns__$3 = []; -/* style */ + // 1/100 of second: 00, 01, ..., 99 + 'SS': { + unit: 'milliseconds', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 10 + } + }, -var __vue_inject_styles__$3 = undefined; -/* scoped */ + // Millisecond: 000, 001, ..., 999 + 'SSS': { + unit: 'milliseconds', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, -var __vue_scope_id__$3 = "data-v-892cc66c"; -/* module identifier */ + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': { + unit: 'timezone', + match: patterns$1.Z, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, -var __vue_module_identifier__$3 = undefined; -/* functional template */ + // Timezone: -0100, +0000, ... +1200 + 'ZZ': { + unit: 'timezone', + match: patterns$1.ZZ, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, -var __vue_is_functional_template__$3 = false; -/* style inject */ + // Seconds timestamp: 512969520 + 'X': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 1000 + } + }, -/* style inject SSR */ + // Milliseconds timestamp: 512969520900 + 'x': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: parseDecimal$1 + } +}; -var VgtFilterRow = __vue_normalize__({ - render: __vue_render__$3, - staticRenderFns: __vue_staticRenderFns__$3 -}, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, undefined, undefined); +parsers['a'] = parsers['A']; -function getNextSort(currentSort) { - if (currentSort === 'asc') return 'desc'; // if (currentSort === 'desc') return null; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCDay (dirtyDate, dirtyDay, dirtyOptions) { + var options = dirtyOptions || {}; + var locale = options.locale; + var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; + var defaultWeekStartsOn = localeWeekStartsOn === undefined ? 0 : Number(localeWeekStartsOn); + var weekStartsOn = options.weekStartsOn === undefined ? defaultWeekStartsOn : Number(options.weekStartsOn); - return 'asc'; + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var date = toDate(dirtyDate, dirtyOptions); + var day = Number(dirtyDay); + + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date } -function getIndex(sortArray, column) { - for (var i = 0; i < sortArray.length; i++) { - if (column.field === sortArray[i].field) return i; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISODay (dirtyDate, dirtyDay, dirtyOptions) { + var day = Number(dirtyDay); + + if (day % 7 === 0) { + day = day - 7; } - return -1; + var weekStartsOn = 1; + var date = toDate(dirtyDate, dirtyOptions); + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date } -var primarySort = function (sortArray, column) { - if (sortArray.length && sortArray.length === 1 && sortArray[0].field === column.field) { - var type = getNextSort(sortArray[0].type); +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeek (dirtyDate, dirtyISOWeek, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoWeek = Number(dirtyISOWeek); + var diff = getUTCISOWeek(date, dirtyOptions) - isoWeek; + date.setUTCDate(date.getUTCDate() - diff * 7); + return date +} - if (type) { - sortArray[0].type = getNextSort(sortArray[0].type); - } else { - sortArray = []; +var MILLISECONDS_IN_DAY$1 = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeekYear (dirtyDate, dirtyISOYear, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoYear = Number(dirtyISOYear); + var dateStartOfYear = startOfUTCISOWeekYear(date, dirtyOptions); + var diff = Math.floor((date.getTime() - dateStartOfYear.getTime()) / MILLISECONDS_IN_DAY$1); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(isoYear, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + date = startOfUTCISOWeekYear(fourthOfJanuary, dirtyOptions); + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +var MILLISECONDS_IN_MINUTE$2 = 60000; + +function setTimeOfDay (hours, timeOfDay) { + var isAM = timeOfDay === 0; + + if (isAM) { + if (hours === 12) { + return 0 } } else { - sortArray = [{ - field: column.field, - type: 'asc' - }]; + if (hours !== 12) { + return 12 + hours + } } - return sortArray; -}; - -var secondarySort = function (sortArray, column) { - //* this means that primary sort exists, we're - //* just adding a secondary sort - var index = getIndex(sortArray, column); + return hours +} - if (index === -1) { - sortArray.push({ - field: column.field, - type: 'asc' - }); - } else { - var type = getNextSort(sortArray[index].type); +var units = { + twoDigitYear: { + priority: 10, + set: function (dateValues, value) { + var century = Math.floor(dateValues.date.getUTCFullYear() / 100); + var year = century * 100 + value; + dateValues.date.setUTCFullYear(year, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - if (type) { - sortArray[index].type = type; - } else { - sortArray.splice(index, 1); + year: { + priority: 10, + set: function (dateValues, value) { + dateValues.date.setUTCFullYear(value, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues } - } + }, - return sortArray; -}; + isoYear: { + priority: 10, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeekYear(setUTCISOWeekYear(dateValues.date, value, options), options); + return dateValues + } + }, -// -var script$4 = { - name: 'VgtTableHeader', - props: { - lineNumbers: { - "default": false, - type: Boolean - }, - selectable: { - "default": false, - type: Boolean - }, - allSelected: { - "default": false, - type: Boolean - }, - allSelectedIndeterminate: { - "default": false, - type: Boolean - }, - columns: { - type: Array - }, - mode: { - type: String - }, - typedColumns: {}, - //* Sort related - sortable: { - type: Boolean - }, - // sortColumn: { - // type: Number, - // }, - // sortType: { - // type: String, - // }, - // utility functions - // isSortableColumn: { - // type: Function, - // }, - getClasses: { - type: Function - }, - //* search related - searchEnabled: { - type: Boolean - }, - tableRef: {}, - paginated: {} + quarter: { + priority: 20, + set: function (dateValues, value) { + dateValues.date.setUTCMonth((value - 1) * 3, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } }, - watch: { - tableRef: { - handler: function handler() { - this.setColumnStyles(); - }, - immediate: true - }, - paginated: { - handler: function handler() { - if (this.tableRef) { - this.setColumnStyles(); - } - }, - deep: true + + month: { + priority: 30, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(value, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues } }, - data: function data() { - return { - timer: null, - checkBoxThStyle: {}, - lineNumberThStyle: {}, - columnStyles: [], - sorts: [] - }; + + isoWeek: { + priority: 40, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeek(setUTCISOWeek(dateValues.date, value, options), options); + return dateValues + } }, - computed: {}, - methods: { - reset: function reset() { - this.$refs['filter-row'].reset(true); - }, - toggleSelectAll: function toggleSelectAll() { - this.$emit('on-toggle-select-all'); - }, - isSortableColumn: function isSortableColumn(column) { - var sortable = column.sortable; - var isSortable = typeof sortable === 'boolean' ? sortable : this.sortable; - return isSortable; - }, - sort: function sort(e, column) { - //* if column is not sortable, return right here - if (!this.isSortableColumn(column)) return; - if (e.shiftKey) { - this.sorts = secondarySort(this.sorts, column); - } else { - this.sorts = primarySort(this.sorts, column); - } + dayOfWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCDay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - this.$emit('on-sort-change', this.sorts); - }, - setInitialSort: function setInitialSort(sorts) { - this.sorts = sorts; - this.$emit('on-sort-change', this.sorts); - }, - getColumnSort: function getColumnSort(column) { - for (var i = 0; i < this.sorts.length; i += 1) { - if (this.sorts[i].field === column.field) { - return this.sorts[i].type || 'asc'; - } - } + dayOfISOWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCISODay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - return null; - }, - getHeaderClasses: function getHeaderClasses(column, index) { - var classes = assign({}, this.getClasses(index, 'th'), { - 'sorting sorting-desc': this.getColumnSort(column) === 'desc', - 'sorting sorting-asc': this.getColumnSort(column) === 'asc' - }); - return classes; - }, - filterRows: function filterRows(columnFilters) { - this.$emit('filter-changed', columnFilters); - }, - getWidthStyle: function getWidthStyle(dom) { - if (window && window.getComputedStyle) { - var cellStyle = window.getComputedStyle(dom, null); - return { - width: cellStyle.width - }; - } + dayOfMonth: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCDate(value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - return { - width: 'auto' - }; - }, - setColumnStyles: function setColumnStyles() { - var _this = this; + dayOfYear: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(0, value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - var colStyles = []; - if (this.timer) clearTimeout(this.timer); - this.timer = setTimeout(function () { - for (var i = 0; i < _this.columns.length; i++) { - if (_this.tableRef) { - var skip = 0; - if (_this.selectable) skip++; - if (_this.lineNumbers) skip++; - var cell = _this.tableRef.rows[0].cells[i + skip]; - colStyles.push(_this.getWidthStyle(cell)); - } else { - colStyles.push({ - minWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', - maxWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', - width: _this.columns[i].width ? _this.columns[i].width : 'auto' - }); - } - } + timeOfDay: { + priority: 60, + set: function (dateValues, value, options) { + dateValues.timeOfDay = value; + return dateValues + } + }, - _this.columnStyles = colStyles; - }, 200); - }, - getColumnStyle: function getColumnStyle(column, index) { - var styleObject = { - minWidth: column.width ? column.width : 'auto', - maxWidth: column.width ? column.width : 'auto', - width: column.width ? column.width : 'auto' - }; //* if fixed header we need to get width from original table + hours: { + priority: 70, + set: function (dateValues, value, options) { + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, - if (this.tableRef) { - if (this.selectable) index++; - if (this.lineNumbers) index++; - var cell = this.tableRef.rows[0].cells[index]; - var cellStyle = window.getComputedStyle(cell, null); - styleObject.width = cellStyle.width; + timeOfDayHours: { + priority: 70, + set: function (dateValues, value, options) { + var timeOfDay = dateValues.timeOfDay; + if (timeOfDay != null) { + value = setTimeOfDay(value, timeOfDay); } + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, - return styleObject; + minutes: { + priority: 80, + set: function (dateValues, value) { + dateValues.date.setUTCMinutes(value, 0, 0); + return dateValues } }, - mounted: function mounted() { - window.addEventListener('resize', this.setColumnStyles); + + seconds: { + priority: 90, + set: function (dateValues, value) { + dateValues.date.setUTCSeconds(value, 0); + return dateValues + } }, - beforeDestroy: function beforeDestroy() { - if (this.timer) clearTimeout(this.timer); - window.removeEventListener('resize', this.setColumnStyles); + + milliseconds: { + priority: 100, + set: function (dateValues, value) { + dateValues.date.setUTCMilliseconds(value); + return dateValues + } }, - components: { - 'vgt-filter-row': VgtFilterRow + + timezone: { + priority: 110, + set: function (dateValues, value) { + dateValues.date = new Date(dateValues.date.getTime() - value * MILLISECONDS_IN_MINUTE$2); + return dateValues + } + }, + + timestamp: { + priority: 120, + set: function (dateValues, value) { + dateValues.date = new Date(value); + return dateValues + } } }; -/* script */ -var __vue_script__$4 = script$4; -/* template */ +var TIMEZONE_UNIT_PRIORITY = 110; +var MILLISECONDS_IN_MINUTE$3 = 60000; -var __vue_render__$4 = function __vue_render__() { - var _vm = this; +var longFormattingTokensRegExp$1 = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultParsingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; - var _h = _vm.$createElement; +/** + * @name parse + * @category Common Helpers + * @summary Parse the date. + * + * @description + * Return the date parsed from string using the given format. + * + * Accepted format tokens: + * | Unit | Priority | Token | Input examples | + * |-------------------------|----------|-------|----------------------------------| + * | Year | 10 | YY | 00, 01, ..., 99 | + * | | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | 10 | GG | 00, 01, ..., 99 | + * | | | GGGG | 1900, 1901, ..., 2099 | + * | Quarter | 20 | Q | 1, 2, 3, 4 | + * | | | Qo | 1st, 2nd, 3rd, 4th | + * | Month | 30 | M | 1, 2, ..., 12 | + * | | | Mo | 1st, 2nd, ..., 12th | + * | | | MM | 01, 02, ..., 12 | + * | | | MMM | Jan, Feb, ..., Dec | + * | | | MMMM | January, February, ..., December | + * | ISO week | 40 | W | 1, 2, ..., 53 | + * | | | Wo | 1st, 2nd, ..., 53rd | + * | | | WW | 01, 02, ..., 53 | + * | Day of week | 50 | d | 0, 1, ..., 6 | + * | | | do | 0th, 1st, ..., 6th | + * | | | dd | Su, Mo, ..., Sa | + * | | | ddd | Sun, Mon, ..., Sat | + * | | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | 50 | E | 1, 2, ..., 7 | + * | Day of month | 50 | D | 1, 2, ..., 31 | + * | | | Do | 1st, 2nd, ..., 31st | + * | | | DD | 01, 02, ..., 31 | + * | Day of year | 50 | DDD | 1, 2, ..., 366 | + * | | | DDDo | 1st, 2nd, ..., 366th | + * | | | DDDD | 001, 002, ..., 366 | + * | Time of day | 60 | A | AM, PM | + * | | | a | am, pm | + * | | | aa | a.m., p.m. | + * | Hour | 70 | H | 0, 1, ... 23 | + * | | | HH | 00, 01, ... 23 | + * | Time of day hour | 70 | h | 1, 2, ..., 12 | + * | | | hh | 01, 02, ..., 12 | + * | Minute | 80 | m | 0, 1, ..., 59 | + * | | | mm | 00, 01, ..., 59 | + * | Second | 90 | s | 0, 1, ..., 59 | + * | | | ss | 00, 01, ..., 59 | + * | 1/10 of second | 100 | S | 0, 1, ..., 9 | + * | 1/100 of second | 100 | SS | 00, 01, ..., 99 | + * | Millisecond | 100 | SSS | 000, 001, ..., 999 | + * | Timezone | 110 | Z | -01:00, +00:00, ... +12:00 | + * | | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | 120 | X | 512969520 | + * | Milliseconds timestamp | 120 | x | 512969520900 | + * + * Values will be assigned to the date in the ascending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), + * the values will be taken from 3rd argument `baseDate` which works as a context of parsing. + * + * `baseDate` must be passed for correct work of the function. + * If you're not sure which `baseDate` to supply, create a new instance of Date: + * `parse('02/11/2014', 'MM/DD/YYYY', new Date())` + * In this case parsing will be done in the context of the current date. + * If `baseDate` is `Invalid Date` or a value not convertible to valid `Date`, + * then `Invalid Date` will be returned. + * + * Also, `parse` unfolds long formats like those in [format]{@link https://date-fns.org/docs/format}: + * | Token | Input examples | + * |-------|--------------------------------| + * | LT | 05:30 a.m. | + * | LTS | 05:30:15 a.m. | + * | L | 07/02/1995 | + * | l | 7/2/1995 | + * | LL | July 2 1995 | + * | ll | Jul 2 1995 | + * | LLL | July 2 1995 05:30 a.m. | + * | lll | Jul 2 1995 05:30 a.m. | + * | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets in the format string are escaped. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `baseDate` will be returned. + * + * If parsing failed, `Invalid Date` will be returned. + * Invalid Date is a Date, whose time value is NaN. + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {String} dateString - the string to parse + * @param {String} formatString - the string of tokens + * @param {Date|String|Number} baseDate - the date to took the missing higher priority values from + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the parsed date + * @throws {TypeError} 3 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.locale` must contain `match` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Parse 11 February 2014 from middle-endian format: + * var result = parse( + * '02/11/2014', + * 'MM/DD/YYYY', + * new Date() + * ) + * //=> Tue Feb 11 2014 00:00:00 + * + * @example + * // Parse 28th of February in English locale in the context of 2010 year: + * import eoLocale from 'date-fns/locale/eo' + * var result = parse( + * '28-a de februaro', + * 'Do [de] MMMM', + * new Date(2010, 0, 1) + * {locale: eoLocale} + * ) + * //=> Sun Feb 28 2010 00:00:00 + */ +function parse (dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions) { + if (arguments.length < 3) { + throw new TypeError('3 arguments required, but only ' + arguments.length + ' present') + } - var _c = _vm._self._c || _h; + var dateString = String(dirtyDateString); + var options = dirtyOptions || {}; - return _c('thead', [_c('tr', [_vm.lineNumbers ? _c('th', { - staticClass: "line-numbers" - }) : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th', { - staticClass: "vgt-checkbox-col" - }, [_c('input', { - attrs: { - "type": "checkbox" - }, - domProps: { - "checked": _vm.allSelected, - "indeterminate": _vm.allSelectedIndeterminate - }, - on: { - "change": _vm.toggleSelectAll - } - })]) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { - return !column.hidden ? _c('th', { - key: index, - "class": _vm.getHeaderClasses(column, index), - style: _vm.columnStyles[index], - on: { - "click": function click($event) { - return _vm.sort($event, column); - } + var weekStartsOn = options.weekStartsOn === undefined ? 0 : Number(options.weekStartsOn); + + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var locale$1 = options.locale || locale; + var localeParsers = locale$1.parsers || {}; + var localeUnits = locale$1.units || {}; + + if (!locale$1.match) { + throw new RangeError('locale must contain match property') + } + + if (!locale$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } + + var formatString = String(dirtyFormatString) + .replace(longFormattingTokensRegExp$1, function (substring) { + if (substring[0] === '[') { + return substring } - }, [_vm._t("table-column", [_c('span', [_vm._v(_vm._s(column.label))])], { - "column": column - })], 2) : _vm._e(); - })], 2), _vm._v(" "), _c("vgt-filter-row", { - ref: "filter-row", - tag: "tr", - attrs: { - "global-search-enabled": _vm.searchEnabled, - "line-numbers": _vm.lineNumbers, - "selectable": _vm.selectable, - "columns": _vm.columns, - "mode": _vm.mode, - "typed-columns": _vm.typedColumns - }, - on: { - "filter-changed": _vm.filterRows + + if (substring[0] === '\\') { + return cleanEscapedString$1(substring) + } + + return locale$1.formatLong(substring) + }); + + if (formatString === '') { + if (dateString === '') { + return toDate(dirtyBaseDate, options) + } else { + return new Date(NaN) } - })], 1); -}; + } -var __vue_staticRenderFns__$4 = []; -/* style */ + var subFnOptions = cloneObject(options); + subFnOptions.locale = locale$1; -var __vue_inject_styles__$4 = undefined; -/* scoped */ + var tokens = formatString.match(locale$1.parsingTokensRegExp || defaultParsingTokensRegExp); + var tokensLength = tokens.length; -var __vue_scope_id__$4 = "data-v-7068df50"; -/* module identifier */ + // If timezone isn't specified, it will be set to the system timezone + var setters = [{ + priority: TIMEZONE_UNIT_PRIORITY, + set: dateToSystemTimezone, + index: 0 + }]; -var __vue_module_identifier__$4 = undefined; -/* functional template */ + var i; + for (i = 0; i < tokensLength; i++) { + var token = tokens[i]; + var parser = localeParsers[token] || parsers[token]; + if (parser) { + var matchResult; -var __vue_is_functional_template__$4 = false; -/* style inject */ + if (parser.match instanceof RegExp) { + matchResult = parser.match.exec(dateString); + } else { + matchResult = parser.match(dateString, subFnOptions); + } -/* style inject SSR */ + if (!matchResult) { + return new Date(NaN) + } -var VgtTableHeader = __vue_normalize__({ - render: __vue_render__$4, - staticRenderFns: __vue_staticRenderFns__$4 -}, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, undefined, undefined); + var unitName = parser.unit; + var unit = localeUnits[unitName] || units[unitName]; -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -var script$5 = { - name: 'VgtHeaderRow', - props: { - headerRow: { - type: Object - }, - columns: { - type: Array - }, - lineNumbers: { - type: Boolean - }, - selectable: { - type: Boolean - }, - collectFormatted: { - type: Function - }, - formattedRow: { - type: Function - }, - getClasses: { - type: Function - }, - fullColspan: { - type: Number + setters.push({ + priority: unit.priority, + set: unit.set, + value: parser.parse(matchResult, subFnOptions), + index: setters.length + }); + + var substring = matchResult[0]; + dateString = dateString.slice(substring.length); + } else { + var head = tokens[i].match(/^\[.*]$/) ? tokens[i].replace(/^\[|]$/g, '') : tokens[i]; + if (dateString.indexOf(head) === 0) { + dateString = dateString.slice(head.length); + } else { + return new Date(NaN) + } } - }, - data: function data() { - return {}; - }, - computed: {}, - methods: {}, - mounted: function mounted() {}, - components: {} -}; + } -/* script */ -var __vue_script__$5 = script$5; -/* template */ + var uniquePrioritySetters = setters + .map(function (setter) { + return setter.priority + }) + .sort(function (a, b) { + return a - b + }) + .filter(function (priority, index, array) { + return array.indexOf(priority) === index + }) + .map(function (priority) { + return setters + .filter(function (setter) { + return setter.priority === priority + }) + .reverse() + }) + .map(function (setterArray) { + return setterArray[0] + }); -var __vue_render__$5 = function __vue_render__() { - var _vm = this; + var date = toDate(dirtyBaseDate, options); - var _h = _vm.$createElement; + if (isNaN(date)) { + return new Date(NaN) + } - var _c = _vm._self._c || _h; + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37 + var utcDate = subMinutes(date, date.getTimezoneOffset()); - return _c('tr', [_vm.headerRow.mode === 'span' ? _c('th', { - staticClass: "vgt-left-align vgt-row-header", - attrs: { - "colspan": _vm.fullColspan - } - }, [_vm._t("table-header-row", [_vm.headerRow.html ? _c('span', { - domProps: { - "innerHTML": _vm._s(_vm.headerRow.label) - } - }) : _c('span', [_vm._v("\n " + _vm._s(_vm.headerRow.label) + "\n ")])], { - "row": _vm.headerRow - })], 2) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.lineNumbers ? _c('th', { - staticClass: "vgt-row-header" - }) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.selectable ? _c('th', { - staticClass: "vgt-row-header" - }) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, i) { - return _vm.headerRow.mode !== 'span' && !column.hidden ? _c('th', { - key: i, - staticClass: "vgt-row-header", - "class": _vm.getClasses(i, 'td') - }, [_vm._t("table-header-row", [!column.html ? _c('span', [_vm._v("\n " + _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + "\n ")]) : _vm._e(), _vm._v(" "), column.html ? _c('span', { - domProps: { - "innerHTML": _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) - } - }) : _vm._e()], { - "row": _vm.headerRow, - "column": column, - "formattedRow": _vm.formattedRow(_vm.headerRow, true) - })], 2) : _vm._e(); - })], 2); -}; + var dateValues = {date: utcDate}; -var __vue_staticRenderFns__$5 = []; -/* style */ + var settersLength = uniquePrioritySetters.length; + for (i = 0; i < settersLength; i++) { + var setter = uniquePrioritySetters[i]; + dateValues = setter.set(dateValues, setter.value, subFnOptions); + } -var __vue_inject_styles__$5 = undefined; -/* scoped */ + return dateValues.date +} -var __vue_scope_id__$5 = undefined; -/* module identifier */ +function dateToSystemTimezone (dateValues) { + var date = dateValues.date; + var time = date.getTime(); -var __vue_module_identifier__$5 = undefined; -/* functional template */ + // Get the system timezone offset at (moment of time - offset) + var offset = date.getTimezoneOffset(); -var __vue_is_functional_template__$5 = false; -/* style inject */ + // Get the system timezone offset at the exact moment of time + offset = new Date(time + offset * MILLISECONDS_IN_MINUTE$3).getTimezoneOffset(); -/* style inject SSR */ + // Convert date in timezone "UTC+00:00" to the system timezone + dateValues.date = new Date(time + offset * MILLISECONDS_IN_MINUTE$3); -var VgtHeaderRow = __vue_normalize__({ - render: __vue_render__$5, - staticRenderFns: __vue_staticRenderFns__$5 -}, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, undefined, undefined); + return dateValues +} + +function cleanEscapedString$1 (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} -var date = cloneDeep(defaultType); +var date = lodash_clonedeep(defaultType); date.isRight = true; date.compare = function (x, y, column) { function cook(d) { if (column && column.dateInputFormat) { - return dateFns.parse("".concat(d), "".concat(column.dateInputFormat), new Date()); + return parse("".concat(d), "".concat(column.dateInputFormat), new Date()); } return d; @@ -1361,29 +11309,29 @@ date.compare = function (x, y, column) { x = cook(x); y = cook(y); - if (!dateFns.isValid(x)) { + if (!isValid(x)) { return -1; } - if (!dateFns.isValid(y)) { + if (!isValid(y)) { return 1; } - return dateFns.compareAsc(x, y); + return compareAsc(x, y); }; date.format = function (v, column) { if (v === undefined || v === null) return ''; // convert to date - var date = dateFns.parse(v, column.dateInputFormat, new Date()); - return dateFns.format(date, column.dateOutputFormat); + var date = parse(v, column.dateInputFormat, new Date()); + return format(date, column.dateOutputFormat); }; var date$1 = /*#__PURE__*/Object.freeze({ 'default': date }); -var number = cloneDeep(defaultType); +var number = lodash_clonedeep(defaultType); number.isRight = true; number.filterPredicate = function (rowval, filter) { @@ -1409,7 +11357,7 @@ var number$1 = /*#__PURE__*/Object.freeze({ 'default': number }); -var decimal = cloneDeep(number); +var decimal = lodash_clonedeep(number); decimal.format = function (v) { if (v === undefined || v === null) return ''; @@ -1420,7 +11368,7 @@ var decimal$1 = /*#__PURE__*/Object.freeze({ 'default': decimal }); -var percentage = cloneDeep(number); +var percentage = lodash_clonedeep(number); percentage.format = function (v) { if (v === undefined || v === null) return ''; @@ -1431,7 +11379,7 @@ var percentage$1 = /*#__PURE__*/Object.freeze({ 'default': percentage }); -var _boolean = cloneDeep(defaultType); +var _boolean = lodash_clonedeep(defaultType); _boolean.isRight = true; @@ -1467,7 +11415,7 @@ var index = { var dataTypes = {}; var coreDataTypes = index; -each(Object.keys(coreDataTypes), function (key) { +lodash_foreach(Object.keys(coreDataTypes), function (key) { var compName = key.replace(/^\.\//, '').replace(/\.js/, ''); dataTypes[compName] = coreDataTypes[key]["default"]; }); @@ -1630,7 +11578,7 @@ var script$6 = { }, paginationOptions: { handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.initializePagination(); } }, @@ -1652,14 +11600,14 @@ var script$6 = { }, sortOptions: { handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.initializeSort(); } }, deep: true }, selectedRows: function selectedRows(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.$emit('on-selected-rows-change', { selectedRows: this.selectedRows }); @@ -1705,8 +11653,8 @@ var script$6 = { }, selectedPageRows: function selectedPageRows() { var selectedRows = []; - each(this.paginated, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(this.paginated, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { if (row.vgtSelected) { selectedRows.push(row); } @@ -1716,8 +11664,8 @@ var script$6 = { }, selectedRows: function selectedRows() { var selectedRows = []; - each(this.processedRows, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(this.processedRows, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { if (row.vgtSelected) { selectedRows.push(row); } @@ -1758,14 +11706,14 @@ var script$6 = { }, totalRowCount: function totalRowCount() { var total = 0; - each(this.processedRows, function (headerRow) { + lodash_foreach(this.processedRows, function (headerRow) { total += headerRow.children ? headerRow.children.length : 0; }); return total; }, totalPageRowCount: function totalPageRowCount() { var total = 0; - each(this.paginated, function (headerRow) { + lodash_foreach(this.paginated, function (headerRow) { total += headerRow.children ? headerRow.children.length : 0; }); return total; @@ -1813,12 +11761,12 @@ var script$6 = { // here also we need to de-construct and then // re-construct the rows. var allRows = []; - each(this.filteredRows, function (headerRow) { + lodash_foreach(this.filteredRows, function (headerRow) { allRows.push.apply(allRows, _toConsumableArray(headerRow.children)); }); var filteredRows = []; - each(allRows, function (row) { - each(_this.columns, function (col) { + lodash_foreach(allRows, function (row) { + lodash_foreach(_this.columns, function (col) { // if col does not have search disabled, if (!col.globalSearchDisabled) { // if a search function is provided, @@ -1851,12 +11799,12 @@ var script$6 = { // of rows computedRows = []; - each(this.filteredRows, function (headerRow) { + lodash_foreach(this.filteredRows, function (headerRow) { var i = headerRow.vgt_header_id; - var children = filter(filteredRows, ['vgt_id', i]); + var children = lodash_filter(filteredRows, ['vgt_id', i]); if (children.length) { - var newHeaderRow = cloneDeep(headerRow); + var newHeaderRow = lodash_clonedeep(headerRow); newHeaderRow.children = children; computedRows.push(newHeaderRow); } @@ -1911,7 +11859,7 @@ var script$6 = { var paginatedRows = []; - each(this.processedRows, function (childRows) { + lodash_foreach(this.processedRows, function (childRows) { var _paginatedRows; (_paginatedRows = paginatedRows).push.apply(_paginatedRows, _toConsumableArray(childRows.children)); @@ -1939,12 +11887,12 @@ var script$6 = { var reconstructedRows = []; - each(this.processedRows, function (headerRow) { + lodash_foreach(this.processedRows, function (headerRow) { var i = headerRow.vgt_header_id; - var children = filter(paginatedRows, ['vgt_id', i]); + var children = lodash_filter(paginatedRows, ['vgt_id', i]); if (children.length) { - var newHeaderRow = cloneDeep(headerRow); + var newHeaderRow = lodash_clonedeep(headerRow); newHeaderRow.children = children; reconstructedRows.push(newHeaderRow); } @@ -1952,7 +11900,7 @@ var script$6 = { return reconstructedRows; }, originalRows: function originalRows() { - var rows = cloneDeep(this.rows); + var rows = lodash_clonedeep(this.rows); var nestedRows = []; if (!this.groupOptions.enabled) { @@ -1967,15 +11915,15 @@ var script$6 = { var index = 0; - each(nestedRows, function (headerRow, i) { - each(headerRow.children, function (row, j) { + lodash_foreach(nestedRows, function (headerRow, i) { + lodash_foreach(headerRow.children, function (row, j) { row.originalIndex = index++; }); }); return nestedRows; }, typedColumns: function typedColumns() { - var columns = assign(this.columns, []); + var columns = lodash_assign(this.columns, []); for (var i = 0; i < this.columns.length; i++) { var column = columns[i]; @@ -2022,8 +11970,8 @@ var script$6 = { var _this2 = this; var rows = this.selectAllByPage && !forceAll ? this.paginated : this.filteredRows; - each(rows, function (headerRow, i) { - each(headerRow.children, function (row, j) { + lodash_foreach(rows, function (headerRow, i) { + lodash_foreach(headerRow.children, function (row, j) { _this2.$set(row, 'vgtSelected', false); }); }); @@ -2038,8 +11986,8 @@ var script$6 = { } var rows = this.selectAllByPage ? this.paginated : this.filteredRows; - each(rows, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(rows, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { _this3.$set(row, 'vgtSelected', true); }); }); @@ -2165,7 +12113,7 @@ var script$6 = { this.handleSearch(); // we reset the filteredRows here because // we want to search across everything. - this.filteredRows = cloneDeep(this.originalRows); + this.filteredRows = lodash_clonedeep(this.originalRows); this.forceSearch = true; this.sortChanged = true; } @@ -2284,7 +12232,7 @@ var script$6 = { // this is invoked either as a result of changing filters // or as a result of modifying rows. this.columnFilters = columnFilters; - var computedRows = cloneDeep(this.originalRows); // do we have a filter to care about? + var computedRows = lodash_clonedeep(this.originalRows); // do we have a filter to care about? // if not we don't need to do anything if (this.columnFilters && Object.keys(this.columnFilters).length) { @@ -2321,7 +12269,7 @@ var script$6 = { var col = _this4.typedColumns[i]; if (_this4.columnFilters[col.field]) { - computedRows = each(computedRows, function (headerRow) { + computedRows = lodash_foreach(computedRows, function (headerRow) { var newChildren = headerRow.children.filter(function (row) { // If column has a custom filter, use that. if (col.filterOptions && typeof col.filterOptions.filterFn === 'function') { @@ -2366,9 +12314,9 @@ var script$6 = { return classes; }, handleGrouped: function handleGrouped(originalRows) { - each(originalRows, function (headerRow, i) { + lodash_foreach(originalRows, function (headerRow, i) { headerRow.vgt_header_id = i; - each(headerRow.children, function (childRow) { + lodash_foreach(headerRow.children, function (childRow) { childRow.vgt_id = i; }); }); @@ -2870,7 +12818,7 @@ var __vue_is_functional_template__$6 = false; /* style inject SSR */ -var VueGoodTable = __vue_normalize__({ +var VueGoodTable = normalizeComponent_1({ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, __vue_inject_styles__$6, __vue_script__$6, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, undefined, undefined); diff --git a/dist/vue-good-table.esm.js b/dist/vue-good-table.esm.js index 0ed8aab6..09e276f5 100644 --- a/dist/vue-good-table.esm.js +++ b/dist/vue-good-table.esm.js @@ -1,19 +1,10 @@ /** - * vue-good-table v2.17.1 + * vue-good-table v2.17.2 * (c) 2018-present xaksis * https://github.com/xaksis/vue-good-table * Released under the MIT License. */ -import each from 'lodash.foreach'; -import assign from 'lodash.assign'; -import cloneDeep from 'lodash.clonedeep'; -import filter from 'lodash.filter'; -import isEqual from 'lodash.isequal'; -import diacriticless from 'diacriticless'; -import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js'; -import { isValid, compareAsc, parse, format } from 'date-fns'; - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { @@ -86,1261 +77,11220 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -var escapeRegExp = function escapeRegExp(str) { - return str.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&'); -}; - -var defaultType = { - format: function format(x) { - return x; - }, - filterPredicate: function filterPredicate(rowval, filter) { - var skipDiacritics = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ - // take care of nulls - if (typeof rowval === 'undefined' || rowval === null) { - return false; - } // row value +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; - var rowValue = skipDiacritics ? String(rowval).toLowerCase() : diacriticless(escapeRegExp(String(rowval)).toLowerCase()); // search term +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; - var searchTerm = skipDiacritics ? filter.toLowerCase() : diacriticless(escapeRegExp(filter).toLowerCase()); // comparison +/** + * 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 ? array.length : 0; - return rowValue.indexOf(searchTerm) > -1; - }, - compare: function compare(x, y) { - function cook(d) { - if (typeof d === 'undefined' || d === null) return ''; - return diacriticless(d.toLowerCase()); + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; } + } + return array; +} - x = cook(x); - y = cook(y); - if (x < y) return -1; - if (x > y) return 1; - return 0; +/** + * 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; +} -// -// -// -// -// -// -// -// -// -// -var script = { - name: 'VgtPaginationPageInfo', - props: { - currentPage: { - "default": 1 - }, - lastPage: { - "default": 1 - }, - totalRecords: { - "default": 0 - }, - ofText: { - "default": 'of', - type: String - }, - pageText: { - "default": 'page', - type: String - } - }, - data: function data() { - return {}; - }, - computed: { - pageInfo: function pageInfo() { - return "".concat(this.ofText, " ").concat(this.lastPage); - } - }, - methods: { - changePage: function changePage(event) { - var value = parseInt(event.target.value, 10); //! invalid number +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} - if (Number.isNaN(value) || value > this.lastPage || value < 1) { - event.target.value = this.currentPage; - return false; - } //* valid number +/** Used for built-in method references. */ +var objectProto = Object.prototype; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - event.target.value = value; - this.$emit('page-changed', value); +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); } - }, - mounted: function mounted() {}, - components: {} -}; + } + return result; +} -/* script */ -var __vue_script__ = script; -/* template */ +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); -var __vue_render__ = function __vue_render__() { - var _vm = this; +/** + * 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`. + * + * @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`. + */ +var baseFor = createBaseFor(); - var _h = _vm.$createElement; +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} - var _c = _vm._self._c || _h; +/** + * The base implementation of `_.keys` 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 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; +} - return _c('div', { - staticClass: "footer__navigation__page-info" - }, [_vm._v("\n " + _vm._s(_vm.pageText) + " "), _c('input', { - staticClass: "footer__navigation__page-info__current-entry", - attrs: { - "type": "text" - }, - domProps: { - "value": _vm.currentPage - }, - on: { - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @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 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); - $event.stopPropagation(); - return _vm.changePage($event); + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; } } - }), _vm._v(" " + _vm._s(_vm.pageInfo) + "\n")]); -}; + return collection; + }; +} -var __vue_staticRenderFns__ = []; -/* style */ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +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; + }; +} -var __vue_inject_styles__ = undefined; -/* scoped */ +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} -var __vue_scope_id__ = "data-v-9a8cd1f4"; -/* module identifier */ +/** + * 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; -var __vue_module_identifier__ = undefined; -/* functional template */ + return value === proto; +} -var __vue_is_functional_template__ = false; -/* style inject */ +/** + * 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`. + * + * **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 _ + * @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 + * + * _([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) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, typeof iteratee == 'function' ? iteratee : identity); +} -/* style inject SSR */ +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} -var VgtPaginationPageInfo = __vue_normalize__({ - render: __vue_render__, - staticRenderFns: __vue_staticRenderFns__ -}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined); +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; -// -var DEFAULT_ROWS_PER_PAGE_DROPDOWN = [10, 20, 30, 40, 50]; -var script$1 = { - name: 'VgtPagination', - props: { - styleClass: { - "default": 'table table-bordered' - }, - total: { - "default": null - }, - perPage: {}, - rtl: { - "default": false - }, - customRowsPerPageDropdown: { - "default": function _default() { - return []; - } - }, - paginateDropdownAllowAll: { - "default": true - }, - mode: { - "default": 'records' - }, - // text options - nextText: { - "default": 'Next' - }, - prevText: { - "default": 'Prev' - }, - rowsPerPageText: { - "default": 'Rows per page:' - }, - ofText: { - "default": 'of' - }, - pageText: { - "default": 'page' - }, - allText: { - "default": 'All' - } - }, - data: function data() { - return { - currentPage: 1, - prevPage: 0, - currentPerPage: 10, - rowsPerPageOptions: [] - }; - }, - watch: { - perPage: { - handler: function handler(newValue, oldValue) { - this.handlePerPage(); - this.perPageChanged(); - }, - immediate: true - }, - customRowsPerPageDropdown: function customRowsPerPageDropdown() { - this.handlePerPage(); - } - }, - computed: { - // Number of pages - pagesCount: function pagesCount() { - var quotient = Math.floor(this.total / this.currentPerPage); - var remainder = this.total % this.currentPerPage; - return remainder === 0 ? quotient : quotient + 1; - }, - // Current displayed items - paginatedInfo: function paginatedInfo() { - var first = (this.currentPage - 1) * this.currentPerPage + 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 _ + * @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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +var lodash_foreach = forEach; + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER$1 = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag$1 = '[object Arguments]', + funcTag$1 = '[object Function]', + genTag$1 = '[object GeneratorFunction]'; + +/** Used to detect unsigned integer values. */ +var reIsUint$1 = /^(?:0|[1-9]\d*)$/; + +/** + * 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 {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +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); +} + +/** + * 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$1(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg$1(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty$1 = objectProto$1.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString$1 = objectProto$1.toString; + +/** Built-in value references. */ +var propertyIsEnumerable$1 = objectProto$1.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys$1 = overArg$1(Object.keys, Object), + nativeMax = Math.max; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable$1.call({ 'valueOf': 1 }, 'valueOf'); + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys$1(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray$1(value) || isArguments$1(value)) + ? baseTimes$1(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty$1.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex$1(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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. + * + * @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$1.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * The base implementation of `_.keys` 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 baseKeys$1(object) { + if (!isPrototype$1(object)) { + return nativeKeys$1(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty$1.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @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 baseRest(func, start) { + 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] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * 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) { + 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) + : undefined; + + assignValue(object, key, newValue === undefined ? source[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 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; + }); +} + +/** + * 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$1(value, length) { + length = length == null ? MAX_SAFE_INTEGER$1 : length; + return !!length && + (typeof value == 'number' || reIsUint$1.test(value)) && + (value > -1 && value % 1 == 0 && value < 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$1(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike$1(object) && isIndex$1(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$1(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$1; + + return value === proto; +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments$1(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject$1(value) && hasOwnProperty$1.call(value, 'callee') && + (!propertyIsEnumerable$1.call(value, 'callee') || objectToString$1.call(value) == argsTag$1); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray$1 = 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 _ + * @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 isArrayLike$1(value) { + return value != null && isLength$1(value.length) && !isFunction$1(value); +} + +/** + * 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 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$1(value) { + return isObjectLike$1(value) && isArrayLike$1(value); +} + +/** + * 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$1(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject$1(value) ? objectToString$1.call(value) : ''; + return tag == funcTag$1 || tag == genTag$1; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength$1(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; +} + +/** + * 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 an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject$1(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 _ + * @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 isObjectLike$1(value) { + return !!value && typeof value == '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 _ + * @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 + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype$1(source) || isArrayLike$1(source)) { + copyObject(source, keys$1(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty$1.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +/** + * 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/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 keys$1(object) { + return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys$1(object); +} + +var lodash_assign = assign; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var lodash_clonedeep = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** 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__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `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]', + promiseTag = '[object Promise]', + 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 match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +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; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * 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 ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * 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 ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * 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; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * 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; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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) : ''; +}()); + +/** 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 resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * 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); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + return getMapData(this, key)['delete'](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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * 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) { + return this.__data__['delete'](key); +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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 cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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. + * + * @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; + } +} + +/** + * 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 -1; +} + +/** + * 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); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including 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 baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + 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)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return 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); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(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, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * 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} 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 baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * 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) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @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 cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @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 cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * 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) { + 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) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * 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; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +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 = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + 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; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +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; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @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 initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * 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 == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 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 _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 a buffer. + * + * @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; + +/** + * 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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @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 stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = cloneDeep; +}); + +var lodash_filter = createCommonjsModule(function (module, exports) { +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** 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; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `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]', + promiseTag = '[object Promise]', + 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 match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == '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('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array ? array.length : 0, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * 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 ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * 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 accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * 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; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * 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; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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) : ''; +}()); + +/** 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 resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(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; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * 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); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + return getMapData(this, key)['delete'](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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array 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; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * 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) { + return this.__data__['delete'](key); +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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 cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * 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 -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @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 baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +/** + * 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`. + * + * @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`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * 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] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` 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 baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @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`. + */ +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); +} + +/** + * 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 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`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + 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; + + 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__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * 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; + + 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]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * 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) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * 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); +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +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, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @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 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; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +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; + }; +} + +/** + * 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 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`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // 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 & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // 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 (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + 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} 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`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, 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 & PARTIAL_COMPARE_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 |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * 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 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`. + */ +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; + + 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); + + 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, customizer, bitmask, 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; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * 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; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +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 = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + 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; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @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 hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(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 suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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 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); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + 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; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * 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 _ + * @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 + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // 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 filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate)); +} + +/** + * 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 `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @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 = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + 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); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 isArguments(value) { + // Safari 8.1 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 _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, 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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * 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 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 _ + * @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) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 _ + * @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 isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @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 + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * 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 process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @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 get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @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 + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @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 + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = filter; +}); + +var lodash_isequal = createCommonjsModule(function (module, exports) { +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** 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__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + 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 match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** 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; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + +/** 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')(); + +/** Detect free variable `exports`. */ +var freeExports = exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && 'object' == '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) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` 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 {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * 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 == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * 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; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @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 cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** 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 detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +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]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @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 hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +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; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @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 hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @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 hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * 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; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * 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); + + 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; +} + +/** + * 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); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * 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; +} + +/** + * 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); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +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]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + '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 mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * 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 mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * 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 mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * 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 instance. + */ +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; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * 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; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * 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__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * 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) { + return this.__data__.get(key); +} + +/** + * 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`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * 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; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +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; + + 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); + } + } + return result; +} + +/** + * 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 -1; +} + +/** + * 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} 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 baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @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 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); +} + +/** + * 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); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + 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__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + 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); +} + +/** + * 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)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` 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 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; +} + +/** + * 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 {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 equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // 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; + + stack.set(array, other); + stack.set(other, array); + + // 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; + } + } + stack['delete'](array); + stack['delete'](other); + 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} 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; +} + +/** + * 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 {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 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; + + 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); + + 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; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * 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; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + 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; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +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; + }; +} + +/** + * 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) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * 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 == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * 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; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * 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 + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @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 + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @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 + * + * _.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 _ + * @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 isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @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; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.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 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * 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; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **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 isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= 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 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 != null && (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 _ + * @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 isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @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 + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * 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/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 keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @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 stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; +}); + +// all diacritics +var diacritics = + { + 'a' : ['a','à','á','â','ã','ä','å','æ','ā','ă','ą','ǎ','ǟ','ǡ','ǻ','ȁ','ȃ','ȧ','ɐ','ɑ','ɒ','ͣ','а','ӑ','ӓ','ᵃ','ᵄ','ᶏ','ḁ','ẚ','ạ','ả','ấ','ầ','ẩ','ẫ','ậ','ắ','ằ','ẳ','ẵ','ặ','ₐ','ⱥ','a'], + 'A' : ['A','À','Á','Â','Ã','Ä','Å','Ā','Ă','Ą','Ǎ','Ǟ','Ǡ','Ǻ','Ȁ','Ȃ','Ȧ','Ⱥ','А','Ӑ','Ӓ','ᴀ','ᴬ','Ḁ','Ạ','Ả','Ấ','Ầ','Ẩ','Ẫ','Ậ','Ắ','Ằ','Ẳ','Ẵ','Ặ','A'], + + 'b' : ['b','ƀ','ƃ','ɓ','ᖯ','ᵇ','ᵬ','ᶀ','ḃ','ḅ','ḇ','b'], + 'B' : ['B','Ɓ','Ƃ','Ƀ','ʙ','ᛒ','ᴃ','ᴮ','ᴯ','Ḃ','Ḅ','Ḇ','B'], + + 'c' : ['c','ç','ć','ĉ','ċ','č','ƈ','ȼ','ɕ','ͨ','ᴄ','ᶜ','ḉ','ↄ','c'], + 'C' : ['C','Ç','Ć','Ĉ','Ċ','Č','Ƈ','Ȼ','ʗ','Ḉ','C'], + + 'd' : ['d','ď','đ','Ƌ','ƌ','ȡ','ɖ','ɗ','ͩ','ᵈ','ᵭ','ᶁ','ᶑ','ḋ','ḍ','ḏ','ḑ','ḓ','d'], + 'D' : ['D','Ď','Đ','Ɖ','Ɗ','ᴰ','Ḋ','Ḍ','Ḏ','Ḑ','Ḓ','D'], + + 'e' : ['e','è','é','ê','ë','ē','ĕ','ė','ę','ě','ǝ','ȅ','ȇ','ȩ','ɇ','ɘ','ͤ','ᵉ','ᶒ','ḕ','ḗ','ḙ','ḛ','ḝ','ẹ','ẻ','ẽ','ế','ề','ể','ễ','ệ','ₑ','e'], + 'E' : ['E','È','É','Ê','Ë','Ē','Ĕ','Ė','Ę','Ě','Œ','Ǝ','Ɛ','Ȅ','Ȇ','Ȩ','Ɇ','ɛ','ɜ','ɶ','Є','Э','э','є','Ӭ','ӭ','ᴇ','ᴈ','ᴱ','ᴲ','ᵋ','ᵌ','ᶓ','ᶔ','ᶟ','Ḕ','Ḗ','Ḙ','Ḛ','Ḝ','Ẹ','Ẻ','Ẽ','Ế','Ề','Ể','Ễ','Ệ','E','𐐁','𐐩'], + + 'f' : ['f','ƒ','ᵮ','ᶂ','ᶠ','ḟ','f'], + 'F' : ['F','Ƒ','Ḟ','ⅎ','F'], + + 'g' : ['g','ĝ','ğ','ġ','ģ','ǥ','ǧ','ǵ','ɠ','ɡ','ᵍ','ᵷ','ᵹ','ᶃ','ᶢ','ḡ','g'], + 'G' : ['G','Ĝ','Ğ','Ġ','Ģ','Ɠ','Ǥ','Ǧ','Ǵ','ɢ','ʛ','ᴳ','Ḡ','G'], + + 'h' : ['h','ĥ','ħ','ƕ','ȟ','ɥ','ɦ','ʮ','ʯ','ʰ','ʱ','ͪ','Һ','һ','ᑋ','ᶣ','ḣ','ḥ','ḧ','ḩ','ḫ','ⱨ','h'], + 'H' : ['H','Ĥ','Ħ','Ȟ','ʜ','ᕼ','ᚺ','ᚻ','ᴴ','Ḣ','Ḥ','Ḧ','Ḩ','Ḫ','Ⱨ','H'], + + 'i' : ['i','ì','í','î','ï','ĩ','ī','ĭ','į','ǐ','ȉ','ȋ','ɨ','ͥ','ᴉ','ᵎ','ᵢ','ᶖ','ᶤ','ḭ','ḯ','ỉ','ị','i'], + 'I' : ['I','Ì','Í','Î','Ï','Ĩ','Ī','Ĭ','Į','İ','Ǐ','Ȉ','Ȋ','ɪ','І','ᴵ','ᵻ','ᶦ','ᶧ','Ḭ','Ḯ','Ỉ','Ị','I'], + + 'j' : ['j','ĵ','ǰ','ɉ','ʝ','ʲ','ᶡ','ᶨ','j'], + 'J' : ['J','Ĵ','ᴊ','ᴶ','J'], + + 'k' : ['k','ķ','ƙ','ǩ','ʞ','ᵏ','ᶄ','ḱ','ḳ','ḵ','ⱪ','k'], + 'K' : ['K','Ķ','Ƙ','Ǩ','ᴷ','Ḱ','Ḳ','Ḵ','Ⱪ','K'], + + 'l' : ['l','ĺ','ļ','ľ','ŀ','ł','ƚ','ȴ','ɫ','ɬ','ɭ','ˡ','ᶅ','ᶩ','ᶪ','ḷ','ḹ','ḻ','ḽ','ℓ','ⱡ'], + 'L' : ['L','Ĺ','Ļ','Ľ','Ŀ','Ł','Ƚ','ʟ','ᴌ','ᴸ','ᶫ','Ḷ','Ḹ','Ḻ','Ḽ','Ⱡ','Ɫ'], + + 'm' : ['m','ɯ','ɰ','ɱ','ͫ','ᴟ','ᵐ','ᵚ','ᵯ','ᶆ','ᶬ','ᶭ','ḿ','ṁ','ṃ','㎡','㎥','m'], + 'M' : ['M','Ɯ','ᴍ','ᴹ','Ḿ','Ṁ','Ṃ','M'], + + 'n' : ['n','ñ','ń','ņ','ň','ʼn','ƞ','ǹ','ȵ','ɲ','ɳ','ᵰ','ᶇ','ᶮ','ᶯ','ṅ','ṇ','ṉ','ṋ','ⁿ','n'], + 'N' : ['N','Ñ','Ń','Ņ','Ň','Ɲ','Ǹ','Ƞ','ɴ','ᴎ','ᴺ','ᴻ','ᶰ','Ṅ','Ṇ','Ṉ','Ṋ','N'], + + 'o' : ['o','ò','ó','ô','õ','ö','ø','ō','ŏ','ő','ơ','ǒ','ǫ','ǭ','ǿ','ȍ','ȏ','ȫ','ȭ','ȯ','ȱ','ɵ','ͦ','о','ӧ','ө','ᴏ','ᴑ','ᴓ','ᴼ','ᵒ','ᶱ','ṍ','ṏ','ṑ','ṓ','ọ','ỏ','ố','ồ','ổ','ỗ','ộ','ớ','ờ','ở','ỡ','ợ','ₒ','o','𐐬'], + 'O' : ['O','Ò','Ó','Ô','Õ','Ö','Ø','Ō','Ŏ','Ő','Ɵ','Ơ','Ǒ','Ǫ','Ǭ','Ǿ','Ȍ','Ȏ','Ȫ','Ȭ','Ȯ','Ȱ','О','Ӧ','Ө','Ṍ','Ṏ','Ṑ','Ṓ','Ọ','Ỏ','Ố','Ồ','Ổ','Ỗ','Ộ','Ớ','Ờ','Ở','Ỡ','Ợ','O','𐐄'], + + 'p' : ['p','ᵖ','ᵱ','ᵽ','ᶈ','ṕ','ṗ','p'], + 'P' : ['P','Ƥ','ᴘ','ᴾ','Ṕ','Ṗ','Ᵽ','P'], + + 'q' : ['q','ɋ','ʠ','ᛩ','q'], + 'Q' : ['Q','Ɋ','Q'], + + 'r' : ['r','ŕ','ŗ','ř','ȑ','ȓ','ɍ','ɹ','ɻ','ʳ','ʴ','ʵ','ͬ','ᵣ','ᵲ','ᶉ','ṙ','ṛ','ṝ','ṟ'], + 'R' : ['R','Ŕ','Ŗ','Ř','Ʀ','Ȑ','Ȓ','Ɍ','ʀ','ʁ','ʶ','ᚱ','ᴙ','ᴚ','ᴿ','Ṙ','Ṛ','Ṝ','Ṟ','Ɽ'], + + 's' : ['s','ś','ŝ','ş','š','ș','ʂ','ᔆ','ᶊ','ṡ','ṣ','ṥ','ṧ','ṩ','s'], + 'S' : ['S','Ś','Ŝ','Ş','Š','Ș','ȿ','ˢ','ᵴ','Ṡ','Ṣ','Ṥ','Ṧ','Ṩ','S'], + + 't' : ['t','ţ','ť','ŧ','ƫ','ƭ','ț','ʇ','ͭ','ᵀ','ᵗ','ᵵ','ᶵ','ṫ','ṭ','ṯ','ṱ','ẗ','t'], + 'T' : ['T','Ţ','Ť','Ƭ','Ʈ','Ț','Ⱦ','ᴛ','ᵀ','Ṫ','Ṭ','Ṯ','Ṱ','T'], + + 'u' : ['u','ù','ú','û','ü','ũ','ū','ŭ','ů','ű','ų','ư','ǔ','ǖ','ǘ','ǚ','ǜ','ȕ','ȗ','ͧ','ߎ','ᵘ','ᵤ','ṳ','ṵ','ṷ','ṹ','ṻ','ụ','ủ','ứ','ừ','ử','ữ','ự','u'], + 'U' : ['U','Ù','Ú','Û','Ü','Ũ','Ū','Ŭ','Ů','Ű','Ų','Ư','Ǔ','Ǖ','Ǘ','Ǚ','Ǜ','Ȕ','Ȗ','Ʉ','ᴜ','ᵁ','ᵾ','Ṳ','Ṵ','Ṷ','Ṹ','Ṻ','Ụ','Ủ','Ứ','Ừ','Ử','Ữ','Ự','U'], + + 'v' : ['v','ʋ','ͮ','ᵛ','ᵥ','ᶹ','ṽ','ṿ','ⱱ','v','ⱴ'], + 'V' : ['V','Ʋ','Ʌ','ʌ','ᴠ','ᶌ','Ṽ','Ṿ','V'], + + 'w' : ['w','ŵ','ʷ','ᵂ','ẁ','ẃ','ẅ','ẇ','ẉ','ẘ','ⱳ','w'], + 'W' : ['W','Ŵ','ʍ','ᴡ','Ẁ','Ẃ','Ẅ','Ẇ','Ẉ','Ⱳ','W'], + + 'x' : ['x','̽','͓','ᶍ','ͯ','ẋ','ẍ','ₓ','x'], + 'X' : ['X','ˣ','ͯ','Ẋ','Ẍ','☒','✕','✖','✗','✘','X'], + + 'y' : ['y','ý','ÿ','ŷ','ȳ','ɏ','ʸ','ẏ','ỳ','ỵ','ỷ','ỹ','y'], + 'Y' : ['Y','Ý','Ŷ','Ÿ','Ƴ','ƴ','Ȳ','Ɏ','ʎ','ʏ','Ẏ','Ỳ','Ỵ','Ỷ','Ỹ','Y'], + + 'z' : ['z','ź','ż','ž','ƶ','ȥ','ɀ','ʐ','ʑ','ᙆ','ᙇ','ᶻ','ᶼ','ᶽ','ẑ','ẓ','ẕ','ⱬ','z'], + 'Z' : ['Z','Ź','Ż','Ž','Ƶ','Ȥ','ᴢ','ᵶ','Ẑ','Ẓ','Ẕ','Ⱬ','Z'] + }; + +/* + * Main function of the module which removes all diacritics from the received text + */ +var diacriticless = function (text) { + var result = []; + + // iterate over all the characters of the received text + for(var i=0; i 2 && arguments[2] !== undefined ? arguments[2] : false; + + // take care of nulls + if (typeof rowval === 'undefined' || rowval === null) { + return false; + } // row value + + + var rowValue = skipDiacritics ? String(rowval).toLowerCase() : diacriticless(escapeRegExp(String(rowval)).toLowerCase()); // search term + + var searchTerm = skipDiacritics ? filter.toLowerCase() : diacriticless(escapeRegExp(filter).toLowerCase()); // comparison + + return rowValue.indexOf(searchTerm) > -1; + }, + compare: function compare(x, y) { + function cook(d) { + if (typeof d === 'undefined' || d === null) return ''; + return diacriticless(d.toLowerCase()); + } + + x = cook(x); + y = cook(y); + if (x < y) return -1; + if (x > y) return 1; + return 0; + } +}; + +// +// +// +// +// +// +// +// +// +// +var script = { + name: 'VgtPaginationPageInfo', + props: { + currentPage: { + "default": 1 + }, + lastPage: { + "default": 1 + }, + totalRecords: { + "default": 0 + }, + ofText: { + "default": 'of', + type: String + }, + pageText: { + "default": 'page', + type: String + } + }, + data: function data() { + return {}; + }, + computed: { + pageInfo: function pageInfo() { + return "".concat(this.ofText, " ").concat(this.lastPage); + } + }, + methods: { + changePage: function changePage(event) { + var value = parseInt(event.target.value, 10); //! invalid number + + if (Number.isNaN(value) || value > this.lastPage || value < 1) { + event.target.value = this.currentPage; + return false; + } //* valid number + + + event.target.value = value; + this.$emit('page-changed', value); + } + }, + mounted: function mounted() {}, + components: {} +}; + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier +/* server only */ +, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); + } + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; +} + +var normalizeComponent_1 = normalizeComponent; + +/* script */ +var __vue_script__ = script; +/* template */ + +var __vue_render__ = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('div', { + staticClass: "footer__navigation__page-info" + }, [_vm._v("\n " + _vm._s(_vm.pageText) + " "), _c('input', { + staticClass: "footer__navigation__page-info__current-entry", + attrs: { + "type": "text" + }, + domProps: { + "value": _vm.currentPage + }, + on: { + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + $event.stopPropagation(); + return _vm.changePage($event); + } + } + }), _vm._v(" " + _vm._s(_vm.pageInfo) + "\n")]); +}; + +var __vue_staticRenderFns__ = []; +/* style */ + +var __vue_inject_styles__ = undefined; +/* scoped */ + +var __vue_scope_id__ = "data-v-9a8cd1f4"; +/* module identifier */ + +var __vue_module_identifier__ = undefined; +/* functional template */ + +var __vue_is_functional_template__ = false; +/* style inject */ + +/* style inject SSR */ + +var VgtPaginationPageInfo = normalizeComponent_1({ + render: __vue_render__, + staticRenderFns: __vue_staticRenderFns__ +}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined); + +// +var DEFAULT_ROWS_PER_PAGE_DROPDOWN = [10, 20, 30, 40, 50]; +var script$1 = { + name: 'VgtPagination', + props: { + styleClass: { + "default": 'table table-bordered' + }, + total: { + "default": null + }, + perPage: {}, + rtl: { + "default": false + }, + customRowsPerPageDropdown: { + "default": function _default() { + return []; + } + }, + paginateDropdownAllowAll: { + "default": true + }, + mode: { + "default": 'records' + }, + // text options + nextText: { + "default": 'Next' + }, + prevText: { + "default": 'Prev' + }, + rowsPerPageText: { + "default": 'Rows per page:' + }, + ofText: { + "default": 'of' + }, + pageText: { + "default": 'page' + }, + allText: { + "default": 'All' + } + }, + data: function data() { + return { + currentPage: 1, + prevPage: 0, + currentPerPage: 10, + rowsPerPageOptions: [] + }; + }, + watch: { + perPage: { + handler: function handler(newValue, oldValue) { + this.handlePerPage(); + this.perPageChanged(); + }, + immediate: true + }, + customRowsPerPageDropdown: function customRowsPerPageDropdown() { + this.handlePerPage(); + } + }, + computed: { + // Number of pages + pagesCount: function pagesCount() { + var quotient = Math.floor(this.total / this.currentPerPage); + var remainder = this.total % this.currentPerPage; + return remainder === 0 ? quotient : quotient + 1; + }, + // Current displayed items + paginatedInfo: function paginatedInfo() { + var first = (this.currentPage - 1) * this.currentPerPage + 1; var last = Math.min(this.total, this.currentPage * this.currentPerPage); - if (last === 0) { - first = 0; - } + if (last === 0) { + first = 0; + } + + return "".concat(first, " - ").concat(last, " ").concat(this.ofText, " ").concat(this.total); + }, + // Can go to next page + nextIsPossible: function nextIsPossible() { + return this.currentPage < this.pagesCount; + }, + // Can go to previous page + prevIsPossible: function prevIsPossible() { + return this.currentPage > 1; + } + }, + methods: { + // Change current page + changePage: function changePage(pageNumber) { + var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) { + this.prevPage = this.currentPage; + this.currentPage = pageNumber; + if (emit) this.pageChanged(); + } + }, + // Go to next page + nextPage: function nextPage() { + if (this.nextIsPossible) { + this.prevPage = this.currentPage; + ++this.currentPage; + this.pageChanged(); + } + }, + // Go to previous page + previousPage: function previousPage() { + if (this.prevIsPossible) { + this.prevPage = this.currentPage; + --this.currentPage; + this.pageChanged(); + } + }, + // Indicate page changing + pageChanged: function pageChanged() { + this.$emit('page-changed', { + currentPage: this.currentPage, + prevPage: this.prevPage + }); + }, + // Indicate per page changing + perPageChanged: function perPageChanged() { + // go back to first page + this.$emit('per-page-changed', { + currentPerPage: this.currentPerPage + }); + this.changePage(1, false); + }, + // Handle per page changing + handlePerPage: function handlePerPage() { + //* if there's a custom dropdown then we use that + if (this.customRowsPerPageDropdown !== null && Array.isArray(this.customRowsPerPageDropdown) && this.customRowsPerPageDropdown.length !== 0) { + this.rowsPerPageOptions = this.customRowsPerPageDropdown; + } else { + //* otherwise we use the default rows per page dropdown + this.rowsPerPageOptions = lodash_clonedeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN); + } + + if (this.perPage) { + this.currentPerPage = this.perPage; // if perPage doesn't already exist, we add it + + var found = false; + + for (var i = 0; i < this.rowsPerPageOptions.length; i++) { + if (this.rowsPerPageOptions[i] === this.perPage) { + found = true; + } + } + + if (!found && this.perPage !== -1) { + this.rowsPerPageOptions.unshift(this.perPage); + } + } else { + // reset to default + this.currentPerPage = 10; + } + } + }, + mounted: function mounted() {}, + components: { + 'pagination-page-info': VgtPaginationPageInfo + } +}; + +/* script */ +var __vue_script__$1 = script$1; +/* template */ + +var __vue_render__$1 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('div', { + staticClass: "vgt-wrap__footer vgt-clearfix" + }, [_c('div', { + staticClass: "footer__row-count vgt-pull-left" + }, [_c('span', { + staticClass: "footer__row-count__label" + }, [_vm._v(_vm._s(_vm.rowsPerPageText))]), _vm._v(" "), _c('select', { + directives: [{ + name: "model", + rawName: "v-model", + value: _vm.currentPerPage, + expression: "currentPerPage" + }], + staticClass: "footer__row-count__select", + attrs: { + "autocomplete": "off", + "name": "perPageSelect" + }, + on: { + "change": [function ($event) { + var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) { + return o.selected; + }).map(function (o) { + var val = "_value" in o ? o._value : o.value; + return val; + }); + _vm.currentPerPage = $event.target.multiple ? $$selectedVal : $$selectedVal[0]; + }, _vm.perPageChanged] + } + }, [_vm._l(_vm.rowsPerPageOptions, function (option, idx) { + return _c('option', { + key: 'rows-dropdown-option-' + idx, + domProps: { + "value": option + } + }, [_vm._v("\n " + _vm._s(option) + "\n ")]); + }), _vm._v(" "), _vm.paginateDropdownAllowAll ? _c('option', { + domProps: { + "value": _vm.total + } + }, [_vm._v(_vm._s(_vm.allText))]) : _vm._e()], 2)]), _vm._v(" "), _c('div', { + staticClass: "footer__navigation vgt-pull-right" + }, [_c('a', { + staticClass: "footer__navigation__page-btn", + "class": { + disabled: !_vm.prevIsPossible + }, + attrs: { + "href": "javascript:undefined", + "tabindex": "0" + }, + on: { + "click": function click($event) { + $event.preventDefault(); + $event.stopPropagation(); + return _vm.previousPage($event); + } + } + }, [_c('span', { + staticClass: "chevron", + "class": { + 'left': !_vm.rtl, + 'right': _vm.rtl + } + }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _vm.mode === 'pages' ? _c('pagination-page-info', { + attrs: { + "totalRecords": _vm.total, + "lastPage": _vm.pagesCount, + "currentPage": _vm.currentPage, + "ofText": _vm.ofText, + "pageText": _vm.pageText + }, + on: { + "page-changed": _vm.changePage + } + }) : _c('div', { + staticClass: "footer__navigation__info" + }, [_vm._v(_vm._s(_vm.paginatedInfo))]), _vm._v(" "), _c('a', { + staticClass: "footer__navigation__page-btn", + "class": { + disabled: !_vm.nextIsPossible + }, + attrs: { + "href": "javascript:undefined", + "tabindex": "0" + }, + on: { + "click": function click($event) { + $event.preventDefault(); + $event.stopPropagation(); + return _vm.nextPage($event); + } + } + }, [_c('span', [_vm._v(_vm._s(_vm.nextText))]), _vm._v(" "), _c('span', { + staticClass: "chevron", + "class": { + 'right': !_vm.rtl, + 'left': _vm.rtl + } + })])], 1)]); +}; + +var __vue_staticRenderFns__$1 = []; +/* style */ + +var __vue_inject_styles__$1 = undefined; +/* scoped */ + +var __vue_scope_id__$1 = undefined; +/* module identifier */ + +var __vue_module_identifier__$1 = undefined; +/* functional template */ + +var __vue_is_functional_template__$1 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtPagination = normalizeComponent_1({ + render: __vue_render__$1, + staticRenderFns: __vue_staticRenderFns__$1 +}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, undefined, undefined); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +var script$2 = { + name: 'VgtGlobalSearch', + props: ['value', 'searchEnabled', 'globalSearchPlaceholder'], + data: function data() { + return { + globalSearchTerm: null + }; + }, + computed: { + showControlBar: function showControlBar() { + if (this.searchEnabled) return true; + if (this.$slots && this.$slots['internal-table-actions']) return true; + return false; + } + }, + methods: { + updateValue: function updateValue(value) { + this.$emit('input', value); + this.$emit('on-keyup', value); + }, + entered: function entered(value) { + this.$emit('on-enter', value); + } + } +}; + +/* script */ +var __vue_script__$2 = script$2; +/* template */ + +var __vue_render__$2 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _vm.showControlBar ? _c('div', { + staticClass: "vgt-global-search vgt-clearfix" + }, [_c('div', { + staticClass: "vgt-global-search__input vgt-pull-left" + }, [_vm.searchEnabled ? _c('span', { + staticClass: "input__icon" + }, [_c('div', { + staticClass: "magnifying-glass" + })]) : _vm._e(), _vm._v(" "), _vm.searchEnabled ? _c('input', { + staticClass: "vgt-input vgt-pull-left", + attrs: { + "type": "text", + "placeholder": _vm.globalSearchPlaceholder + }, + domProps: { + "value": _vm.value + }, + on: { + "input": function input($event) { + return _vm.updateValue($event.target.value); + }, + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + return _vm.entered($event.target.value); + } + } + }) : _vm._e()]), _vm._v(" "), _c('div', { + staticClass: "vgt-global-search__actions vgt-pull-right" + }, [_vm._t("internal-table-actions")], 2)]) : _vm._e(); +}; + +var __vue_staticRenderFns__$2 = []; +/* style */ + +var __vue_inject_styles__$2 = undefined; +/* scoped */ + +var __vue_scope_id__$2 = undefined; +/* module identifier */ + +var __vue_module_identifier__$2 = undefined; +/* functional template */ + +var __vue_is_functional_template__$2 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtGlobalSearch = normalizeComponent_1({ + render: __vue_render__$2, + staticRenderFns: __vue_staticRenderFns__$2 +}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, undefined, undefined); + +var script$3 = { + name: 'VgtFilterRow', + props: ['lineNumbers', 'columns', 'typedColumns', 'globalSearchEnabled', 'selectable', 'mode'], + watch: { + columns: { + handler: function handler(newValue, oldValue) { + if (!lodash_isequal(newValue, oldValue)) { + this.populateInitialFilters(); + } + }, + deep: true, + immediate: true + } + }, + data: function data() { + return { + columnFilters: {}, + timer: null + }; + }, + computed: { + // to create a filter row, we need to + // make sure that there is atleast 1 column + // that requires filtering + hasFilterRow: function hasFilterRow() { + // if (this.mode === 'remote' || !this.globalSearchEnabled) { + for (var i = 0; i < this.columns.length; i++) { + var col = this.columns[i]; + + if (col.filterOptions && col.filterOptions.enabled) { + return true; + } + } // } + + + return false; + } + }, + methods: { + reset: function reset() { + var emitEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + this.columnFilters = {}; + + if (emitEvent) { + this.$emit('filter-changed', this.columnFilters); + } + }, + isFilterable: function isFilterable(column) { + return column.filterOptions && column.filterOptions.enabled; + }, + isDropdown: function isDropdown(column) { + return this.isFilterable(column) && column.filterOptions.filterDropdownItems && column.filterOptions.filterDropdownItems.length; + }, + isDropdownObjects: function isDropdownObjects(column) { + return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) === 'object'; + }, + isDropdownArray: function isDropdownArray(column) { + return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) !== 'object'; + }, + // get column's defined placeholder or default one + getPlaceholder: function getPlaceholder(column) { + var placeholder = this.isFilterable(column) && column.filterOptions.placeholder || "Filter ".concat(column.label); + return placeholder; + }, + updateFiltersOnEnter: function updateFiltersOnEnter(column, value) { + if (this.timer) clearTimeout(this.timer); + this.updateFiltersImmediately(column, value); + }, + updateFiltersOnKeyup: function updateFiltersOnKeyup(column, value) { + // if the trigger is enter, we don't filter on keyup + if (column.filterOptions.trigger === 'enter') return; + this.updateFilters(column, value); + }, + // since vue doesn't detect property addition and deletion, we + // need to create helper function to set property etc + updateFilters: function updateFilters(column, value) { + var _this = this; + + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + _this.updateFiltersImmediately(column, value); + }, 400); + }, + updateFiltersImmediately: function updateFiltersImmediately(column, value) { + this.$set(this.columnFilters, column.field, value); + this.$emit('filter-changed', this.columnFilters); + }, + populateInitialFilters: function populateInitialFilters() { + for (var i = 0; i < this.columns.length; i++) { + var col = this.columns[i]; // lets see if there are initial + // filters supplied by user + + if (this.isFilterable(col) && typeof col.filterOptions.filterValue !== 'undefined' && col.filterOptions.filterValue !== null) { + this.$set(this.columnFilters, col.field, col.filterOptions.filterValue); // this.updateFilters(col, col.filterOptions.filterValue); + + this.$set(col.filterOptions, 'filterValue', undefined); + } + } //* lets emit event once all filters are set + + + this.$emit('filter-changed', this.columnFilters); + } + }, + mounted: function mounted() {} +}; + +/* script */ +var __vue_script__$3 = script$3; +/* template */ + +var __vue_render__$3 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _vm.hasFilterRow ? _c('tr', [_vm.lineNumbers ? _c('th') : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th') : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { + return !column.hidden ? _c('th', { + key: index, + staticClass: "filter-th" + }, [_vm.isFilterable(column) ? _c('div', [!_vm.isDropdown(column) ? _c('input', { + staticClass: "vgt-input", + attrs: { + "type": "text", + "placeholder": _vm.getPlaceholder(column) + }, + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "keyup": function keyup($event) { + if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { + return null; + } + + return _vm.updateFiltersOnEnter(column, $event.target.value); + }, + "input": function input($event) { + return _vm.updateFiltersOnKeyup(column, $event.target.value); + } + } + }) : _vm._e(), _vm._v(" "), _vm.isDropdownArray(column) ? _c('select', { + staticClass: "vgt-select", + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "change": function change($event) { + return _vm.updateFilters(column, $event.target.value); + } + } + }, [_c('option', { + key: "-1", + attrs: { + "value": "" + } + }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { + return _c('option', { + key: i, + domProps: { + "value": option + } + }, [_vm._v("\n " + _vm._s(option) + "\n ")]); + })], 2) : _vm._e(), _vm._v(" "), _vm.isDropdownObjects(column) ? _c('select', { + staticClass: "vgt-select", + domProps: { + "value": _vm.columnFilters[column.field] + }, + on: { + "change": function change($event) { + return _vm.updateFilters(column, $event.target.value, true); + } + } + }, [_c('option', { + key: "-1", + attrs: { + "value": "" + } + }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { + return _c('option', { + key: i, + domProps: { + "value": option.value + } + }, [_vm._v(_vm._s(option.text))]); + })], 2) : _vm._e()]) : _vm._e()]) : _vm._e(); + })], 2) : _vm._e(); +}; + +var __vue_staticRenderFns__$3 = []; +/* style */ + +var __vue_inject_styles__$3 = undefined; +/* scoped */ + +var __vue_scope_id__$3 = "data-v-892cc66c"; +/* module identifier */ + +var __vue_module_identifier__$3 = undefined; +/* functional template */ + +var __vue_is_functional_template__$3 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtFilterRow = normalizeComponent_1({ + render: __vue_render__$3, + staticRenderFns: __vue_staticRenderFns__$3 +}, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, undefined, undefined); + +function getNextSort(currentSort) { + if (currentSort === 'asc') return 'desc'; // if (currentSort === 'desc') return null; + + return 'asc'; +} + +function getIndex(sortArray, column) { + for (var i = 0; i < sortArray.length; i++) { + if (column.field === sortArray[i].field) return i; + } + + return -1; +} + +var primarySort = function (sortArray, column) { + if (sortArray.length && sortArray.length === 1 && sortArray[0].field === column.field) { + var type = getNextSort(sortArray[0].type); + + if (type) { + sortArray[0].type = getNextSort(sortArray[0].type); + } else { + sortArray = []; + } + } else { + sortArray = [{ + field: column.field, + type: 'asc' + }]; + } + + return sortArray; +}; + +var secondarySort = function (sortArray, column) { + //* this means that primary sort exists, we're + //* just adding a secondary sort + var index = getIndex(sortArray, column); + + if (index === -1) { + sortArray.push({ + field: column.field, + type: 'asc' + }); + } else { + var type = getNextSort(sortArray[index].type); + + if (type) { + sortArray[index].type = type; + } else { + sortArray.splice(index, 1); + } + } + + return sortArray; +}; + +// +var script$4 = { + name: 'VgtTableHeader', + props: { + lineNumbers: { + "default": false, + type: Boolean + }, + selectable: { + "default": false, + type: Boolean + }, + allSelected: { + "default": false, + type: Boolean + }, + allSelectedIndeterminate: { + "default": false, + type: Boolean + }, + columns: { + type: Array + }, + mode: { + type: String + }, + typedColumns: {}, + //* Sort related + sortable: { + type: Boolean + }, + // sortColumn: { + // type: Number, + // }, + // sortType: { + // type: String, + // }, + // utility functions + // isSortableColumn: { + // type: Function, + // }, + getClasses: { + type: Function + }, + //* search related + searchEnabled: { + type: Boolean + }, + tableRef: {}, + paginated: {} + }, + watch: { + tableRef: { + handler: function handler() { + this.setColumnStyles(); + }, + immediate: true + }, + paginated: { + handler: function handler() { + if (this.tableRef) { + this.setColumnStyles(); + } + }, + deep: true + } + }, + data: function data() { + return { + timer: null, + checkBoxThStyle: {}, + lineNumberThStyle: {}, + columnStyles: [], + sorts: [] + }; + }, + computed: {}, + methods: { + reset: function reset() { + this.$refs['filter-row'].reset(true); + }, + toggleSelectAll: function toggleSelectAll() { + this.$emit('on-toggle-select-all'); + }, + isSortableColumn: function isSortableColumn(column) { + var sortable = column.sortable; + var isSortable = typeof sortable === 'boolean' ? sortable : this.sortable; + return isSortable; + }, + sort: function sort(e, column) { + //* if column is not sortable, return right here + if (!this.isSortableColumn(column)) return; + + if (e.shiftKey) { + this.sorts = secondarySort(this.sorts, column); + } else { + this.sorts = primarySort(this.sorts, column); + } + + this.$emit('on-sort-change', this.sorts); + }, + setInitialSort: function setInitialSort(sorts) { + this.sorts = sorts; + this.$emit('on-sort-change', this.sorts); + }, + getColumnSort: function getColumnSort(column) { + for (var i = 0; i < this.sorts.length; i += 1) { + if (this.sorts[i].field === column.field) { + return this.sorts[i].type || 'asc'; + } + } + + return null; + }, + getHeaderClasses: function getHeaderClasses(column, index) { + var classes = lodash_assign({}, this.getClasses(index, 'th'), { + 'sorting sorting-desc': this.getColumnSort(column) === 'desc', + 'sorting sorting-asc': this.getColumnSort(column) === 'asc' + }); + return classes; + }, + filterRows: function filterRows(columnFilters) { + this.$emit('filter-changed', columnFilters); + }, + getWidthStyle: function getWidthStyle(dom) { + if (window && window.getComputedStyle) { + var cellStyle = window.getComputedStyle(dom, null); + return { + width: cellStyle.width + }; + } + + return { + width: 'auto' + }; + }, + setColumnStyles: function setColumnStyles() { + var _this = this; + + var colStyles = []; + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + for (var i = 0; i < _this.columns.length; i++) { + if (_this.tableRef) { + var skip = 0; + if (_this.selectable) skip++; + if (_this.lineNumbers) skip++; + var cell = _this.tableRef.rows[0].cells[i + skip]; + colStyles.push(_this.getWidthStyle(cell)); + } else { + colStyles.push({ + minWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', + maxWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', + width: _this.columns[i].width ? _this.columns[i].width : 'auto' + }); + } + } + + _this.columnStyles = colStyles; + }, 200); + }, + getColumnStyle: function getColumnStyle(column, index) { + var styleObject = { + minWidth: column.width ? column.width : 'auto', + maxWidth: column.width ? column.width : 'auto', + width: column.width ? column.width : 'auto' + }; //* if fixed header we need to get width from original table + + if (this.tableRef) { + if (this.selectable) index++; + if (this.lineNumbers) index++; + var cell = this.tableRef.rows[0].cells[index]; + var cellStyle = window.getComputedStyle(cell, null); + styleObject.width = cellStyle.width; + } + + return styleObject; + } + }, + mounted: function mounted() { + window.addEventListener('resize', this.setColumnStyles); + }, + beforeDestroy: function beforeDestroy() { + if (this.timer) clearTimeout(this.timer); + window.removeEventListener('resize', this.setColumnStyles); + }, + components: { + 'vgt-filter-row': VgtFilterRow + } +}; + +/* script */ +var __vue_script__$4 = script$4; +/* template */ + +var __vue_render__$4 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('thead', [_c('tr', [_vm.lineNumbers ? _c('th', { + staticClass: "line-numbers" + }) : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th', { + staticClass: "vgt-checkbox-col" + }, [_c('input', { + attrs: { + "type": "checkbox" + }, + domProps: { + "checked": _vm.allSelected, + "indeterminate": _vm.allSelectedIndeterminate + }, + on: { + "change": _vm.toggleSelectAll + } + })]) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { + return !column.hidden ? _c('th', { + key: index, + "class": _vm.getHeaderClasses(column, index), + style: _vm.columnStyles[index], + on: { + "click": function click($event) { + return _vm.sort($event, column); + } + } + }, [_vm._t("table-column", [_c('span', [_vm._v(_vm._s(column.label))])], { + "column": column + })], 2) : _vm._e(); + })], 2), _vm._v(" "), _c("vgt-filter-row", { + ref: "filter-row", + tag: "tr", + attrs: { + "global-search-enabled": _vm.searchEnabled, + "line-numbers": _vm.lineNumbers, + "selectable": _vm.selectable, + "columns": _vm.columns, + "mode": _vm.mode, + "typed-columns": _vm.typedColumns + }, + on: { + "filter-changed": _vm.filterRows + } + })], 1); +}; + +var __vue_staticRenderFns__$4 = []; +/* style */ + +var __vue_inject_styles__$4 = undefined; +/* scoped */ + +var __vue_scope_id__$4 = "data-v-7068df50"; +/* module identifier */ + +var __vue_module_identifier__$4 = undefined; +/* functional template */ + +var __vue_is_functional_template__$4 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtTableHeader = normalizeComponent_1({ + render: __vue_render__$4, + staticRenderFns: __vue_staticRenderFns__$4 +}, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, undefined, undefined); + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +var script$5 = { + name: 'VgtHeaderRow', + props: { + headerRow: { + type: Object + }, + columns: { + type: Array + }, + lineNumbers: { + type: Boolean + }, + selectable: { + type: Boolean + }, + collectFormatted: { + type: Function + }, + formattedRow: { + type: Function + }, + getClasses: { + type: Function + }, + fullColspan: { + type: Number + } + }, + data: function data() { + return {}; + }, + computed: {}, + methods: {}, + mounted: function mounted() {}, + components: {} +}; + +/* script */ +var __vue_script__$5 = script$5; +/* template */ + +var __vue_render__$5 = function __vue_render__() { + var _vm = this; + + var _h = _vm.$createElement; + + var _c = _vm._self._c || _h; + + return _c('tr', [_vm.headerRow.mode === 'span' ? _c('th', { + staticClass: "vgt-left-align vgt-row-header", + attrs: { + "colspan": _vm.fullColspan + } + }, [_vm._t("table-header-row", [_vm.headerRow.html ? _c('span', { + domProps: { + "innerHTML": _vm._s(_vm.headerRow.label) + } + }) : _c('span', [_vm._v("\n " + _vm._s(_vm.headerRow.label) + "\n ")])], { + "row": _vm.headerRow + })], 2) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.lineNumbers ? _c('th', { + staticClass: "vgt-row-header" + }) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.selectable ? _c('th', { + staticClass: "vgt-row-header" + }) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, i) { + return _vm.headerRow.mode !== 'span' && !column.hidden ? _c('th', { + key: i, + staticClass: "vgt-row-header", + "class": _vm.getClasses(i, 'td') + }, [_vm._t("table-header-row", [!column.html ? _c('span', [_vm._v("\n " + _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + "\n ")]) : _vm._e(), _vm._v(" "), column.html ? _c('span', { + domProps: { + "innerHTML": _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + } + }) : _vm._e()], { + "row": _vm.headerRow, + "column": column, + "formattedRow": _vm.formattedRow(_vm.headerRow, true) + })], 2) : _vm._e(); + })], 2); +}; + +var __vue_staticRenderFns__$5 = []; +/* style */ + +var __vue_inject_styles__$5 = undefined; +/* scoped */ + +var __vue_scope_id__$5 = undefined; +/* module identifier */ + +var __vue_module_identifier__$5 = undefined; +/* functional template */ + +var __vue_is_functional_template__$5 = false; +/* style inject */ + +/* style inject SSR */ + +var VgtHeaderRow = normalizeComponent_1({ + render: __vue_render__$5, + staticRenderFns: __vue_staticRenderFns__$5 +}, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, undefined, undefined); + +var MILLISECONDS_IN_HOUR = 3600000; +var MILLISECONDS_IN_MINUTE = 60000; +var DEFAULT_ADDITIONAL_DIGITS = 2; + +var patterns = { + dateTimeDelimeter: /[T ]/, + plainTime: /:/, + + // year tokens + YY: /^(\d{2})$/, + YYY: [ + /^([+-]\d{2})$/, // 0 additional digits + /^([+-]\d{3})$/, // 1 additional digit + /^([+-]\d{4})$/ // 2 additional digits + ], + YYYY: /^(\d{4})/, + YYYYY: [ + /^([+-]\d{4})/, // 0 additional digits + /^([+-]\d{5})/, // 1 additional digit + /^([+-]\d{6})/ // 2 additional digits + ], + + // date tokens + MM: /^-(\d{2})$/, + DDD: /^-?(\d{3})$/, + MMDD: /^-?(\d{2})-?(\d{2})$/, + Www: /^-?W(\d{2})$/, + WwwD: /^-?W(\d{2})-?(\d{1})$/, + + HH: /^(\d{2}([.,]\d*)?)$/, + HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/, + HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/, + + // timezone tokens + timezone: /([Z+-].*)$/, + timezoneZ: /^(Z)$/, + timezoneHH: /^([+-])(\d{2})$/, + timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/ +}; + +/** + * @name toDate + * @category Common Helpers + * @summary Convert the given argument to an instance of Date. + * + * @description + * Convert the given argument to an instance of Date. + * + * If the argument is an instance of Date, the function returns its clone. + * + * If the argument is a number, it is treated as a timestamp. + * + * If an argument is a string, the function tries to parse it. + * Function accepts complete ISO 8601 formats as well as partial implementations. + * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 + * + * If the argument is null, it is treated as an invalid date. + * + * If all above fails, the function passes the given argument to Date constructor. + * + * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`. + * All *date-fns* functions will throw `RangeError` if `options.additionalDigits` is not 0, 1, 2 or undefined. + * + * @param {*} argument - the value to convert + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format + * @returns {Date} the parsed date in the local time zone + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Convert string '2014-02-11T11:30:30' to date: + * var result = toDate('2014-02-11T11:30:30') + * //=> Tue Feb 11 2014 11:30:30 + * + * @example + * // Convert string '+02014101' to date, + * // if the additional number of digits in the extended year format is 1: + * var result = toDate('+02014101', {additionalDigits: 1}) + * //=> Fri Apr 11 2014 00:00:00 + */ +function toDate (argument, dirtyOptions) { + if (arguments.length < 1) { + throw new TypeError('1 argument required, but only ' + arguments.length + ' present') + } + + if (argument === null) { + return new Date(NaN) + } + + var options = dirtyOptions || {}; + + var additionalDigits = options.additionalDigits === undefined ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits); + if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) { + throw new RangeError('additionalDigits must be 0, 1 or 2') + } + + // Clone the date + if (argument instanceof Date) { + // Prevent the date to lose the milliseconds when passed to new Date() in IE10 + return new Date(argument.getTime()) + } else if (typeof argument !== 'string') { + return new Date(argument) + } + + var dateStrings = splitDateString(argument); + + var parseYearResult = parseYear(dateStrings.date, additionalDigits); + var year = parseYearResult.year; + var restDateString = parseYearResult.restDateString; + + var date = parseDate(restDateString, year); + + if (date) { + var timestamp = date.getTime(); + var time = 0; + var offset; + + if (dateStrings.time) { + time = parseTime(dateStrings.time); + } + + if (dateStrings.timezone) { + offset = parseTimezone(dateStrings.timezone); + } else { + // get offset accurate to hour in timezones that change offset + offset = new Date(timestamp + time).getTimezoneOffset(); + offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset(); + } + + return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) + } else { + return new Date(argument) + } +} + +function splitDateString (dateString) { + var dateStrings = {}; + var array = dateString.split(patterns.dateTimeDelimeter); + var timeString; + + if (patterns.plainTime.test(array[0])) { + dateStrings.date = null; + timeString = array[0]; + } else { + dateStrings.date = array[0]; + timeString = array[1]; + } + + if (timeString) { + var token = patterns.timezone.exec(timeString); + if (token) { + dateStrings.time = timeString.replace(token[1], ''); + dateStrings.timezone = token[1]; + } else { + dateStrings.time = timeString; + } + } + + return dateStrings +} + +function parseYear (dateString, additionalDigits) { + var patternYYY = patterns.YYY[additionalDigits]; + var patternYYYYY = patterns.YYYYY[additionalDigits]; + + var token; + + // YYYY or ±YYYYY + token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString); + if (token) { + var yearString = token[1]; + return { + year: parseInt(yearString, 10), + restDateString: dateString.slice(yearString.length) + } + } + + // YY or ±YYY + token = patterns.YY.exec(dateString) || patternYYY.exec(dateString); + if (token) { + var centuryString = token[1]; + return { + year: parseInt(centuryString, 10) * 100, + restDateString: dateString.slice(centuryString.length) + } + } + + // Invalid ISO-formatted year + return { + year: null + } +} + +function parseDate (dateString, year) { + // Invalid ISO-formatted year + if (year === null) { + return null + } + + var token; + var date; + var month; + var week; + + // YYYY + if (dateString.length === 0) { + date = new Date(0); + date.setUTCFullYear(year); + return date + } + + // YYYY-MM + token = patterns.MM.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + date.setUTCFullYear(year, month); + return date + } + + // YYYY-DDD or YYYYDDD + token = patterns.DDD.exec(dateString); + if (token) { + date = new Date(0); + var dayOfYear = parseInt(token[1], 10); + date.setUTCFullYear(year, 0, dayOfYear); + return date + } + + // YYYY-MM-DD or YYYYMMDD + token = patterns.MMDD.exec(dateString); + if (token) { + date = new Date(0); + month = parseInt(token[1], 10) - 1; + var day = parseInt(token[2], 10); + date.setUTCFullYear(year, month, day); + return date + } + + // YYYY-Www or YYYYWww + token = patterns.Www.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + return dayOfISOYear(year, week) + } + + // YYYY-Www-D or YYYYWwwD + token = patterns.WwwD.exec(dateString); + if (token) { + week = parseInt(token[1], 10) - 1; + var dayOfWeek = parseInt(token[2], 10) - 1; + return dayOfISOYear(year, week, dayOfWeek) + } + + // Invalid ISO-formatted date + return null +} + +function parseTime (timeString) { + var token; + var hours; + var minutes; + + // hh + token = patterns.HH.exec(timeString); + if (token) { + hours = parseFloat(token[1].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + } + + // hh:mm or hhmm + token = patterns.HHMM.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseFloat(token[2].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + } + + // hh:mm:ss or hhmmss + token = patterns.HHMMSS.exec(timeString); + if (token) { + hours = parseInt(token[1], 10); + minutes = parseInt(token[2], 10); + var seconds = parseFloat(token[3].replace(',', '.')); + return (hours % 24) * MILLISECONDS_IN_HOUR + + minutes * MILLISECONDS_IN_MINUTE + + seconds * 1000 + } + + // Invalid ISO-formatted time + return null +} + +function parseTimezone (timezoneString) { + var token; + var absoluteOffset; + + // Z + token = patterns.timezoneZ.exec(timezoneString); + if (token) { + return 0 + } + + // ±hh + token = patterns.timezoneHH.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60; + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + // ±hh:mm or ±hhmm + token = patterns.timezoneHHMM.exec(timezoneString); + if (token) { + absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10); + return (token[1] === '+') ? -absoluteOffset : absoluteOffset + } + + return 0 +} + +function dayOfISOYear (isoYear, week, day) { + week = week || 0; + day = day || 0; + var date = new Date(0); + date.setUTCFullYear(isoYear, 0, 4); + var fourthOfJanuaryDay = date.getUTCDay() || 7; + var diff = week * 7 + day + 1 - fourthOfJanuaryDay; + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +/** + * @name addMilliseconds + * @category Millisecond Helpers + * @summary Add the specified number of milliseconds to the given date. + * + * @description + * Add the specified number of milliseconds to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of milliseconds to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the milliseconds added + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 750 milliseconds to 10 July 2014 12:45:30.000: + * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) + * //=> Thu Jul 10 2014 12:45:30.750 + */ +function addMilliseconds (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var timestamp = toDate(dirtyDate, dirtyOptions).getTime(); + var amount = Number(dirtyAmount); + return new Date(timestamp + amount) +} + +function cloneObject (dirtyObject) { + dirtyObject = dirtyObject || {}; + var object = {}; + + for (var property in dirtyObject) { + if (dirtyObject.hasOwnProperty(property)) { + object[property] = dirtyObject[property]; + } + } + + return object +} + +var MILLISECONDS_IN_MINUTE$1 = 60000; + +/** + * @name addMinutes + * @category Minute Helpers + * @summary Add the specified number of minutes to the given date. + * + * @description + * Add the specified number of minutes to the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be added + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the minutes added + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Add 30 minutes to 10 July 2014 12:00:00: + * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 12:30:00 + */ +function addMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var amount = Number(dirtyAmount); + return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE$1, dirtyOptions) +} + +/** + * @name compareAsc + * @category Common Helpers + * @summary Compare the two dates and return -1, 0 or 1. + * + * @description + * Compare the two dates and return 1 if the first date is after the second, + * -1 if the first date is before the second or 0 if dates are equal. + * + * @param {Date|String|Number} dateLeft - the first date to compare + * @param {Date|String|Number} dateRight - the second date to compare + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Number} the result of the comparison + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Compare 11 February 1987 and 10 July 1989: + * var result = compareAsc( + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ) + * //=> -1 + * + * @example + * // Sort the array of dates: + * var result = [ + * new Date(1995, 6, 2), + * new Date(1987, 1, 11), + * new Date(1989, 6, 10) + * ].sort(compareAsc) + * //=> [ + * // Wed Feb 11 1987 00:00:00, + * // Mon Jul 10 1989 00:00:00, + * // Sun Jul 02 1995 00:00:00 + * // ] + */ +function compareAsc (dirtyDateLeft, dirtyDateRight, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var dateLeft = toDate(dirtyDateLeft, dirtyOptions); + var dateRight = toDate(dirtyDateRight, dirtyOptions); + + var diff = dateLeft.getTime() - dateRight.getTime(); + + if (diff < 0) { + return -1 + } else if (diff > 0) { + return 1 + // Return 0 if diff is 0; return NaN if diff is NaN + } else { + return diff + } +} + +/** + * @name isValid + * @category Common Helpers + * @summary Is the given date valid? + * + * @description + * Returns false if argument is Invalid Date and true otherwise. + * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * Invalid Date is a Date, whose time value is NaN. + * + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {*} date - the date to check + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Boolean} the date is valid + * @throws {TypeError} 1 argument required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // For the valid date: + * var result = isValid(new Date(2014, 1, 31)) + * //=> true + * + * @example + * // For the value, convertable into a date: + * var result = isValid('2014-02-31') + * //=> true + * + * @example + * // For the invalid date: + * var result = isValid(new Date('')) + * //=> false + */ +function isValid (dirtyDate, dirtyOptions) { + if (arguments.length < 1) { + throw new TypeError('1 argument required, but only ' + arguments.length + ' present') + } + + var date = toDate(dirtyDate, dirtyOptions); + return !isNaN(date) +} + +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'less than a second', + other: 'less than {{count}} seconds' + }, + + xSeconds: { + one: '1 second', + other: '{{count}} seconds' + }, + + halfAMinute: 'half a minute', + + lessThanXMinutes: { + one: 'less than a minute', + other: 'less than {{count}} minutes' + }, + + xMinutes: { + one: '1 minute', + other: '{{count}} minutes' + }, + + aboutXHours: { + one: 'about 1 hour', + other: 'about {{count}} hours' + }, + + xHours: { + one: '1 hour', + other: '{{count}} hours' + }, + + xDays: { + one: '1 day', + other: '{{count}} days' + }, - return "".concat(first, " - ").concat(last, " ").concat(this.ofText, " ").concat(this.total); - }, - // Can go to next page - nextIsPossible: function nextIsPossible() { - return this.currentPage < this.pagesCount; - }, - // Can go to previous page - prevIsPossible: function prevIsPossible() { - return this.currentPage > 1; + aboutXMonths: { + one: 'about 1 month', + other: 'about {{count}} months' + }, + + xMonths: { + one: '1 month', + other: '{{count}} months' + }, + + aboutXYears: { + one: 'about 1 year', + other: 'about {{count}} years' + }, + + xYears: { + one: '1 year', + other: '{{count}} years' + }, + + overXYears: { + one: 'over 1 year', + other: 'over {{count}} years' + }, + + almostXYears: { + one: 'almost 1 year', + other: 'almost {{count}} years' + } +}; + +function formatDistance (token, count, options) { + options = options || {}; + + var result; + if (typeof formatDistanceLocale[token] === 'string') { + result = formatDistanceLocale[token]; + } else if (count === 1) { + result = formatDistanceLocale[token].one; + } else { + result = formatDistanceLocale[token].other.replace('{{count}}', count); + } + + if (options.addSuffix) { + if (options.comparison > 0) { + return 'in ' + result + } else { + return result + ' ago' + } + } + + return result +} + +var tokensToBeShortedPattern = /MMMM|MM|DD|dddd/g; + +function buildShortLongFormat (format) { + return format.replace(tokensToBeShortedPattern, function (token) { + return token.slice(1) + }) +} + +/** + * @name buildFormatLongFn + * @category Locale Helpers + * @summary Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * + * @description + * Build `formatLong` property for locale used by `format`, `formatRelative` and `parse` functions. + * Returns a function which takes one of the following tokens as the argument: + * `'LTS'`, `'LT'`, `'L'`, `'LL'`, `'LLL'`, `'l'`, `'ll'`, `'lll'`, `'llll'` + * and returns a long format string written as `format` token strings. + * See [format]{@link https://date-fns.org/docs/format} + * + * `'l'`, `'ll'`, `'lll'` and `'llll'` formats are built automatically + * by shortening some of the tokens from corresponding unshortened formats + * (e.g., if `LL` is `'MMMM DD YYYY'` then `ll` will be `MMM D YYYY`) + * + * @param {Object} obj - the object with long formats written as `format` token strings + * @param {String} obj.LT - time format: hours and minutes + * @param {String} obj.LTS - time format: hours, minutes and seconds + * @param {String} obj.L - short date format: numeric day, month and year + * @param {String} [obj.l] - short date format: numeric day, month and year (shortened) + * @param {String} obj.LL - long date format: day, month in words, and year + * @param {String} [obj.ll] - long date format: day, month in words, and year (shortened) + * @param {String} obj.LLL - long date and time format + * @param {String} [obj.lll] - long date and time format (shortened) + * @param {String} obj.LLLL - long date, time and weekday format + * @param {String} [obj.llll] - long date, time and weekday format (shortened) + * @returns {Function} `formatLong` property of the locale + * + * @example + * // For `en-US` locale: + * locale.formatLong = buildFormatLongFn({ + * LT: 'h:mm aa', + * LTS: 'h:mm:ss aa', + * L: 'MM/DD/YYYY', + * LL: 'MMMM D YYYY', + * LLL: 'MMMM D YYYY h:mm aa', + * LLLL: 'dddd, MMMM D YYYY h:mm aa' + * }) + */ +function buildFormatLongFn (obj) { + var formatLongLocale = { + LTS: obj.LTS, + LT: obj.LT, + L: obj.L, + LL: obj.LL, + LLL: obj.LLL, + LLLL: obj.LLLL, + l: obj.l || buildShortLongFormat(obj.L), + ll: obj.ll || buildShortLongFormat(obj.LL), + lll: obj.lll || buildShortLongFormat(obj.LLL), + llll: obj.llll || buildShortLongFormat(obj.LLLL) + }; + + return function (token) { + return formatLongLocale[token] + } +} + +var formatLong = buildFormatLongFn({ + LT: 'h:mm aa', + LTS: 'h:mm:ss aa', + L: 'MM/DD/YYYY', + LL: 'MMMM D YYYY', + LLL: 'MMMM D YYYY h:mm aa', + LLLL: 'dddd, MMMM D YYYY h:mm aa' +}); + +var formatRelativeLocale = { + lastWeek: '[last] dddd [at] LT', + yesterday: '[yesterday at] LT', + today: '[today at] LT', + tomorrow: '[tomorrow at] LT', + nextWeek: 'dddd [at] LT', + other: 'L' +}; + +function formatRelative (token, date, baseDate, options) { + return formatRelativeLocale[token] +} + +/** + * @name buildLocalizeFn + * @category Locale Helpers + * @summary Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale. + * + * @description + * Build `localize.weekday`, `localize.month` and `localize.timeOfDay` properties for the locale + * used by `format` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * `localize.weekday` function takes the weekday index as argument (0 - Sunday). + * `localize.month` takes the month index (0 - January). + * `localize.timeOfDay` takes the hours. Use `indexCallback` to convert them to an array index (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @param {Function} [indexCallback] - the callback which takes the resulting function argument + * and converts it into value array index + * @returns {Function} the resulting function + * + * @example + * var timeOfDayValues = { + * uppercase: ['AM', 'PM'], + * lowercase: ['am', 'pm'], + * long: ['a.m.', 'p.m.'] + * } + * locale.localize.timeOfDay = buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + * // 0 is a.m. array index, 1 is p.m. array index + * return (hours / 12) >= 1 ? 1 : 0 + * }) + * locale.localize.timeOfDay(16, {type: 'uppercase'}) //=> 'PM' + * locale.localize.timeOfDay(5) //=> 'a.m.' + */ +function buildLocalizeFn (values, defaultType, indexCallback) { + return function (dirtyIndex, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var valuesArray = values[type] || values[defaultType]; + var index = indexCallback ? indexCallback(Number(dirtyIndex)) : Number(dirtyIndex); + return valuesArray[index] + } +} + +/** + * @name buildLocalizeArrayFn + * @category Locale Helpers + * @summary Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * + * @description + * Build `localize.weekdays`, `localize.months` and `localize.timesOfDay` properties for the locale. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * + * @param {Object} values - the object with arrays of values + * @param {String} defaultType - the default type for the localize function + * @returns {Function} the resulting function + * + * @example + * var weekdayValues = { + * narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + * short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + * long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] + * } + * locale.localize.weekdays = buildLocalizeArrayFn(weekdayValues, 'long') + * locale.localize.weekdays({type: 'narrow'}) //=> ['Su', 'Mo', ...] + * locale.localize.weekdays() //=> ['Sunday', 'Monday', ...] + */ +function buildLocalizeArrayFn (values, defaultType) { + return function (dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + return values[type] || values[defaultType] + } +} + +// Note: in English, the names of days of the week and months are capitalized. +// If you are making a new locale based on this one, check if the same is true for the language you're working on. +// Generally, formatted dates should look like they are in the middle of a sentence, +// e.g. in Spanish language the weekdays and months should be in the lowercase. +var weekdayValues = { + narrow: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + long: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] +}; + +var monthValues = { + short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var timeOfDayValues = { +// any: ['in the night', 'in the morning', 'in the afternoon', 'in the evening'] +// } +// +// And later: +// +// var localize = { +// // The callback takes the hours as the argument and returns the array index +// timeOfDay: buildLocalizeFn(timeOfDayValues, 'any', function (hours) { +// if (hours >= 17) { +// return 3 +// } else if (hours >= 12) { +// return 2 +// } else if (hours >= 4) { +// return 1 +// } else { +// return 0 +// } +// }), +// timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'any') +// } +var timeOfDayValues = { + uppercase: ['AM', 'PM'], + lowercase: ['am', 'pm'], + long: ['a.m.', 'p.m.'] +}; + +function ordinalNumber (dirtyNumber, dirtyOptions) { + var number = Number(dirtyNumber); + + // If ordinal numbers depend on context, for example, + // if they are different for different grammatical genders, + // use `options.unit`: + // + // var options = dirtyOptions || {} + // var unit = String(options.unit) + // + // where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear', + // 'dayOfMonth' or 'dayOfWeek' + + var rem100 = number % 100; + if (rem100 > 20 || rem100 < 10) { + switch (rem100 % 10) { + case 1: + return number + 'st' + case 2: + return number + 'nd' + case 3: + return number + 'rd' + } + } + return number + 'th' +} + +var localize = { + ordinalNumber: ordinalNumber, + weekday: buildLocalizeFn(weekdayValues, 'long'), + weekdays: buildLocalizeArrayFn(weekdayValues, 'long'), + month: buildLocalizeFn(monthValues, 'long'), + months: buildLocalizeArrayFn(monthValues, 'long'), + timeOfDay: buildLocalizeFn(timeOfDayValues, 'long', function (hours) { + return (hours / 12) >= 1 ? 1 : 0 + }), + timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'long') +}; + +/** + * @name buildMatchFn + * @category Locale Helpers + * @summary Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale. + * + * @description + * Build `match.weekdays`, `match.months` and `match.timesOfDay` properties for the locale used by `parse` function. + * If no `type` is supplied to the options of the resulting function, `defaultType` will be used (see example). + * The result of the match function will be passed into corresponding parser function + * (`match.weekday`, `match.month` or `match.timeOfDay` respectively. See `buildParseFn`). + * + * @param {Object} values - the object with RegExps + * @param {String} defaultType - the default type for the match function + * @returns {Function} the resulting function + * + * @example + * var matchWeekdaysPatterns = { + * narrow: /^(su|mo|tu|we|th|fr|sa)/i, + * short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + * long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i + * } + * locale.match.weekdays = buildMatchFn(matchWeekdaysPatterns, 'long') + * locale.match.weekdays('Sunday', {type: 'narrow'}) //=> ['Su', 'Su', ...] + * locale.match.weekdays('Sunday') //=> ['Sunday', 'Sunday', ...] + */ +function buildMatchFn (patterns, defaultType) { + return function (dirtyString, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var pattern = patterns[type] || patterns[defaultType]; + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name buildParseFn + * @category Locale Helpers + * @summary Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale. + * + * @description + * Build `match.weekday`, `match.month` and `match.timeOfDay` properties for the locale used by `parse` function. + * The argument of the resulting function is the result of the corresponding match function + * (`match.weekdays`, `match.months` or `match.timesOfDay` respectively. See `buildMatchFn`). + * + * @param {Object} values - the object with arrays of RegExps + * @param {String} defaultType - the default type for the parser function + * @returns {Function} the resulting function + * + * @example + * var parseWeekdayPatterns = { + * any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] + * } + * locale.match.weekday = buildParseFn(matchWeekdaysPatterns, 'long') + * var matchResult = locale.match.weekdays('Friday') + * locale.match.weekday(matchResult) //=> 5 + */ +function buildParseFn (patterns, defaultType) { + return function (matchResult, dirtyOptions) { + var options = dirtyOptions || {}; + var type = options.type ? String(options.type) : defaultType; + var patternsArray = patterns[type] || patterns[defaultType]; + var string = matchResult[1]; + + return patternsArray.findIndex(function (pattern) { + return pattern.test(string) + }) + } +} + +/** + * @name buildMatchPatternFn + * @category Locale Helpers + * @summary Build match function from a single RegExp. + * + * @description + * Build match function from a single RegExp. + * Usually used for building `match.ordinalNumbers` property of the locale. + * + * @param {Object} pattern - the RegExp + * @returns {Function} the resulting function + * + * @example + * locale.match.ordinalNumbers = buildMatchPatternFn(/^(\d+)(th|st|nd|rd)?/i) + * locale.match.ordinalNumbers('3rd') //=> ['3rd', '3', 'rd', ...] + */ +function buildMatchPatternFn (pattern) { + return function (dirtyString) { + var string = String(dirtyString); + return string.match(pattern) + } +} + +/** + * @name parseDecimal + * @category Locale Helpers + * @summary Parses the match result into decimal number. + * + * @description + * Parses the match result into decimal number. + * Uses the string matched with the first set of parentheses of match RegExp. + * + * @param {Array} matchResult - the object returned by matching function + * @returns {Number} the parsed value + * + * @example + * locale.match = { + * ordinalNumbers: (dirtyString) { + * return String(dirtyString).match(/^(\d+)(th|st|nd|rd)?/i) + * }, + * ordinalNumber: parseDecimal + * } + */ +function parseDecimal (matchResult) { + return parseInt(matchResult[1], 10) +} + +var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i; + +var matchWeekdaysPatterns = { + narrow: /^(su|mo|tu|we|th|fr|sa)/i, + short: /^(sun|mon|tue|wed|thu|fri|sat)/i, + long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i +}; + +var parseWeekdayPatterns = { + any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] +}; + +var matchMonthsPatterns = { + short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, + long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i +}; + +var parseMonthPatterns = { + any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i] +}; + +// `timeOfDay` is used to designate which part of the day it is, when used with 12-hour clock. +// Use the system which is used the most commonly in the locale. +// For example, if the country doesn't use a.m./p.m., you can use `night`/`morning`/`afternoon`/`evening`: +// +// var matchTimesOfDayPatterns = { +// long: /^((in the)? (night|morning|afternoon|evening?))/i +// } +// +// var parseTimeOfDayPatterns = { +// any: [/(night|morning)/i, /(afternoon|evening)/i] +// } +var matchTimesOfDayPatterns = { + short: /^(am|pm)/i, + long: /^([ap]\.?\s?m\.?)/i +}; + +var parseTimeOfDayPatterns = { + any: [/^a/i, /^p/i] +}; + +var match = { + ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern), + ordinalNumber: parseDecimal, + weekdays: buildMatchFn(matchWeekdaysPatterns, 'long'), + weekday: buildParseFn(parseWeekdayPatterns, 'any'), + months: buildMatchFn(matchMonthsPatterns, 'long'), + month: buildParseFn(parseMonthPatterns, 'any'), + timesOfDay: buildMatchFn(matchTimesOfDayPatterns, 'long'), + timeOfDay: buildParseFn(parseTimeOfDayPatterns, 'any') +}; + +/** + * @type {Locale} + * @category Locales + * @summary English locale (United States). + * @language English + * @iso-639-2 eng + */ +var locale = { + formatDistance: formatDistance, + formatLong: formatLong, + formatRelative: formatRelative, + localize: localize, + match: match, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1 + } +}; + +var MILLISECONDS_IN_DAY = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCDayOfYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var timestamp = date.getTime(); + date.setUTCMonth(0, 1); + date.setUTCHours(0, 0, 0, 0); + var startOfYearTimestamp = date.getTime(); + var difference = timestamp - startOfYearTimestamp; + return Math.floor(difference / MILLISECONDS_IN_DAY) + 1 +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeek (dirtyDate, dirtyOptions) { + var weekStartsOn = 1; + + var date = toDate(dirtyDate, dirtyOptions); + var day = date.getUTCDay(); + var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; + + date.setUTCDate(date.getUTCDate() - diff); + date.setUTCHours(0, 0, 0, 0); + return date +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeekYear (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var year = date.getUTCFullYear(); + + var fourthOfJanuaryOfNextYear = new Date(0); + fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); + fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); + var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear, dirtyOptions); + + var fourthOfJanuaryOfThisYear = new Date(0); + fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); + fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); + var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear, dirtyOptions); + + if (date.getTime() >= startOfNextYear.getTime()) { + return year + 1 + } else if (date.getTime() >= startOfThisYear.getTime()) { + return year + } else { + return year - 1 + } +} + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function startOfUTCISOWeekYear (dirtyDate, dirtyOptions) { + var year = getUTCISOWeekYear(dirtyDate, dirtyOptions); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(year, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + var date = startOfUTCISOWeek(fourthOfJanuary, dirtyOptions); + return date +} + +var MILLISECONDS_IN_WEEK = 604800000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function getUTCISOWeek (dirtyDate, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var diff = startOfUTCISOWeek(date, dirtyOptions).getTime() - startOfUTCISOWeekYear(date, dirtyOptions).getTime(); + + // Round the number of days to the nearest integer + // because the number of milliseconds in a week is not constant + // (e.g. it's different in the week of the daylight saving time clock shift) + return Math.round(diff / MILLISECONDS_IN_WEEK) + 1 +} + +var formatters = { + // Month: 1, 2, ..., 12 + 'M': function (date) { + return date.getUTCMonth() + 1 + }, + + // Month: 1st, 2nd, ..., 12th + 'Mo': function (date, options) { + var month = date.getUTCMonth() + 1; + return options.locale.localize.ordinalNumber(month, {unit: 'month'}) + }, + + // Month: 01, 02, ..., 12 + 'MM': function (date) { + return addLeadingZeros(date.getUTCMonth() + 1, 2) + }, + + // Month: Jan, Feb, ..., Dec + 'MMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'short'}) + }, + + // Month: January, February, ..., December + 'MMMM': function (date, options) { + return options.locale.localize.month(date.getUTCMonth(), {type: 'long'}) + }, + + // Quarter: 1, 2, 3, 4 + 'Q': function (date) { + return Math.ceil((date.getUTCMonth() + 1) / 3) + }, + + // Quarter: 1st, 2nd, 3rd, 4th + 'Qo': function (date, options) { + var quarter = Math.ceil((date.getUTCMonth() + 1) / 3); + return options.locale.localize.ordinalNumber(quarter, {unit: 'quarter'}) + }, + + // Day of month: 1, 2, ..., 31 + 'D': function (date) { + return date.getUTCDate() + }, + + // Day of month: 1st, 2nd, ..., 31st + 'Do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDate(), {unit: 'dayOfMonth'}) + }, + + // Day of month: 01, 02, ..., 31 + 'DD': function (date) { + return addLeadingZeros(date.getUTCDate(), 2) + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': function (date) { + return getUTCDayOfYear(date) + }, + + // Day of year: 1st, 2nd, ..., 366th + 'DDDo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCDayOfYear(date), {unit: 'dayOfYear'}) + }, + + // Day of year: 001, 002, ..., 366 + 'DDDD': function (date) { + return addLeadingZeros(getUTCDayOfYear(date), 3) + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'narrow'}) + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'short'}) + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': function (date, options) { + return options.locale.localize.weekday(date.getUTCDay(), {type: 'long'}) + }, + + // Day of week: 0, 1, ..., 6 + 'd': function (date) { + return date.getUTCDay() + }, + + // Day of week: 0th, 1st, 2nd, ..., 6th + 'do': function (date, options) { + return options.locale.localize.ordinalNumber(date.getUTCDay(), {unit: 'dayOfWeek'}) + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': function (date) { + return date.getUTCDay() || 7 + }, + + // ISO week: 1, 2, ..., 53 + 'W': function (date) { + return getUTCISOWeek(date) + }, + + // ISO week: 1st, 2nd, ..., 53th + 'Wo': function (date, options) { + return options.locale.localize.ordinalNumber(getUTCISOWeek(date), {unit: 'isoWeek'}) + }, + + // ISO week: 01, 02, ..., 53 + 'WW': function (date) { + return addLeadingZeros(getUTCISOWeek(date), 2) + }, + + // Year: 00, 01, ..., 99 + 'YY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4).substr(2) + }, + + // Year: 1900, 1901, ..., 2099 + 'YYYY': function (date) { + return addLeadingZeros(date.getUTCFullYear(), 4) + }, + + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': function (date) { + return String(getUTCISOWeekYear(date)).substr(2) + }, + + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': function (date) { + return getUTCISOWeekYear(date) + }, + + // Hour: 0, 1, ... 23 + 'H': function (date) { + return date.getUTCHours() + }, + + // Hour: 00, 01, ..., 23 + 'HH': function (date) { + return addLeadingZeros(date.getUTCHours(), 2) + }, + + // Hour: 1, 2, ..., 12 + 'h': function (date) { + var hours = date.getUTCHours(); + if (hours === 0) { + return 12 + } else if (hours > 12) { + return hours % 12 + } else { + return hours } }, - methods: { - // Change current page - changePage: function changePage(pageNumber) { - var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - if (pageNumber > 0 && this.total > this.currentPerPage * (pageNumber - 1)) { - this.prevPage = this.currentPage; - this.currentPage = pageNumber; - if (emit) this.pageChanged(); - } - }, - // Go to next page - nextPage: function nextPage() { - if (this.nextIsPossible) { - this.prevPage = this.currentPage; - ++this.currentPage; - this.pageChanged(); - } - }, - // Go to previous page - previousPage: function previousPage() { - if (this.prevIsPossible) { - this.prevPage = this.currentPage; - --this.currentPage; - this.pageChanged(); - } - }, - // Indicate page changing - pageChanged: function pageChanged() { - this.$emit('page-changed', { - currentPage: this.currentPage, - prevPage: this.prevPage - }); - }, - // Indicate per page changing - perPageChanged: function perPageChanged() { - // go back to first page - this.$emit('per-page-changed', { - currentPerPage: this.currentPerPage - }); - this.changePage(1, false); - }, - // Handle per page changing - handlePerPage: function handlePerPage() { - //* if there's a custom dropdown then we use that - if (this.customRowsPerPageDropdown !== null && Array.isArray(this.customRowsPerPageDropdown) && this.customRowsPerPageDropdown.length !== 0) { - this.rowsPerPageOptions = this.customRowsPerPageDropdown; - } else { - //* otherwise we use the default rows per page dropdown - this.rowsPerPageOptions = cloneDeep(DEFAULT_ROWS_PER_PAGE_DROPDOWN); - } + // Hour: 01, 02, ..., 12 + 'hh': function (date) { + return addLeadingZeros(formatters['h'](date), 2) + }, + + // Minute: 0, 1, ..., 59 + 'm': function (date) { + return date.getUTCMinutes() + }, + + // Minute: 00, 01, ..., 59 + 'mm': function (date) { + return addLeadingZeros(date.getUTCMinutes(), 2) + }, + + // Second: 0, 1, ..., 59 + 's': function (date) { + return date.getUTCSeconds() + }, + + // Second: 00, 01, ..., 59 + 'ss': function (date) { + return addLeadingZeros(date.getUTCSeconds(), 2) + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': function (date) { + return Math.floor(date.getUTCMilliseconds() / 100) + }, + + // 1/100 of second: 00, 01, ..., 99 + 'SS': function (date) { + return addLeadingZeros(Math.floor(date.getUTCMilliseconds() / 10), 2) + }, + + // Millisecond: 000, 001, ..., 999 + 'SSS': function (date) { + return addLeadingZeros(date.getUTCMilliseconds(), 3) + }, + + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset(), ':') + }, - if (this.perPage) { - this.currentPerPage = this.perPage; // if perPage doesn't already exist, we add it + // Timezone: -0100, +0000, ... +1200 + 'ZZ': function (date, options) { + var originalDate = options._originalDate || date; + return formatTimezone(originalDate.getTimezoneOffset()) + }, - var found = false; + // Seconds timestamp: 512969520 + 'X': function (date, options) { + var originalDate = options._originalDate || date; + return Math.floor(originalDate.getTime() / 1000) + }, - for (var i = 0; i < this.rowsPerPageOptions.length; i++) { - if (this.rowsPerPageOptions[i] === this.perPage) { - found = true; - } - } + // Milliseconds timestamp: 512969520900 + 'x': function (date, options) { + var originalDate = options._originalDate || date; + return originalDate.getTime() + }, - if (!found && this.perPage !== -1) { - this.rowsPerPageOptions.unshift(this.perPage); - } - } else { - // reset to default - this.currentPerPage = 10; - } - } + // AM, PM + 'A': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'uppercase'}) }, - mounted: function mounted() {}, - components: { - 'pagination-page-info': VgtPaginationPageInfo + + // am, pm + 'a': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'lowercase'}) + }, + + // a.m., p.m. + 'aa': function (date, options) { + return options.locale.localize.timeOfDay(date.getUTCHours(), {type: 'long'}) } }; -/* script */ -var __vue_script__$1 = script$1; -/* template */ - -var __vue_render__$1 = function __vue_render__() { - var _vm = this; +function formatTimezone (offset, delimeter) { + delimeter = delimeter || ''; + var sign = offset > 0 ? '-' : '+'; + var absOffset = Math.abs(offset); + var hours = Math.floor(absOffset / 60); + var minutes = absOffset % 60; + return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) +} - var _h = _vm.$createElement; +function addLeadingZeros (number, targetLength) { + var output = Math.abs(number).toString(); + while (output.length < targetLength) { + output = '0' + output; + } + return output +} - var _c = _vm._self._c || _h; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function addUTCMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var amount = Number(dirtyAmount); + date.setUTCMinutes(date.getUTCMinutes() + amount); + return date +} - return _c('div', { - staticClass: "vgt-wrap__footer vgt-clearfix" - }, [_c('div', { - staticClass: "footer__row-count vgt-pull-left" - }, [_c('span', { - staticClass: "footer__row-count__label" - }, [_vm._v(_vm._s(_vm.rowsPerPageText))]), _vm._v(" "), _c('select', { - directives: [{ - name: "model", - rawName: "v-model", - value: _vm.currentPerPage, - expression: "currentPerPage" - }], - staticClass: "footer__row-count__select", - attrs: { - "autocomplete": "off", - "name": "perPageSelect" - }, - on: { - "change": [function ($event) { - var $$selectedVal = Array.prototype.filter.call($event.target.options, function (o) { - return o.selected; - }).map(function (o) { - var val = "_value" in o ? o._value : o.value; - return val; - }); - _vm.currentPerPage = $event.target.multiple ? $$selectedVal : $$selectedVal[0]; - }, _vm.perPageChanged] - } - }, [_vm._l(_vm.rowsPerPageOptions, function (option, idx) { - return _c('option', { - key: 'rows-dropdown-option-' + idx, - domProps: { - "value": option - } - }, [_vm._v("\n " + _vm._s(option) + "\n ")]); - }), _vm._v(" "), _vm.paginateDropdownAllowAll ? _c('option', { - domProps: { - "value": _vm.total - } - }, [_vm._v(_vm._s(_vm.allText))]) : _vm._e()], 2)]), _vm._v(" "), _c('div', { - staticClass: "footer__navigation vgt-pull-right" - }, [_c('a', { - staticClass: "footer__navigation__page-btn", - "class": { - disabled: !_vm.prevIsPossible - }, - attrs: { - "href": "javascript:undefined", - "tabindex": "0" - }, - on: { - "click": function click($event) { - $event.preventDefault(); - $event.stopPropagation(); - return _vm.previousPage($event); - } - } - }, [_c('span', { - staticClass: "chevron", - "class": { - 'left': !_vm.rtl, - 'right': _vm.rtl - } - }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.prevText))])]), _vm._v(" "), _vm.mode === 'pages' ? _c('pagination-page-info', { - attrs: { - "totalRecords": _vm.total, - "lastPage": _vm.pagesCount, - "currentPage": _vm.currentPage, - "ofText": _vm.ofText, - "pageText": _vm.pageText - }, - on: { - "page-changed": _vm.changePage - } - }) : _c('div', { - staticClass: "footer__navigation__info" - }, [_vm._v(_vm._s(_vm.paginatedInfo))]), _vm._v(" "), _c('a', { - staticClass: "footer__navigation__page-btn", - "class": { - disabled: !_vm.nextIsPossible - }, - attrs: { - "href": "javascript:undefined", - "tabindex": "0" - }, - on: { - "click": function click($event) { - $event.preventDefault(); - $event.stopPropagation(); - return _vm.nextPage($event); - } - } - }, [_c('span', [_vm._v(_vm._s(_vm.nextText))]), _vm._v(" "), _c('span', { - staticClass: "chevron", - "class": { - 'right': !_vm.rtl, - 'left': _vm.rtl - } - })])], 1)]); -}; +var longFormattingTokensRegExp = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultFormattingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; -var __vue_staticRenderFns__$1 = []; -/* style */ +/** + * @name format + * @category Common Helpers + * @summary Format the date. + * + * @description + * Return the formatted date string in the given format. + * + * Accepted tokens: + * | Unit | Token | Result examples | + * |-------------------------|-------|----------------------------------| + * | Month | M | 1, 2, ..., 12 | + * | | Mo | 1st, 2nd, ..., 12th | + * | | MM | 01, 02, ..., 12 | + * | | MMM | Jan, Feb, ..., Dec | + * | | MMMM | January, February, ..., December | + * | Quarter | Q | 1, 2, 3, 4 | + * | | Qo | 1st, 2nd, 3rd, 4th | + * | Day of month | D | 1, 2, ..., 31 | + * | | Do | 1st, 2nd, ..., 31st | + * | | DD | 01, 02, ..., 31 | + * | Day of year | DDD | 1, 2, ..., 366 | + * | | DDDo | 1st, 2nd, ..., 366th | + * | | DDDD | 001, 002, ..., 366 | + * | Day of week | d | 0, 1, ..., 6 | + * | | do | 0th, 1st, ..., 6th | + * | | dd | Su, Mo, ..., Sa | + * | | ddd | Sun, Mon, ..., Sat | + * | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | E | 1, 2, ..., 7 | + * | ISO week | W | 1, 2, ..., 53 | + * | | Wo | 1st, 2nd, ..., 53rd | + * | | WW | 01, 02, ..., 53 | + * | Year | YY | 00, 01, ..., 99 | + * | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | GG | 00, 01, ..., 99 | + * | | GGGG | 1900, 1901, ..., 2099 | + * | AM/PM | A | AM, PM | + * | | a | am, pm | + * | | aa | a.m., p.m. | + * | Hour | H | 0, 1, ... 23 | + * | | HH | 00, 01, ... 23 | + * | | h | 1, 2, ..., 12 | + * | | hh | 01, 02, ..., 12 | + * | Minute | m | 0, 1, ..., 59 | + * | | mm | 00, 01, ..., 59 | + * | Second | s | 0, 1, ..., 59 | + * | | ss | 00, 01, ..., 59 | + * | 1/10 of second | S | 0, 1, ..., 9 | + * | 1/100 of second | SS | 00, 01, ..., 99 | + * | Millisecond | SSS | 000, 001, ..., 999 | + * | Timezone | Z | -01:00, +00:00, ... +12:00 | + * | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | X | 512969520 | + * | Milliseconds timestamp | x | 512969520900 | + * | Long format | LT | 05:30 a.m. | + * | | LTS | 05:30:15 a.m. | + * | | L | 07/02/1995 | + * | | l | 7/2/1995 | + * | | LL | July 2 1995 | + * | | ll | Jul 2 1995 | + * | | LLL | July 2 1995 05:30 a.m. | + * | | lll | Jul 2 1995 05:30 a.m. | + * | | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets are escaped. + * + * The result may vary by locale. + * + * @param {Date|String|Number} date - the original date + * @param {String} format - the string of tokens + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @returns {String} the formatted date string + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.locale` must contain `localize` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Represent 11 February 2014 in middle-endian format: + * var result = format( + * new Date(2014, 1, 11), + * 'MM/DD/YYYY' + * ) + * //=> '02/11/2014' + * + * @example + * // Represent 2 July 2014 in Esperanto: + * import { eoLocale } from 'date-fns/locale/eo' + * var result = format( + * new Date(2014, 6, 2), + * 'Do [de] MMMM YYYY', + * {locale: eoLocale} + * ) + * //=> '2-a de julio 2014' + */ +function format (dirtyDate, dirtyFormatStr, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } -var __vue_inject_styles__$1 = undefined; -/* scoped */ + var formatStr = String(dirtyFormatStr); + var options = dirtyOptions || {}; -var __vue_scope_id__$1 = undefined; -/* module identifier */ + var locale$1 = options.locale || locale; -var __vue_module_identifier__$1 = undefined; -/* functional template */ + if (!locale$1.localize) { + throw new RangeError('locale must contain localize property') + } -var __vue_is_functional_template__$1 = false; -/* style inject */ + if (!locale$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } -/* style inject SSR */ + var localeFormatters = locale$1.formatters || {}; + var formattingTokensRegExp = locale$1.formattingTokensRegExp || defaultFormattingTokensRegExp; + var formatLong = locale$1.formatLong; -var VgtPagination = __vue_normalize__({ - render: __vue_render__$1, - staticRenderFns: __vue_staticRenderFns__$1 -}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, undefined, undefined); + var originalDate = toDate(dirtyDate, options); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -var script$2 = { - name: 'VgtGlobalSearch', - props: ['value', 'searchEnabled', 'globalSearchPlaceholder'], - data: function data() { - return { - globalSearchTerm: null - }; - }, - computed: { - showControlBar: function showControlBar() { - if (this.searchEnabled) return true; - if (this.$slots && this.$slots['internal-table-actions']) return true; - return false; - } - }, - methods: { - updateValue: function updateValue(value) { - this.$emit('input', value); - this.$emit('on-keyup', value); - }, - entered: function entered(value) { - this.$emit('on-enter', value); - } + if (!isValid(originalDate, options)) { + return 'Invalid Date' } -}; -/* script */ -var __vue_script__$2 = script$2; -/* template */ + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376 + var timezoneOffset = originalDate.getTimezoneOffset(); + var utcDate = addUTCMinutes(originalDate, -timezoneOffset, options); + + var formatterOptions = cloneObject(options); + formatterOptions.locale = locale$1; + formatterOptions.formatters = formatters; + + // When UTC functions will be implemented, options._originalDate will likely be a part of public API. + // Right now, please don't use it in locales. If you have to use an original date, + // please restore it from `date`, adding a timezone offset to it. + formatterOptions._originalDate = originalDate; + + var result = formatStr + .replace(longFormattingTokensRegExp, function (substring) { + if (substring[0] === '[') { + return substring + } -var __vue_render__$2 = function __vue_render__() { - var _vm = this; + if (substring[0] === '\\') { + return cleanEscapedString(substring) + } - var _h = _vm.$createElement; + return formatLong(substring) + }) + .replace(formattingTokensRegExp, function (substring) { + var formatter = localeFormatters[substring] || formatters[substring]; - var _c = _vm._self._c || _h; + if (formatter) { + return formatter(utcDate, formatterOptions) + } else { + return cleanEscapedString(substring) + } + }); - return _vm.showControlBar ? _c('div', { - staticClass: "vgt-global-search vgt-clearfix" - }, [_c('div', { - staticClass: "vgt-global-search__input vgt-pull-left" - }, [_vm.searchEnabled ? _c('span', { - staticClass: "input__icon" - }, [_c('div', { - staticClass: "magnifying-glass" - })]) : _vm._e(), _vm._v(" "), _vm.searchEnabled ? _c('input', { - staticClass: "vgt-input vgt-pull-left", - attrs: { - "type": "text", - "placeholder": _vm.globalSearchPlaceholder - }, - domProps: { - "value": _vm.value - }, - on: { - "input": function input($event) { - return _vm.updateValue($event.target.value); - }, - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } + return result +} - return _vm.entered($event.target.value); - } - } - }) : _vm._e()]), _vm._v(" "), _c('div', { - staticClass: "vgt-global-search__actions vgt-pull-right" - }, [_vm._t("internal-table-actions")], 2)]) : _vm._e(); -}; +function cleanEscapedString (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} + +/** + * @name subMinutes + * @category Minute Helpers + * @summary Subtract the specified number of minutes from the given date. + * + * @description + * Subtract the specified number of minutes from the given date. + * + * @param {Date|String|Number} date - the date to be changed + * @param {Number} amount - the amount of minutes to be subtracted + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @returns {Date} the new date with the mintues subtracted + * @throws {TypeError} 2 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * + * @example + * // Subtract 30 minutes from 10 July 2014 12:00:00: + * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) + * //=> Thu Jul 10 2014 11:30:00 + */ +function subMinutes (dirtyDate, dirtyAmount, dirtyOptions) { + if (arguments.length < 2) { + throw new TypeError('2 arguments required, but only ' + arguments.length + ' present') + } + + var amount = Number(dirtyAmount); + return addMinutes(dirtyDate, -amount, dirtyOptions) +} -var __vue_staticRenderFns__$2 = []; -/* style */ +var patterns$1 = { + 'M': /^(1[0-2]|0?\d)/, // 0 to 12 + 'D': /^(3[0-1]|[0-2]?\d)/, // 0 to 31 + 'DDD': /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 + 'W': /^(5[0-3]|[0-4]?\d)/, // 0 to 53 + 'YYYY': /^(\d{1,4})/, // 0 to 9999 + 'H': /^(2[0-3]|[0-1]?\d)/, // 0 to 23 + 'm': /^([0-5]?\d)/, // 0 to 59 + 'Z': /^([+-])(\d{2}):(\d{2})/, + 'ZZ': /^([+-])(\d{2})(\d{2})/, + singleDigit: /^(\d)/, + twoDigits: /^(\d{2})/, + threeDigits: /^(\d{3})/, + fourDigits: /^(\d{4})/, + anyDigits: /^(\d+)/ +}; -var __vue_inject_styles__$2 = undefined; -/* scoped */ +function parseDecimal$1 (matchResult) { + return parseInt(matchResult[1], 10) +} -var __vue_scope_id__$2 = undefined; -/* module identifier */ +var parsers = { + // Year: 00, 01, ..., 99 + 'YY': { + unit: 'twoDigitYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, -var __vue_module_identifier__$2 = undefined; -/* functional template */ + // Year: 1900, 1901, ..., 2099 + 'YYYY': { + unit: 'year', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, -var __vue_is_functional_template__$2 = false; -/* style inject */ + // ISO week-numbering year: 00, 01, ..., 99 + 'GG': { + unit: 'isoYear', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + 1900 + } + }, -/* style inject SSR */ + // ISO week-numbering year: 1900, 1901, ..., 2099 + 'GGGG': { + unit: 'isoYear', + match: patterns$1.YYYY, + parse: parseDecimal$1 + }, -var VgtGlobalSearch = __vue_normalize__({ - render: __vue_render__$2, - staticRenderFns: __vue_staticRenderFns__$2 -}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, undefined, undefined); + // Quarter: 1, 2, 3, 4 + 'Q': { + unit: 'quarter', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, -var script$3 = { - name: 'VgtFilterRow', - props: ['lineNumbers', 'columns', 'typedColumns', 'globalSearchEnabled', 'selectable', 'mode'], - watch: { - columns: { - handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { - this.populateInitialFilters(); - } - }, - deep: true, - immediate: true + // Ordinal quarter + 'Qo': { + unit: 'quarter', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'quarter'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'quarter'}) } }, - data: function data() { - return { - columnFilters: {}, - timer: null - }; + + // Month: 1, 2, ..., 12 + 'M': { + unit: 'month', + match: patterns$1.M, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } }, - computed: { - // to create a filter row, we need to - // make sure that there is atleast 1 column - // that requires filtering - hasFilterRow: function hasFilterRow() { - // if (this.mode === 'remote' || !this.globalSearchEnabled) { - for (var i = 0; i < this.columns.length; i++) { - var col = this.columns[i]; - if (col.filterOptions && col.filterOptions.enabled) { - return true; - } - } // } + // Ordinal month + 'Mo': { + unit: 'month', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'month'}) + }, + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'month'}) - 1 + } + }, + // Month: 01, 02, ..., 12 + 'MM': { + unit: 'month', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) - 1 + } + }, - return false; + // Month: Jan, Feb, ..., Dec + 'MMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'short'}) + }, + parse: function (matchResult, options) { + return options.locale.match.month(matchResult, {type: 'short'}) } }, - methods: { - reset: function reset() { - var emitEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - this.columnFilters = {}; - if (emitEvent) { - this.$emit('filter-changed', this.columnFilters); - } + // Month: January, February, ..., December + 'MMMM': { + unit: 'month', + match: function (string, options) { + return options.locale.match.months(string, {type: 'long'}) || + options.locale.match.months(string, {type: 'short'}) }, - isFilterable: function isFilterable(column) { - return column.filterOptions && column.filterOptions.enabled; + parse: function (matchResult, options) { + var parseResult = options.locale.match.month(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.month(matchResult, {type: 'short'}); + } + + return parseResult + } + }, + + // ISO week: 1, 2, ..., 53 + 'W': { + unit: 'isoWeek', + match: patterns$1.W, + parse: parseDecimal$1 + }, + + // Ordinal ISO week + 'Wo': { + unit: 'isoWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'isoWeek'}) }, - isDropdown: function isDropdown(column) { - return this.isFilterable(column) && column.filterOptions.filterDropdownItems && column.filterOptions.filterDropdownItems.length; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'isoWeek'}) + } + }, + + // ISO week: 01, 02, ..., 53 + 'WW': { + unit: 'isoWeek', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of week: 0, 1, ..., 6 + 'd': { + unit: 'dayOfWeek', + match: patterns$1.singleDigit, + parse: parseDecimal$1 + }, + + // Ordinal day of week + 'do': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfWeek'}) }, - isDropdownObjects: function isDropdownObjects(column) { - return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) === 'object'; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfWeek'}) + } + }, + + // Day of week: Su, Mo, ..., Sa + 'dd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'narrow'}) }, - isDropdownArray: function isDropdownArray(column) { - return this.isDropdown(column) && _typeof(column.filterOptions.filterDropdownItems[0]) !== 'object'; + parse: function (matchResult, options) { + return options.locale.match.weekday(matchResult, {type: 'narrow'}) + } + }, + + // Day of week: Sun, Mon, ..., Sat + 'ddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) }, - // get column's defined placeholder or default one - getPlaceholder: function getPlaceholder(column) { - var placeholder = this.isFilterable(column) && column.filterOptions.placeholder || "Filter ".concat(column.label); - return placeholder; + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + + return parseResult + } + }, + + // Day of week: Sunday, Monday, ..., Saturday + 'dddd': { + unit: 'dayOfWeek', + match: function (string, options) { + return options.locale.match.weekdays(string, {type: 'long'}) || + options.locale.match.weekdays(string, {type: 'short'}) || + options.locale.match.weekdays(string, {type: 'narrow'}) }, - updateFiltersOnEnter: function updateFiltersOnEnter(column, value) { - if (this.timer) clearTimeout(this.timer); - this.updateFiltersImmediately(column, value); + parse: function (matchResult, options) { + var parseResult = options.locale.match.weekday(matchResult, {type: 'long'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'short'}); + + if (parseResult == null) { + parseResult = options.locale.match.weekday(matchResult, {type: 'narrow'}); + } + } + + return parseResult + } + }, + + // Day of ISO week: 1, 2, ..., 7 + 'E': { + unit: 'dayOfISOWeek', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) + } + }, + + // Day of month: 1, 2, ..., 31 + 'D': { + unit: 'dayOfMonth', + match: patterns$1.D, + parse: parseDecimal$1 + }, + + // Ordinal day of month + 'Do': { + unit: 'dayOfMonth', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfMonth'}) }, - updateFiltersOnKeyup: function updateFiltersOnKeyup(column, value) { - // if the trigger is enter, we don't filter on keyup - if (column.filterOptions.trigger === 'enter') return; - this.updateFilters(column, value); + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfMonth'}) + } + }, + + // Day of month: 01, 02, ..., 31 + 'DD': { + unit: 'dayOfMonth', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // Day of year: 1, 2, ..., 366 + 'DDD': { + unit: 'dayOfYear', + match: patterns$1.DDD, + parse: parseDecimal$1 + }, + + // Ordinal day of year + 'DDDo': { + unit: 'dayOfYear', + match: function (string, options) { + return options.locale.match.ordinalNumbers(string, {unit: 'dayOfYear'}) }, - // since vue doesn't detect property addition and deletion, we - // need to create helper function to set property etc - updateFilters: function updateFilters(column, value) { - var _this = this; + parse: function (matchResult, options) { + return options.locale.match.ordinalNumber(matchResult, {unit: 'dayOfYear'}) + } + }, - if (this.timer) clearTimeout(this.timer); - this.timer = setTimeout(function () { - _this.updateFiltersImmediately(column, value); - }, 400); + // Day of year: 001, 002, ..., 366 + 'DDDD': { + unit: 'dayOfYear', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, + + // AM, PM + 'A': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'short'}) }, - updateFiltersImmediately: function updateFiltersImmediately(column, value) { - this.$set(this.columnFilters, column.field, value); - this.$emit('filter-changed', this.columnFilters); + parse: function (matchResult, options) { + return options.locale.match.timeOfDay(matchResult, {type: 'short'}) + } + }, + + // a.m., p.m. + 'aa': { + unit: 'timeOfDay', + match: function (string, options) { + return options.locale.match.timesOfDay(string, {type: 'long'}) || + options.locale.match.timesOfDay(string, {type: 'short'}) }, - populateInitialFilters: function populateInitialFilters() { - for (var i = 0; i < this.columns.length; i++) { - var col = this.columns[i]; // lets see if there are initial - // filters supplied by user + parse: function (matchResult, options) { + var parseResult = options.locale.match.timeOfDay(matchResult, {type: 'long'}); - if (this.isFilterable(col) && typeof col.filterOptions.filterValue !== 'undefined' && col.filterOptions.filterValue !== null) { - this.$set(this.columnFilters, col.field, col.filterOptions.filterValue); // this.updateFilters(col, col.filterOptions.filterValue); + if (parseResult == null) { + parseResult = options.locale.match.timeOfDay(matchResult, {type: 'short'}); + } - this.$set(col.filterOptions, 'filterValue', undefined); - } - } //* lets emit event once all filters are set + return parseResult + } + }, + // Hour: 0, 1, ... 23 + 'H': { + unit: 'hours', + match: patterns$1.H, + parse: parseDecimal$1 + }, - this.$emit('filter-changed', this.columnFilters); - } + // Hour: 00, 01, ..., 23 + 'HH': { + unit: 'hours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 }, - mounted: function mounted() {} -}; -/* script */ -var __vue_script__$3 = script$3; -/* template */ + // Hour: 1, 2, ..., 12 + 'h': { + unit: 'timeOfDayHours', + match: patterns$1.M, + parse: parseDecimal$1 + }, -var __vue_render__$3 = function __vue_render__() { - var _vm = this; + // Hour: 01, 02, ..., 12 + 'hh': { + unit: 'timeOfDayHours', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, - var _h = _vm.$createElement; + // Minute: 0, 1, ..., 59 + 'm': { + unit: 'minutes', + match: patterns$1.m, + parse: parseDecimal$1 + }, - var _c = _vm._self._c || _h; + // Minute: 00, 01, ..., 59 + 'mm': { + unit: 'minutes', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, - return _vm.hasFilterRow ? _c('tr', [_vm.lineNumbers ? _c('th') : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th') : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { - return !column.hidden ? _c('th', { - key: index, - staticClass: "filter-th" - }, [_vm.isFilterable(column) ? _c('div', [!_vm.isDropdown(column) ? _c('input', { - staticClass: "vgt-input", - attrs: { - "type": "text", - "placeholder": _vm.getPlaceholder(column) - }, - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "keyup": function keyup($event) { - if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) { - return null; - } + // Second: 0, 1, ..., 59 + 's': { + unit: 'seconds', + match: patterns$1.m, + parse: parseDecimal$1 + }, - return _vm.updateFiltersOnEnter(column, $event.target.value); - }, - "input": function input($event) { - return _vm.updateFiltersOnKeyup(column, $event.target.value); - } - } - }) : _vm._e(), _vm._v(" "), _vm.isDropdownArray(column) ? _c('select', { - staticClass: "vgt-select", - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "change": function change($event) { - return _vm.updateFilters(column, $event.target.value); - } - } - }, [_c('option', { - key: "-1", - attrs: { - "value": "" - } - }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { - return _c('option', { - key: i, - domProps: { - "value": option - } - }, [_vm._v("\n " + _vm._s(option) + "\n ")]); - })], 2) : _vm._e(), _vm._v(" "), _vm.isDropdownObjects(column) ? _c('select', { - staticClass: "vgt-select", - domProps: { - "value": _vm.columnFilters[column.field] - }, - on: { - "change": function change($event) { - return _vm.updateFilters(column, $event.target.value, true); - } - } - }, [_c('option', { - key: "-1", - attrs: { - "value": "" - } - }, [_vm._v(_vm._s(_vm.getPlaceholder(column)))]), _vm._v(" "), _vm._l(column.filterOptions.filterDropdownItems, function (option, i) { - return _c('option', { - key: i, - domProps: { - "value": option.value - } - }, [_vm._v(_vm._s(option.text))]); - })], 2) : _vm._e()]) : _vm._e()]) : _vm._e(); - })], 2) : _vm._e(); -}; + // Second: 00, 01, ..., 59 + 'ss': { + unit: 'seconds', + match: patterns$1.twoDigits, + parse: parseDecimal$1 + }, + + // 1/10 of second: 0, 1, ..., 9 + 'S': { + unit: 'milliseconds', + match: patterns$1.singleDigit, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 100 + } + }, -var __vue_staticRenderFns__$3 = []; -/* style */ + // 1/100 of second: 00, 01, ..., 99 + 'SS': { + unit: 'milliseconds', + match: patterns$1.twoDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 10 + } + }, -var __vue_inject_styles__$3 = undefined; -/* scoped */ + // Millisecond: 000, 001, ..., 999 + 'SSS': { + unit: 'milliseconds', + match: patterns$1.threeDigits, + parse: parseDecimal$1 + }, -var __vue_scope_id__$3 = "data-v-892cc66c"; -/* module identifier */ + // Timezone: -01:00, +00:00, ... +12:00 + 'Z': { + unit: 'timezone', + match: patterns$1.Z, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, -var __vue_module_identifier__$3 = undefined; -/* functional template */ + // Timezone: -0100, +0000, ... +1200 + 'ZZ': { + unit: 'timezone', + match: patterns$1.ZZ, + parse: function (matchResult) { + var sign = matchResult[1]; + var hours = parseInt(matchResult[2], 10); + var minutes = parseInt(matchResult[3], 10); + var absoluteOffset = hours * 60 + minutes; + return (sign === '+') ? absoluteOffset : -absoluteOffset + } + }, -var __vue_is_functional_template__$3 = false; -/* style inject */ + // Seconds timestamp: 512969520 + 'X': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: function (matchResult) { + return parseDecimal$1(matchResult) * 1000 + } + }, -/* style inject SSR */ + // Milliseconds timestamp: 512969520900 + 'x': { + unit: 'timestamp', + match: patterns$1.anyDigits, + parse: parseDecimal$1 + } +}; -var VgtFilterRow = __vue_normalize__({ - render: __vue_render__$3, - staticRenderFns: __vue_staticRenderFns__$3 -}, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, undefined, undefined); +parsers['a'] = parsers['A']; -function getNextSort(currentSort) { - if (currentSort === 'asc') return 'desc'; // if (currentSort === 'desc') return null; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCDay (dirtyDate, dirtyDay, dirtyOptions) { + var options = dirtyOptions || {}; + var locale = options.locale; + var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; + var defaultWeekStartsOn = localeWeekStartsOn === undefined ? 0 : Number(localeWeekStartsOn); + var weekStartsOn = options.weekStartsOn === undefined ? defaultWeekStartsOn : Number(options.weekStartsOn); - return 'asc'; + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var date = toDate(dirtyDate, dirtyOptions); + var day = Number(dirtyDay); + + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date } -function getIndex(sortArray, column) { - for (var i = 0; i < sortArray.length; i++) { - if (column.field === sortArray[i].field) return i; +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISODay (dirtyDate, dirtyDay, dirtyOptions) { + var day = Number(dirtyDay); + + if (day % 7 === 0) { + day = day - 7; } - return -1; + var weekStartsOn = 1; + var date = toDate(dirtyDate, dirtyOptions); + var currentDay = date.getUTCDay(); + + var remainder = day % 7; + var dayIndex = (remainder + 7) % 7; + + var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay; + + date.setUTCDate(date.getUTCDate() + diff); + return date } -var primarySort = function (sortArray, column) { - if (sortArray.length && sortArray.length === 1 && sortArray[0].field === column.field) { - var type = getNextSort(sortArray[0].type); +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeek (dirtyDate, dirtyISOWeek, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoWeek = Number(dirtyISOWeek); + var diff = getUTCISOWeek(date, dirtyOptions) - isoWeek; + date.setUTCDate(date.getUTCDate() - diff * 7); + return date +} - if (type) { - sortArray[0].type = getNextSort(sortArray[0].type); - } else { - sortArray = []; +var MILLISECONDS_IN_DAY$1 = 86400000; + +// This function will be a part of public API when UTC function will be implemented. +// See issue: https://github.com/date-fns/date-fns/issues/376 +function setUTCISOWeekYear (dirtyDate, dirtyISOYear, dirtyOptions) { + var date = toDate(dirtyDate, dirtyOptions); + var isoYear = Number(dirtyISOYear); + var dateStartOfYear = startOfUTCISOWeekYear(date, dirtyOptions); + var diff = Math.floor((date.getTime() - dateStartOfYear.getTime()) / MILLISECONDS_IN_DAY$1); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setUTCFullYear(isoYear, 0, 4); + fourthOfJanuary.setUTCHours(0, 0, 0, 0); + date = startOfUTCISOWeekYear(fourthOfJanuary, dirtyOptions); + date.setUTCDate(date.getUTCDate() + diff); + return date +} + +var MILLISECONDS_IN_MINUTE$2 = 60000; + +function setTimeOfDay (hours, timeOfDay) { + var isAM = timeOfDay === 0; + + if (isAM) { + if (hours === 12) { + return 0 } } else { - sortArray = [{ - field: column.field, - type: 'asc' - }]; + if (hours !== 12) { + return 12 + hours + } } - return sortArray; -}; - -var secondarySort = function (sortArray, column) { - //* this means that primary sort exists, we're - //* just adding a secondary sort - var index = getIndex(sortArray, column); + return hours +} - if (index === -1) { - sortArray.push({ - field: column.field, - type: 'asc' - }); - } else { - var type = getNextSort(sortArray[index].type); +var units = { + twoDigitYear: { + priority: 10, + set: function (dateValues, value) { + var century = Math.floor(dateValues.date.getUTCFullYear() / 100); + var year = century * 100 + value; + dateValues.date.setUTCFullYear(year, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - if (type) { - sortArray[index].type = type; - } else { - sortArray.splice(index, 1); + year: { + priority: 10, + set: function (dateValues, value) { + dateValues.date.setUTCFullYear(value, 0, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues } - } + }, - return sortArray; -}; + isoYear: { + priority: 10, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeekYear(setUTCISOWeekYear(dateValues.date, value, options), options); + return dateValues + } + }, -// -var script$4 = { - name: 'VgtTableHeader', - props: { - lineNumbers: { - "default": false, - type: Boolean - }, - selectable: { - "default": false, - type: Boolean - }, - allSelected: { - "default": false, - type: Boolean - }, - allSelectedIndeterminate: { - "default": false, - type: Boolean - }, - columns: { - type: Array - }, - mode: { - type: String - }, - typedColumns: {}, - //* Sort related - sortable: { - type: Boolean - }, - // sortColumn: { - // type: Number, - // }, - // sortType: { - // type: String, - // }, - // utility functions - // isSortableColumn: { - // type: Function, - // }, - getClasses: { - type: Function - }, - //* search related - searchEnabled: { - type: Boolean - }, - tableRef: {}, - paginated: {} + quarter: { + priority: 20, + set: function (dateValues, value) { + dateValues.date.setUTCMonth((value - 1) * 3, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } }, - watch: { - tableRef: { - handler: function handler() { - this.setColumnStyles(); - }, - immediate: true - }, - paginated: { - handler: function handler() { - if (this.tableRef) { - this.setColumnStyles(); - } - }, - deep: true + + month: { + priority: 30, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(value, 1); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues } }, - data: function data() { - return { - timer: null, - checkBoxThStyle: {}, - lineNumberThStyle: {}, - columnStyles: [], - sorts: [] - }; + + isoWeek: { + priority: 40, + set: function (dateValues, value, options) { + dateValues.date = startOfUTCISOWeek(setUTCISOWeek(dateValues.date, value, options), options); + return dateValues + } }, - computed: {}, - methods: { - reset: function reset() { - this.$refs['filter-row'].reset(true); - }, - toggleSelectAll: function toggleSelectAll() { - this.$emit('on-toggle-select-all'); - }, - isSortableColumn: function isSortableColumn(column) { - var sortable = column.sortable; - var isSortable = typeof sortable === 'boolean' ? sortable : this.sortable; - return isSortable; - }, - sort: function sort(e, column) { - //* if column is not sortable, return right here - if (!this.isSortableColumn(column)) return; - if (e.shiftKey) { - this.sorts = secondarySort(this.sorts, column); - } else { - this.sorts = primarySort(this.sorts, column); - } + dayOfWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCDay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - this.$emit('on-sort-change', this.sorts); - }, - setInitialSort: function setInitialSort(sorts) { - this.sorts = sorts; - this.$emit('on-sort-change', this.sorts); - }, - getColumnSort: function getColumnSort(column) { - for (var i = 0; i < this.sorts.length; i += 1) { - if (this.sorts[i].field === column.field) { - return this.sorts[i].type || 'asc'; - } - } + dayOfISOWeek: { + priority: 50, + set: function (dateValues, value, options) { + dateValues.date = setUTCISODay(dateValues.date, value, options); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - return null; - }, - getHeaderClasses: function getHeaderClasses(column, index) { - var classes = assign({}, this.getClasses(index, 'th'), { - 'sorting sorting-desc': this.getColumnSort(column) === 'desc', - 'sorting sorting-asc': this.getColumnSort(column) === 'asc' - }); - return classes; - }, - filterRows: function filterRows(columnFilters) { - this.$emit('filter-changed', columnFilters); - }, - getWidthStyle: function getWidthStyle(dom) { - if (window && window.getComputedStyle) { - var cellStyle = window.getComputedStyle(dom, null); - return { - width: cellStyle.width - }; - } + dayOfMonth: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCDate(value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - return { - width: 'auto' - }; - }, - setColumnStyles: function setColumnStyles() { - var _this = this; + dayOfYear: { + priority: 50, + set: function (dateValues, value) { + dateValues.date.setUTCMonth(0, value); + dateValues.date.setUTCHours(0, 0, 0, 0); + return dateValues + } + }, - var colStyles = []; - if (this.timer) clearTimeout(this.timer); - this.timer = setTimeout(function () { - for (var i = 0; i < _this.columns.length; i++) { - if (_this.tableRef) { - var skip = 0; - if (_this.selectable) skip++; - if (_this.lineNumbers) skip++; - var cell = _this.tableRef.rows[0].cells[i + skip]; - colStyles.push(_this.getWidthStyle(cell)); - } else { - colStyles.push({ - minWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', - maxWidth: _this.columns[i].width ? _this.columns[i].width : 'auto', - width: _this.columns[i].width ? _this.columns[i].width : 'auto' - }); - } - } + timeOfDay: { + priority: 60, + set: function (dateValues, value, options) { + dateValues.timeOfDay = value; + return dateValues + } + }, - _this.columnStyles = colStyles; - }, 200); - }, - getColumnStyle: function getColumnStyle(column, index) { - var styleObject = { - minWidth: column.width ? column.width : 'auto', - maxWidth: column.width ? column.width : 'auto', - width: column.width ? column.width : 'auto' - }; //* if fixed header we need to get width from original table + hours: { + priority: 70, + set: function (dateValues, value, options) { + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, - if (this.tableRef) { - if (this.selectable) index++; - if (this.lineNumbers) index++; - var cell = this.tableRef.rows[0].cells[index]; - var cellStyle = window.getComputedStyle(cell, null); - styleObject.width = cellStyle.width; + timeOfDayHours: { + priority: 70, + set: function (dateValues, value, options) { + var timeOfDay = dateValues.timeOfDay; + if (timeOfDay != null) { + value = setTimeOfDay(value, timeOfDay); } + dateValues.date.setUTCHours(value, 0, 0, 0); + return dateValues + } + }, - return styleObject; + minutes: { + priority: 80, + set: function (dateValues, value) { + dateValues.date.setUTCMinutes(value, 0, 0); + return dateValues } }, - mounted: function mounted() { - window.addEventListener('resize', this.setColumnStyles); + + seconds: { + priority: 90, + set: function (dateValues, value) { + dateValues.date.setUTCSeconds(value, 0); + return dateValues + } }, - beforeDestroy: function beforeDestroy() { - if (this.timer) clearTimeout(this.timer); - window.removeEventListener('resize', this.setColumnStyles); + + milliseconds: { + priority: 100, + set: function (dateValues, value) { + dateValues.date.setUTCMilliseconds(value); + return dateValues + } }, - components: { - 'vgt-filter-row': VgtFilterRow + + timezone: { + priority: 110, + set: function (dateValues, value) { + dateValues.date = new Date(dateValues.date.getTime() - value * MILLISECONDS_IN_MINUTE$2); + return dateValues + } + }, + + timestamp: { + priority: 120, + set: function (dateValues, value) { + dateValues.date = new Date(value); + return dateValues + } } }; -/* script */ -var __vue_script__$4 = script$4; -/* template */ +var TIMEZONE_UNIT_PRIORITY = 110; +var MILLISECONDS_IN_MINUTE$3 = 60000; -var __vue_render__$4 = function __vue_render__() { - var _vm = this; +var longFormattingTokensRegExp$1 = /(\[[^[]*])|(\\)?(LTS|LT|LLLL|LLL|LL|L|llll|lll|ll|l)/g; +var defaultParsingTokensRegExp = /(\[[^[]*])|(\\)?(x|ss|s|mm|m|hh|h|do|dddd|ddd|dd|d|aa|a|ZZ|Z|YYYY|YY|X|Wo|WW|W|SSS|SS|S|Qo|Q|Mo|MMMM|MMM|MM|M|HH|H|GGGG|GG|E|Do|DDDo|DDDD|DDD|DD|D|A|.)/g; - var _h = _vm.$createElement; +/** + * @name parse + * @category Common Helpers + * @summary Parse the date. + * + * @description + * Return the date parsed from string using the given format. + * + * Accepted format tokens: + * | Unit | Priority | Token | Input examples | + * |-------------------------|----------|-------|----------------------------------| + * | Year | 10 | YY | 00, 01, ..., 99 | + * | | | YYYY | 1900, 1901, ..., 2099 | + * | ISO week-numbering year | 10 | GG | 00, 01, ..., 99 | + * | | | GGGG | 1900, 1901, ..., 2099 | + * | Quarter | 20 | Q | 1, 2, 3, 4 | + * | | | Qo | 1st, 2nd, 3rd, 4th | + * | Month | 30 | M | 1, 2, ..., 12 | + * | | | Mo | 1st, 2nd, ..., 12th | + * | | | MM | 01, 02, ..., 12 | + * | | | MMM | Jan, Feb, ..., Dec | + * | | | MMMM | January, February, ..., December | + * | ISO week | 40 | W | 1, 2, ..., 53 | + * | | | Wo | 1st, 2nd, ..., 53rd | + * | | | WW | 01, 02, ..., 53 | + * | Day of week | 50 | d | 0, 1, ..., 6 | + * | | | do | 0th, 1st, ..., 6th | + * | | | dd | Su, Mo, ..., Sa | + * | | | ddd | Sun, Mon, ..., Sat | + * | | | dddd | Sunday, Monday, ..., Saturday | + * | Day of ISO week | 50 | E | 1, 2, ..., 7 | + * | Day of month | 50 | D | 1, 2, ..., 31 | + * | | | Do | 1st, 2nd, ..., 31st | + * | | | DD | 01, 02, ..., 31 | + * | Day of year | 50 | DDD | 1, 2, ..., 366 | + * | | | DDDo | 1st, 2nd, ..., 366th | + * | | | DDDD | 001, 002, ..., 366 | + * | Time of day | 60 | A | AM, PM | + * | | | a | am, pm | + * | | | aa | a.m., p.m. | + * | Hour | 70 | H | 0, 1, ... 23 | + * | | | HH | 00, 01, ... 23 | + * | Time of day hour | 70 | h | 1, 2, ..., 12 | + * | | | hh | 01, 02, ..., 12 | + * | Minute | 80 | m | 0, 1, ..., 59 | + * | | | mm | 00, 01, ..., 59 | + * | Second | 90 | s | 0, 1, ..., 59 | + * | | | ss | 00, 01, ..., 59 | + * | 1/10 of second | 100 | S | 0, 1, ..., 9 | + * | 1/100 of second | 100 | SS | 00, 01, ..., 99 | + * | Millisecond | 100 | SSS | 000, 001, ..., 999 | + * | Timezone | 110 | Z | -01:00, +00:00, ... +12:00 | + * | | | ZZ | -0100, +0000, ..., +1200 | + * | Seconds timestamp | 120 | X | 512969520 | + * | Milliseconds timestamp | 120 | x | 512969520900 | + * + * Values will be assigned to the date in the ascending order of its unit's priority. + * Units of an equal priority overwrite each other in the order of appearance. + * + * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year), + * the values will be taken from 3rd argument `baseDate` which works as a context of parsing. + * + * `baseDate` must be passed for correct work of the function. + * If you're not sure which `baseDate` to supply, create a new instance of Date: + * `parse('02/11/2014', 'MM/DD/YYYY', new Date())` + * In this case parsing will be done in the context of the current date. + * If `baseDate` is `Invalid Date` or a value not convertible to valid `Date`, + * then `Invalid Date` will be returned. + * + * Also, `parse` unfolds long formats like those in [format]{@link https://date-fns.org/docs/format}: + * | Token | Input examples | + * |-------|--------------------------------| + * | LT | 05:30 a.m. | + * | LTS | 05:30:15 a.m. | + * | L | 07/02/1995 | + * | l | 7/2/1995 | + * | LL | July 2 1995 | + * | ll | Jul 2 1995 | + * | LLL | July 2 1995 05:30 a.m. | + * | lll | Jul 2 1995 05:30 a.m. | + * | LLLL | Sunday, July 2 1995 05:30 a.m. | + * | llll | Sun, Jul 2 1995 05:30 a.m. | + * + * The characters wrapped in square brackets in the format string are escaped. + * + * The result may vary by locale. + * + * If `formatString` matches with `dateString` but does not provides tokens, `baseDate` will be returned. + * + * If parsing failed, `Invalid Date` will be returned. + * Invalid Date is a Date, whose time value is NaN. + * Time value of Date: http://es5.github.io/#x15.9.1.1 + * + * @param {String} dateString - the string to parse + * @param {String} formatString - the string of tokens + * @param {Date|String|Number} baseDate - the date to took the missing higher priority values from + * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options} + * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate} + * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale} + * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) + * @returns {Date} the parsed date + * @throws {TypeError} 3 arguments required + * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2 + * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6 + * @throws {RangeError} `options.locale` must contain `match` property + * @throws {RangeError} `options.locale` must contain `formatLong` property + * + * @example + * // Parse 11 February 2014 from middle-endian format: + * var result = parse( + * '02/11/2014', + * 'MM/DD/YYYY', + * new Date() + * ) + * //=> Tue Feb 11 2014 00:00:00 + * + * @example + * // Parse 28th of February in English locale in the context of 2010 year: + * import eoLocale from 'date-fns/locale/eo' + * var result = parse( + * '28-a de februaro', + * 'Do [de] MMMM', + * new Date(2010, 0, 1) + * {locale: eoLocale} + * ) + * //=> Sun Feb 28 2010 00:00:00 + */ +function parse (dirtyDateString, dirtyFormatString, dirtyBaseDate, dirtyOptions) { + if (arguments.length < 3) { + throw new TypeError('3 arguments required, but only ' + arguments.length + ' present') + } - var _c = _vm._self._c || _h; + var dateString = String(dirtyDateString); + var options = dirtyOptions || {}; - return _c('thead', [_c('tr', [_vm.lineNumbers ? _c('th', { - staticClass: "line-numbers" - }) : _vm._e(), _vm._v(" "), _vm.selectable ? _c('th', { - staticClass: "vgt-checkbox-col" - }, [_c('input', { - attrs: { - "type": "checkbox" - }, - domProps: { - "checked": _vm.allSelected, - "indeterminate": _vm.allSelectedIndeterminate - }, - on: { - "change": _vm.toggleSelectAll - } - })]) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, index) { - return !column.hidden ? _c('th', { - key: index, - "class": _vm.getHeaderClasses(column, index), - style: _vm.columnStyles[index], - on: { - "click": function click($event) { - return _vm.sort($event, column); - } + var weekStartsOn = options.weekStartsOn === undefined ? 0 : Number(options.weekStartsOn); + + // Test if weekStartsOn is between 0 and 6 _and_ is not NaN + if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { + throw new RangeError('weekStartsOn must be between 0 and 6 inclusively') + } + + var locale$1 = options.locale || locale; + var localeParsers = locale$1.parsers || {}; + var localeUnits = locale$1.units || {}; + + if (!locale$1.match) { + throw new RangeError('locale must contain match property') + } + + if (!locale$1.formatLong) { + throw new RangeError('locale must contain formatLong property') + } + + var formatString = String(dirtyFormatString) + .replace(longFormattingTokensRegExp$1, function (substring) { + if (substring[0] === '[') { + return substring } - }, [_vm._t("table-column", [_c('span', [_vm._v(_vm._s(column.label))])], { - "column": column - })], 2) : _vm._e(); - })], 2), _vm._v(" "), _c("vgt-filter-row", { - ref: "filter-row", - tag: "tr", - attrs: { - "global-search-enabled": _vm.searchEnabled, - "line-numbers": _vm.lineNumbers, - "selectable": _vm.selectable, - "columns": _vm.columns, - "mode": _vm.mode, - "typed-columns": _vm.typedColumns - }, - on: { - "filter-changed": _vm.filterRows + + if (substring[0] === '\\') { + return cleanEscapedString$1(substring) + } + + return locale$1.formatLong(substring) + }); + + if (formatString === '') { + if (dateString === '') { + return toDate(dirtyBaseDate, options) + } else { + return new Date(NaN) } - })], 1); -}; + } -var __vue_staticRenderFns__$4 = []; -/* style */ + var subFnOptions = cloneObject(options); + subFnOptions.locale = locale$1; -var __vue_inject_styles__$4 = undefined; -/* scoped */ + var tokens = formatString.match(locale$1.parsingTokensRegExp || defaultParsingTokensRegExp); + var tokensLength = tokens.length; -var __vue_scope_id__$4 = "data-v-7068df50"; -/* module identifier */ + // If timezone isn't specified, it will be set to the system timezone + var setters = [{ + priority: TIMEZONE_UNIT_PRIORITY, + set: dateToSystemTimezone, + index: 0 + }]; -var __vue_module_identifier__$4 = undefined; -/* functional template */ + var i; + for (i = 0; i < tokensLength; i++) { + var token = tokens[i]; + var parser = localeParsers[token] || parsers[token]; + if (parser) { + var matchResult; -var __vue_is_functional_template__$4 = false; -/* style inject */ + if (parser.match instanceof RegExp) { + matchResult = parser.match.exec(dateString); + } else { + matchResult = parser.match(dateString, subFnOptions); + } -/* style inject SSR */ + if (!matchResult) { + return new Date(NaN) + } -var VgtTableHeader = __vue_normalize__({ - render: __vue_render__$4, - staticRenderFns: __vue_staticRenderFns__$4 -}, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, undefined, undefined); + var unitName = parser.unit; + var unit = localeUnits[unitName] || units[unitName]; -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -var script$5 = { - name: 'VgtHeaderRow', - props: { - headerRow: { - type: Object - }, - columns: { - type: Array - }, - lineNumbers: { - type: Boolean - }, - selectable: { - type: Boolean - }, - collectFormatted: { - type: Function - }, - formattedRow: { - type: Function - }, - getClasses: { - type: Function - }, - fullColspan: { - type: Number + setters.push({ + priority: unit.priority, + set: unit.set, + value: parser.parse(matchResult, subFnOptions), + index: setters.length + }); + + var substring = matchResult[0]; + dateString = dateString.slice(substring.length); + } else { + var head = tokens[i].match(/^\[.*]$/) ? tokens[i].replace(/^\[|]$/g, '') : tokens[i]; + if (dateString.indexOf(head) === 0) { + dateString = dateString.slice(head.length); + } else { + return new Date(NaN) + } } - }, - data: function data() { - return {}; - }, - computed: {}, - methods: {}, - mounted: function mounted() {}, - components: {} -}; + } -/* script */ -var __vue_script__$5 = script$5; -/* template */ + var uniquePrioritySetters = setters + .map(function (setter) { + return setter.priority + }) + .sort(function (a, b) { + return a - b + }) + .filter(function (priority, index, array) { + return array.indexOf(priority) === index + }) + .map(function (priority) { + return setters + .filter(function (setter) { + return setter.priority === priority + }) + .reverse() + }) + .map(function (setterArray) { + return setterArray[0] + }); -var __vue_render__$5 = function __vue_render__() { - var _vm = this; + var date = toDate(dirtyBaseDate, options); - var _h = _vm.$createElement; + if (isNaN(date)) { + return new Date(NaN) + } - var _c = _vm._self._c || _h; + // Convert the date in system timezone to the same date in UTC+00:00 timezone. + // This ensures that when UTC functions will be implemented, locales will be compatible with them. + // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37 + var utcDate = subMinutes(date, date.getTimezoneOffset()); - return _c('tr', [_vm.headerRow.mode === 'span' ? _c('th', { - staticClass: "vgt-left-align vgt-row-header", - attrs: { - "colspan": _vm.fullColspan - } - }, [_vm._t("table-header-row", [_vm.headerRow.html ? _c('span', { - domProps: { - "innerHTML": _vm._s(_vm.headerRow.label) - } - }) : _c('span', [_vm._v("\n " + _vm._s(_vm.headerRow.label) + "\n ")])], { - "row": _vm.headerRow - })], 2) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.lineNumbers ? _c('th', { - staticClass: "vgt-row-header" - }) : _vm._e(), _vm._v(" "), _vm.headerRow.mode !== 'span' && _vm.selectable ? _c('th', { - staticClass: "vgt-row-header" - }) : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column, i) { - return _vm.headerRow.mode !== 'span' && !column.hidden ? _c('th', { - key: i, - staticClass: "vgt-row-header", - "class": _vm.getClasses(i, 'td') - }, [_vm._t("table-header-row", [!column.html ? _c('span', [_vm._v("\n " + _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) + "\n ")]) : _vm._e(), _vm._v(" "), column.html ? _c('span', { - domProps: { - "innerHTML": _vm._s(_vm.collectFormatted(_vm.headerRow, column, true)) - } - }) : _vm._e()], { - "row": _vm.headerRow, - "column": column, - "formattedRow": _vm.formattedRow(_vm.headerRow, true) - })], 2) : _vm._e(); - })], 2); -}; + var dateValues = {date: utcDate}; -var __vue_staticRenderFns__$5 = []; -/* style */ + var settersLength = uniquePrioritySetters.length; + for (i = 0; i < settersLength; i++) { + var setter = uniquePrioritySetters[i]; + dateValues = setter.set(dateValues, setter.value, subFnOptions); + } -var __vue_inject_styles__$5 = undefined; -/* scoped */ + return dateValues.date +} -var __vue_scope_id__$5 = undefined; -/* module identifier */ +function dateToSystemTimezone (dateValues) { + var date = dateValues.date; + var time = date.getTime(); -var __vue_module_identifier__$5 = undefined; -/* functional template */ + // Get the system timezone offset at (moment of time - offset) + var offset = date.getTimezoneOffset(); -var __vue_is_functional_template__$5 = false; -/* style inject */ + // Get the system timezone offset at the exact moment of time + offset = new Date(time + offset * MILLISECONDS_IN_MINUTE$3).getTimezoneOffset(); -/* style inject SSR */ + // Convert date in timezone "UTC+00:00" to the system timezone + dateValues.date = new Date(time + offset * MILLISECONDS_IN_MINUTE$3); -var VgtHeaderRow = __vue_normalize__({ - render: __vue_render__$5, - staticRenderFns: __vue_staticRenderFns__$5 -}, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, undefined, undefined); + return dateValues +} + +function cleanEscapedString$1 (input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|]$/g, '') + } + return input.replace(/\\/g, '') +} -var date = cloneDeep(defaultType); +var date = lodash_clonedeep(defaultType); date.isRight = true; date.compare = function (x, y, column) { @@ -1377,7 +11327,7 @@ var date$1 = /*#__PURE__*/Object.freeze({ 'default': date }); -var number = cloneDeep(defaultType); +var number = lodash_clonedeep(defaultType); number.isRight = true; number.filterPredicate = function (rowval, filter) { @@ -1403,7 +11353,7 @@ var number$1 = /*#__PURE__*/Object.freeze({ 'default': number }); -var decimal = cloneDeep(number); +var decimal = lodash_clonedeep(number); decimal.format = function (v) { if (v === undefined || v === null) return ''; @@ -1414,7 +11364,7 @@ var decimal$1 = /*#__PURE__*/Object.freeze({ 'default': decimal }); -var percentage = cloneDeep(number); +var percentage = lodash_clonedeep(number); percentage.format = function (v) { if (v === undefined || v === null) return ''; @@ -1425,7 +11375,7 @@ var percentage$1 = /*#__PURE__*/Object.freeze({ 'default': percentage }); -var _boolean = cloneDeep(defaultType); +var _boolean = lodash_clonedeep(defaultType); _boolean.isRight = true; @@ -1461,7 +11411,7 @@ var index = { var dataTypes = {}; var coreDataTypes = index; -each(Object.keys(coreDataTypes), function (key) { +lodash_foreach(Object.keys(coreDataTypes), function (key) { var compName = key.replace(/^\.\//, '').replace(/\.js/, ''); dataTypes[compName] = coreDataTypes[key]["default"]; }); @@ -1624,7 +11574,7 @@ var script$6 = { }, paginationOptions: { handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.initializePagination(); } }, @@ -1646,14 +11596,14 @@ var script$6 = { }, sortOptions: { handler: function handler(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.initializeSort(); } }, deep: true }, selectedRows: function selectedRows(newValue, oldValue) { - if (!isEqual(newValue, oldValue)) { + if (!lodash_isequal(newValue, oldValue)) { this.$emit('on-selected-rows-change', { selectedRows: this.selectedRows }); @@ -1699,8 +11649,8 @@ var script$6 = { }, selectedPageRows: function selectedPageRows() { var selectedRows = []; - each(this.paginated, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(this.paginated, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { if (row.vgtSelected) { selectedRows.push(row); } @@ -1710,8 +11660,8 @@ var script$6 = { }, selectedRows: function selectedRows() { var selectedRows = []; - each(this.processedRows, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(this.processedRows, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { if (row.vgtSelected) { selectedRows.push(row); } @@ -1752,14 +11702,14 @@ var script$6 = { }, totalRowCount: function totalRowCount() { var total = 0; - each(this.processedRows, function (headerRow) { + lodash_foreach(this.processedRows, function (headerRow) { total += headerRow.children ? headerRow.children.length : 0; }); return total; }, totalPageRowCount: function totalPageRowCount() { var total = 0; - each(this.paginated, function (headerRow) { + lodash_foreach(this.paginated, function (headerRow) { total += headerRow.children ? headerRow.children.length : 0; }); return total; @@ -1807,12 +11757,12 @@ var script$6 = { // here also we need to de-construct and then // re-construct the rows. var allRows = []; - each(this.filteredRows, function (headerRow) { + lodash_foreach(this.filteredRows, function (headerRow) { allRows.push.apply(allRows, _toConsumableArray(headerRow.children)); }); var filteredRows = []; - each(allRows, function (row) { - each(_this.columns, function (col) { + lodash_foreach(allRows, function (row) { + lodash_foreach(_this.columns, function (col) { // if col does not have search disabled, if (!col.globalSearchDisabled) { // if a search function is provided, @@ -1845,12 +11795,12 @@ var script$6 = { // of rows computedRows = []; - each(this.filteredRows, function (headerRow) { + lodash_foreach(this.filteredRows, function (headerRow) { var i = headerRow.vgt_header_id; - var children = filter(filteredRows, ['vgt_id', i]); + var children = lodash_filter(filteredRows, ['vgt_id', i]); if (children.length) { - var newHeaderRow = cloneDeep(headerRow); + var newHeaderRow = lodash_clonedeep(headerRow); newHeaderRow.children = children; computedRows.push(newHeaderRow); } @@ -1905,7 +11855,7 @@ var script$6 = { var paginatedRows = []; - each(this.processedRows, function (childRows) { + lodash_foreach(this.processedRows, function (childRows) { var _paginatedRows; (_paginatedRows = paginatedRows).push.apply(_paginatedRows, _toConsumableArray(childRows.children)); @@ -1933,12 +11883,12 @@ var script$6 = { var reconstructedRows = []; - each(this.processedRows, function (headerRow) { + lodash_foreach(this.processedRows, function (headerRow) { var i = headerRow.vgt_header_id; - var children = filter(paginatedRows, ['vgt_id', i]); + var children = lodash_filter(paginatedRows, ['vgt_id', i]); if (children.length) { - var newHeaderRow = cloneDeep(headerRow); + var newHeaderRow = lodash_clonedeep(headerRow); newHeaderRow.children = children; reconstructedRows.push(newHeaderRow); } @@ -1946,7 +11896,7 @@ var script$6 = { return reconstructedRows; }, originalRows: function originalRows() { - var rows = cloneDeep(this.rows); + var rows = lodash_clonedeep(this.rows); var nestedRows = []; if (!this.groupOptions.enabled) { @@ -1961,15 +11911,15 @@ var script$6 = { var index = 0; - each(nestedRows, function (headerRow, i) { - each(headerRow.children, function (row, j) { + lodash_foreach(nestedRows, function (headerRow, i) { + lodash_foreach(headerRow.children, function (row, j) { row.originalIndex = index++; }); }); return nestedRows; }, typedColumns: function typedColumns() { - var columns = assign(this.columns, []); + var columns = lodash_assign(this.columns, []); for (var i = 0; i < this.columns.length; i++) { var column = columns[i]; @@ -2016,8 +11966,8 @@ var script$6 = { var _this2 = this; var rows = this.selectAllByPage && !forceAll ? this.paginated : this.filteredRows; - each(rows, function (headerRow, i) { - each(headerRow.children, function (row, j) { + lodash_foreach(rows, function (headerRow, i) { + lodash_foreach(headerRow.children, function (row, j) { _this2.$set(row, 'vgtSelected', false); }); }); @@ -2032,8 +11982,8 @@ var script$6 = { } var rows = this.selectAllByPage ? this.paginated : this.filteredRows; - each(rows, function (headerRow) { - each(headerRow.children, function (row) { + lodash_foreach(rows, function (headerRow) { + lodash_foreach(headerRow.children, function (row) { _this3.$set(row, 'vgtSelected', true); }); }); @@ -2159,7 +12109,7 @@ var script$6 = { this.handleSearch(); // we reset the filteredRows here because // we want to search across everything. - this.filteredRows = cloneDeep(this.originalRows); + this.filteredRows = lodash_clonedeep(this.originalRows); this.forceSearch = true; this.sortChanged = true; } @@ -2278,7 +12228,7 @@ var script$6 = { // this is invoked either as a result of changing filters // or as a result of modifying rows. this.columnFilters = columnFilters; - var computedRows = cloneDeep(this.originalRows); // do we have a filter to care about? + var computedRows = lodash_clonedeep(this.originalRows); // do we have a filter to care about? // if not we don't need to do anything if (this.columnFilters && Object.keys(this.columnFilters).length) { @@ -2315,7 +12265,7 @@ var script$6 = { var col = _this4.typedColumns[i]; if (_this4.columnFilters[col.field]) { - computedRows = each(computedRows, function (headerRow) { + computedRows = lodash_foreach(computedRows, function (headerRow) { var newChildren = headerRow.children.filter(function (row) { // If column has a custom filter, use that. if (col.filterOptions && typeof col.filterOptions.filterFn === 'function') { @@ -2360,9 +12310,9 @@ var script$6 = { return classes; }, handleGrouped: function handleGrouped(originalRows) { - each(originalRows, function (headerRow, i) { + lodash_foreach(originalRows, function (headerRow, i) { headerRow.vgt_header_id = i; - each(headerRow.children, function (childRow) { + lodash_foreach(headerRow.children, function (childRow) { childRow.vgt_id = i; }); }); @@ -2864,7 +12814,7 @@ var __vue_is_functional_template__$6 = false; /* style inject SSR */ -var VueGoodTable = __vue_normalize__({ +var VueGoodTable = normalizeComponent_1({ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, __vue_inject_styles__$6, __vue_script__$6, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, undefined, undefined); diff --git a/dist/vue-good-table.js b/dist/vue-good-table.js index 7520b57b..5da05aab 100644 --- a/dist/vue-good-table.js +++ b/dist/vue-good-table.js @@ -1,5 +1,5 @@ /** - * vue-good-table v2.17.1 + * vue-good-table v2.17.2 * (c) 2018-present xaksis * https://github.com/xaksis/vue-good-table * Released under the MIT License. diff --git a/dist/vue-good-table.min.js b/dist/vue-good-table.min.js index 0c63239a..6019487b 100644 --- a/dist/vue-good-table.min.js +++ b/dist/vue-good-table.min.js @@ -1,5 +1,5 @@ /** - * vue-good-table v2.17.1 + * vue-good-table v2.17.2 * (c) 2018-present xaksis * https://github.com/xaksis/vue-good-table * Released under the MIT License.