| Server IP : 52.25.153.185 / Your IP : 216.73.217.131 Web Server : Apache System : Linux ip-172-26-6-158 5.10.0-35-cloud-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64 User : daemon ( 1) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/testify/scripts/ |
Upload File : |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 139);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/*!****************************************!*\
!*** ./node_modules/lodash/isArray.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
module.exports = isArray;
/***/ }),
/* 1 */
/*!**************************************!*\
!*** ./node_modules/lodash/_root.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 86);
/** Detect free variable `self`. */
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 2 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isObject.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* 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');
}
module.exports = isObject;
/***/ }),
/* 3 */
/*!*********************************************!*\
!*** ./node_modules/lodash/isObjectLike.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* 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';
}
module.exports = isObjectLike;
/***/ }),
/* 4 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseGetTag.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15),
getRawTag = __webpack_require__(/*! ./_getRawTag */ 155),
objectToString = __webpack_require__(/*! ./_objectToString */ 156);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
/**
* 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);
}
module.exports = baseGetTag;
/***/ }),
/* 5 */
/*!********************************************!*\
!*** ./node_modules/lodash/isArrayLike.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ 26),
isLength = __webpack_require__(/*! ./isLength */ 53);
/**
* 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);
}
module.exports = isArrayLike;
/***/ }),
/* 6 */
/*!*************************************!*\
!*** ./node_modules/lodash/keys.js ***!
\*************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ 92),
baseKeys = __webpack_require__(/*! ./_baseKeys */ 51),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5);
/**
* 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);
}
module.exports = keys;
/***/ }),
/* 7 */
/*!******************************************!*\
!*** ./node_modules/lodash/toInteger.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(/*! ./toFinite */ 91);
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
module.exports = toInteger;
/***/ }),
/* 8 */
/*!************************************!*\
!*** ./node_modules/lodash/get.js ***!
\************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 32);
/**
* 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;
}
module.exports = get;
/***/ }),
/* 9 */
/*!************************!*\
!*** external "React" ***!
\************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
module.exports = React;
/***/ }),
/* 10 */
/*!****************************************!*\
!*** ./node_modules/lodash/isEmpty.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseKeys = __webpack_require__(/*! ./_baseKeys */ 51),
getTag = __webpack_require__(/*! ./_getTag */ 14),
isArguments = __webpack_require__(/*! ./isArguments */ 27),
isArray = __webpack_require__(/*! ./isArray */ 0),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5),
isBuffer = __webpack_require__(/*! ./isBuffer */ 28),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 19),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 54);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
module.exports = isEmpty;
/***/ }),
/* 11 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_getNative.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ 154),
getValue = __webpack_require__(/*! ./_getValue */ 159);
/**
* 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;
}
module.exports = getNative;
/***/ }),
/* 12 */
/*!***************************************!*\
!*** ./node_modules/lodash/_toKey.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ 20);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* 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;
}
module.exports = toKey;
/***/ }),
/* 13 */
/*!********************************************!*\
!*** ./node_modules/lodash/_copyObject.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 46),
baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 73);
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
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;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ }),
/* 14 */
/*!****************************************!*\
!*** ./node_modules/lodash/_getTag.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(/*! ./_DataView */ 153),
Map = __webpack_require__(/*! ./_Map */ 52),
Promise = __webpack_require__(/*! ./_Promise */ 160),
Set = __webpack_require__(/*! ./_Set */ 161),
WeakMap = __webpack_require__(/*! ./_WeakMap */ 89),
baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
toSource = __webpack_require__(/*! ./_toSource */ 88);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* 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 getTag(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;
};
}
module.exports = getTag;
/***/ }),
/* 15 */
/*!****************************************!*\
!*** ./node_modules/lodash/_Symbol.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 1);
/** Built-in value references. */
var _Symbol = root.Symbol;
module.exports = _Symbol;
/***/ }),
/* 16 */
/*!******************************************!*\
!*** ./node_modules/lodash/_castPath.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ 0),
isKey = __webpack_require__(/*! ./_isKey */ 61),
stringToPath = __webpack_require__(/*! ./_stringToPath */ 95),
toString = __webpack_require__(/*! ./toString */ 17);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ }),
/* 17 */
/*!*****************************************!*\
!*** ./node_modules/lodash/toString.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(/*! ./_baseToString */ 97);
/**
* 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 convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ }),
/* 18 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseIteratee.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var baseMatches = __webpack_require__(/*! ./_baseMatches */ 242),
baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ 255),
identity = __webpack_require__(/*! ./identity */ 23),
isArray = __webpack_require__(/*! ./isArray */ 0),
property = __webpack_require__(/*! ./property */ 257);
/**
* 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);
}
module.exports = baseIteratee;
/***/ }),
/* 19 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_isPrototype.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* 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;
}
module.exports = isPrototype;
/***/ }),
/* 20 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isSymbol.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* 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) && baseGetTag(value) == symbolTag;
}
module.exports = isSymbol;
/***/ }),
/* 21 */
/*!******************************************!*\
!*** ./node_modules/lodash/_arrayMap.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/* 22 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_isIndex.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = _typeof(value);
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
module.exports = isIndex;
/***/ }),
/* 23 */
/*!*****************************************!*\
!*** ./node_modules/lodash/identity.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = identity;
/***/ }),
/* 24 */
/*!***********************************************!*\
!*** ./node_modules/lodash/fp/placeholder.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};
/***/ }),
/* 25 */
/*!***********************************************!*\
!*** ./includes/module_dependencies/utils.js ***!
\***********************************************/
/*! exports provided: applyMixinsSafely, intentionallyCloneDeep, intentionallyClone, sanitized_previously, log, is, isOn, isOff, isOnOff, isYes, isNo, isDefault, isMobileDevice, isIEOrEdge, isIE, isBlockEditor, condition, hasLocalStorage, hasNumericValue, hasValue, getResponsiveStatus, parseShortcode, processFontIcon, generateResponsiveCss, generatePlaceholderCss, replaceCodeContentEntities, removeFancyQuotes, processRangeValue, getCorners, getCorner, getSpacing, getBreakpoints, getViewModeByWidth, getPreviewModes, getGradient, removeClassNameByPrefix, getKeyboardList, getRowLayouts, maybeLoadFont, fontnameToClass, getCommentsMarkup, callWindow, decodeHtmlEntities, hasBodyMargin, fixSliderHeight, fixBuilderContent, triggerResizeForUIUpdate, enableScrollLock, disableScrollLock, cookies, linkRel, setElementFont, decodeOptionListValue, sprintf, isJson, isValidHtml, getNextBreakpoint, getPrevBreakpoint, appDocument, $appDocument, topDocument, $topDocument, appWindow, $appWindow, topWindow, $topWindow, getFixedHeaderHeight, parseInlineCssIntoObject, getOS, isModuleLocked, isModuleDeleted, getComponentType, getModuleSectionType, getModuleAncestor, getScrollbarWidth, getProcessedTabSlug, getModuleAddressSequence, getFontFieldIndexes, isRealMobileDevice, stripHTMLTags, default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export applyMixinsSafely */
/* unused harmony export intentionallyCloneDeep */
/* unused harmony export intentionallyClone */
/* unused harmony export sanitized_previously */
/* unused harmony export log */
/* unused harmony export is */
/* unused harmony export isOn */
/* unused harmony export isOff */
/* unused harmony export isOnOff */
/* unused harmony export isYes */
/* unused harmony export isNo */
/* unused harmony export isDefault */
/* unused harmony export isMobileDevice */
/* unused harmony export isIEOrEdge */
/* unused harmony export isIE */
/* unused harmony export isBlockEditor */
/* unused harmony export condition */
/* unused harmony export hasLocalStorage */
/* unused harmony export hasNumericValue */
/* unused harmony export hasValue */
/* unused harmony export getResponsiveStatus */
/* unused harmony export parseShortcode */
/* unused harmony export processFontIcon */
/* unused harmony export generateResponsiveCss */
/* unused harmony export generatePlaceholderCss */
/* unused harmony export replaceCodeContentEntities */
/* unused harmony export removeFancyQuotes */
/* unused harmony export processRangeValue */
/* unused harmony export getCorners */
/* unused harmony export getCorner */
/* unused harmony export getSpacing */
/* unused harmony export getBreakpoints */
/* unused harmony export getViewModeByWidth */
/* unused harmony export getPreviewModes */
/* unused harmony export getGradient */
/* unused harmony export removeClassNameByPrefix */
/* unused harmony export getKeyboardList */
/* unused harmony export getRowLayouts */
/* unused harmony export maybeLoadFont */
/* unused harmony export fontnameToClass */
/* unused harmony export getCommentsMarkup */
/* unused harmony export callWindow */
/* unused harmony export decodeHtmlEntities */
/* unused harmony export hasBodyMargin */
/* unused harmony export fixSliderHeight */
/* unused harmony export fixBuilderContent */
/* unused harmony export triggerResizeForUIUpdate */
/* unused harmony export enableScrollLock */
/* unused harmony export disableScrollLock */
/* unused harmony export cookies */
/* unused harmony export linkRel */
/* unused harmony export setElementFont */
/* unused harmony export decodeOptionListValue */
/* unused harmony export sprintf */
/* unused harmony export isJson */
/* unused harmony export isValidHtml */
/* unused harmony export getNextBreakpoint */
/* unused harmony export getPrevBreakpoint */
/* unused harmony export appDocument */
/* unused harmony export $appDocument */
/* unused harmony export topDocument */
/* unused harmony export $topDocument */
/* unused harmony export appWindow */
/* unused harmony export $appWindow */
/* unused harmony export topWindow */
/* unused harmony export $topWindow */
/* unused harmony export getFixedHeaderHeight */
/* unused harmony export parseInlineCssIntoObject */
/* unused harmony export getOS */
/* unused harmony export isModuleLocked */
/* unused harmony export isModuleDeleted */
/* unused harmony export getComponentType */
/* unused harmony export getModuleSectionType */
/* unused harmony export getModuleAncestor */
/* unused harmony export getScrollbarWidth */
/* unused harmony export getProcessedTabSlug */
/* unused harmony export getModuleAddressSequence */
/* unused harmony export getFontFieldIndexes */
/* unused harmony export isRealMobileDevice */
/* unused harmony export stripHTMLTags */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_assign__ = __webpack_require__(/*! lodash/assign */ 273);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_assign__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_pick__ = __webpack_require__(/*! lodash/pick */ 274);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_pick___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_pick__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isNull__ = __webpack_require__(/*! lodash/isNull */ 278);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isNull___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isNull__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined__ = __webpack_require__(/*! lodash/isUndefined */ 59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_unescape__ = __webpack_require__(/*! lodash/unescape */ 279);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_unescape___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_unescape__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_isString__ = __webpack_require__(/*! lodash/isString */ 31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_isString__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isObject__ = __webpack_require__(/*! lodash/isObject */ 2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_isObject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_isArray__ = __webpack_require__(/*! lodash/isArray */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_isArray__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_lodash_forEach__ = __webpack_require__(/*! lodash/forEach */ 38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_lodash_forEach__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_lodash_includes__ = __webpack_require__(/*! lodash/includes */ 30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_lodash_includes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_lodash_includes__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_lodash_now__ = __webpack_require__(/*! lodash/now */ 282);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_lodash_now___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_lodash_now__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_lodash_replace__ = __webpack_require__(/*! lodash/replace */ 283);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_lodash_replace___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13_lodash_replace__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_lodash_map__ = __webpack_require__(/*! lodash/map */ 284);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_lodash_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14_lodash_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_lodash_range__ = __webpack_require__(/*! lodash/range */ 286);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_lodash_range___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_lodash_range__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_lodash_keys__ = __webpack_require__(/*! lodash/keys */ 6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_lodash_keys___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_lodash_keys__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_lodash_find__ = __webpack_require__(/*! lodash/find */ 289);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_lodash_find___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_lodash_find__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_lodash_take__ = __webpack_require__(/*! lodash/take */ 291);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_lodash_take___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_18_lodash_take__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_lodash_head__ = __webpack_require__(/*! lodash/head */ 131);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_lodash_head___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_19_lodash_head__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_lodash_last__ = __webpack_require__(/*! lodash/last */ 49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_lodash_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_20_lodash_last__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_lodash_fp_compose__ = __webpack_require__(/*! lodash/fp/compose */ 127);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_lodash_fp_compose___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_21_lodash_fp_compose__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22_lodash_isEqual__ = __webpack_require__(/*! lodash/isEqual */ 126);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22_lodash_isEqual___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_22_lodash_isEqual__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_lodash_forOwn__ = __webpack_require__(/*! lodash/forOwn */ 292);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_lodash_forOwn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_23_lodash_forOwn__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24_lodash_has__ = __webpack_require__(/*! lodash/has */ 293);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24_lodash_has___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_24_lodash_has__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25_lodash_isFunction__ = __webpack_require__(/*! lodash/isFunction */ 26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25_lodash_isFunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_25_lodash_isFunction__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26_lodash_partial__ = __webpack_require__(/*! lodash/partial */ 295);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26_lodash_partial___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_26_lodash_partial__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27_lodash_cloneDeep__ = __webpack_require__(/*! lodash/cloneDeep */ 296);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27_lodash_cloneDeep___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_27_lodash_cloneDeep__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28_lodash_indexOf__ = __webpack_require__(/*! lodash/indexOf */ 297);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28_lodash_indexOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_28_lodash_indexOf__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29_lodash_clone__ = __webpack_require__(/*! lodash/clone */ 112);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29_lodash_clone___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_29_lodash_clone__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30_lodash_omit__ = __webpack_require__(/*! lodash/omit */ 298);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30_lodash_omit___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_30_lodash_omit__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31_lodash_fromPairs__ = __webpack_require__(/*! lodash/fromPairs */ 302);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31_lodash_fromPairs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_31_lodash_fromPairs__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32_lodash_memoize__ = __webpack_require__(/*! lodash/memoize */ 96);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32_lodash_memoize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_32_lodash_memoize__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33_lodash_reduce__ = __webpack_require__(/*! lodash/reduce */ 303);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33_lodash_reduce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_33_lodash_reduce__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34_lodash_mapValues__ = __webpack_require__(/*! lodash/mapValues */ 306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34_lodash_mapValues___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_34_lodash_mapValues__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__lib_sprintf__ = __webpack_require__(/*! ./lib-sprintf */ 307);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__lib_util__ = __webpack_require__(/*! ./lib-util */ 308);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__hover_options_pure__ = __webpack_require__(/*! ./hover-options-pure */ 128);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__pure__ = __webpack_require__(/*! ./pure */ 130);
function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}/* @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to files in the scripts/ directory, the license.txt file is located at ../license.txt.
*/// import { top_window } from '@core-ui/utils/frame-helpers';
//import ETBuilderSanitize from './et-builder-sanitize';
/**
* Dev use, un-comment out the areas you want to start logging
* uncommenting this will overwrite dynamic setup configurred by ET_FB object.
*/var ET_FB_SETTINGS={// debug: true,
// enableAllLogAreas: true,
// enabledLogAreas: [
// 'general',
// 'store_action_obj',
// 'store_emit',
// 'warning',
// ],
};var rowSlugs=['et_pb_row','et_pb_row_inner'];var columnSlugs=['et_pb_column','et_pb_column_inner'];var toTextOrientation=function toTextOrientation(key){switch(key){case'force_left':return'left';case'justified':return'justify';default:return key;}};var toRTLTextOrientation=function toRTLTextOrientation(key){return Utils.condition('is_rtl')&&'left'===key?'right':key;};var SCROLLBAR_WIDTH;var Cookies=/*#__PURE__*/function(){function Cookies(){_classCallCheck(this,Cookies);Object.defineProperty(this,"postID",{configurable:true,enumerable:true,writable:true,value:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(window.window.ETBuilderBackend,'currentPage.id')});Object.defineProperty(this,"path",{configurable:true,enumerable:true,writable:true,value:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(window.window.ETBuilderBackend,'cookie_path')});}_createClass(Cookies,[{key:"secure",value:function secure(){var cookieWindow=arguments.length>0&&arguments[0]!==undefined?arguments[0]:window;return'https:'===cookieWindow.location.protocol;}},{key:"getName",value:function getName(type,editor){return"et-".concat(type,"-post-").concat(this.postID,"-").concat(editor);}},{key:"set",value:function set(type,editor,value){var cookieExpires=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5*60;var cookieWindow=arguments.length>4&&arguments[4]!==undefined?arguments[4]:window;cookieWindow.wpCookies.set(this.getName(type,editor),__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(value)?editor:value,cookieExpires,this.path,false,this.secure(cookieWindow));}},{key:"get",value:function get(type,editor){var cookieWindow=arguments.length>2&&arguments[2]!==undefined?arguments[2]:window;return cookieWindow.wpCookies.get(this.getName(type,editor));}},{key:"remove",value:function remove(type,editor){var cookieWindow=arguments.length>2&&arguments[2]!==undefined?arguments[2]:window;cookieWindow.wpCookies.remove(this.getName(type,editor),this.path,false,this.secure(cookieWindow));}}]);return Cookies;}();var cookies=new Cookies();var _app_window=window;var _app_document=_app_window.document;var _is_mobile_device=null;var has_localStorage=null;window.jQuery(window).on('et_fb_init',function(){_app_window=window.ET_Builder.Frames.app;_app_document=_app_window.document;});/**
* Global ET_FB Object, accessible from console.
*/var Utils={applyMixinsSafely:function applyMixinsSafely(target){for(var _len=arguments.length,mixins=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){mixins[_key-1]=arguments[_key];}if(__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(mixins)){return;}__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(mixins,function(mixin){__WEBPACK_IMPORTED_MODULE_23_lodash_forOwn___default()(mixin,function(value,member){if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(target[member])){target[member]=__WEBPACK_IMPORTED_MODULE_25_lodash_isFunction___default()(value)?value.bind(target):value;return;// continue
}target[member]=__WEBPACK_IMPORTED_MODULE_25_lodash_isFunction___default()(value)?__WEBPACK_IMPORTED_MODULE_26_lodash_partial___default()(target[member],value.bind(target)):target[member];});});return target;},/**
* Semantical acknowledgement that {@link clone()} usage will not affect performance.
*
* @since 3.0.99
*
* @param {object} obj
*
* @returns {object}
*/intentionallyClone:function intentionallyClone(obj){return __WEBPACK_IMPORTED_MODULE_29_lodash_clone___default()(obj);},/**
* Semantical acknowledgement that {@link cloneDeep()} usage will not affect performance.
*
* @since 3.0.99
*
* @param {object} obj
*
* @returns {object}
*/intentionallyCloneDeep:function intentionallyCloneDeep(obj){return __WEBPACK_IMPORTED_MODULE_27_lodash_cloneDeep___default()(obj);},sanitized_previously:__WEBPACK_IMPORTED_MODULE_36__lib_util__["b" /* sanitizedPreviously */],log:function log(msg,area,type){if(!window.ET_FB.utils.debug()){return false;}var _area=area||'general';if(__WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(window.ET_FB.utils.debugLogAreas(),_area)){var _type=type||'log';switch(_type){case'warn':console.warn(msg);break;case'info':console.info(msg);break;default:console.log(msg);break;}}},sprintf:__WEBPACK_IMPORTED_MODULE_35__lib_sprintf__["a" /* default */],/**
* @alias Pure.isJson
*
* @deprecated
*
* @since 4.3 Deprecated
*/isJson:__WEBPACK_IMPORTED_MODULE_38__pure__["j" /* isJson */],/**
* @alias Pure.isValidHtml
*
* @deprecated
*
* @since 4.3 Deprecated
*/isValidHtml:__WEBPACK_IMPORTED_MODULE_38__pure__["o" /* isValidHtml */],getOS:function getOS(){if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(window.navigator)){if(navigator.appVersion.toLocaleLowerCase().indexOf('win')!==-1){return'Windows';}if(navigator.appVersion.toLocaleLowerCase().indexOf('mac')!==-1){return'MacOS';}if(navigator.appVersion.toLocaleLowerCase().indexOf('x11')!==-1){return'UNIX';}if(navigator.appVersion.toLocaleLowerCase().indexOf('linux')!==-1){return'Linux';}}return'Unknown';},isModuleLocked:function isModuleLocked(module,flattenedSO){var moduleProps=module.props||module;var moduleAddress=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleProps,'address');var isLocked=Utils.isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleProps,'attrs.locked'))||__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleProps,'lockedParent');if(!isLocked){var addressSequences=Utils.getModuleAddressSequence(moduleAddress);__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(addressSequences,function(addressSequence){var ancestorProps=__WEBPACK_IMPORTED_MODULE_17_lodash_find___default()(flattenedSO,{address:addressSequence});if(Utils.isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(ancestorProps,'attrs.locked'))||__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(ancestorProps,'lockedParent')){isLocked=true;return false;// Break the loop
}});}return isLocked;},isModuleDeleted:function isModuleDeleted(props,flattenedSO){var checkAncestor=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs._deleted')){return true;}if(checkAncestor){var addresses=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'address','').split('.');if(addresses.length>1){var addressSequences=Utils.getModuleAddressSequence(addresses);var isAncestorModuleDeleted=false;__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(addressSequences,function(addressSequence){var moduleAncestor=__WEBPACK_IMPORTED_MODULE_17_lodash_find___default()(flattenedSO,{address:addressSequence});if(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleAncestor,'attrs._deleted')){isAncestorModuleDeleted=true;}});if(isAncestorModuleDeleted){return true;}}}return false;},/**
* Returns section/row/column/module based on the Component type.
*
* @since 4.4.0
*
* @param component
*
* @returns {string}
*/getComponentType:function getComponentType(component){var props=component.props||component;var type=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'type');var componentType='module';switch(true){case'et_pb_section'===type:componentType='section';break;case __WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(rowSlugs,type):componentType='row';break;case __WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(columnSlugs,type):componentType='column';break;default:}return componentType;},getModuleSectionType:function getModuleSectionType(module,flattenedSO){var moduleProps=module.props||module;var sectionAddress=__WEBPACK_IMPORTED_MODULE_19_lodash_head___default()(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleProps,'address').split('.'));var section=__WEBPACK_IMPORTED_MODULE_17_lodash_find___default()(flattenedSO,{address:sectionAddress});if(Utils.isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(section,'attrs.fullwidth'))){return'fullwidth';}if(Utils.isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(section,'attrs.specialty'))){return'specialty';}return'regular';},getModuleAncestor:function getModuleAncestor(level,module,flattenedSO){var ancestor;var moduleProps=module.props||module;var sectionType=Utils.getModuleSectionType(moduleProps,flattenedSO);var addressSequences=Utils.getModuleAddressSequence(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(moduleProps,'address',''));__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(addressSequences,function(addressSequence){var ancestorProps=__WEBPACK_IMPORTED_MODULE_17_lodash_find___default()(flattenedSO,{address:addressSequence});var ancestorType=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(ancestorProps,'type','');switch(sectionType){case'specialty':if(0===ancestorType.replace('et_pb_','').indexOf(level)){ancestor=ancestorProps;}break;default:if(ancestorType.replace('et_pb_','')===level){ancestor=ancestorProps;}break;}});return ancestor;},/**
* Returns true/false for a module Type/Attribute.
*
* @since 4.4.0
* @since 4.4.9 Added `removed` check to return non-existent component
*
* @param typeOrAttr
* @param component
*
* @returns {boolean}
*/is:function is(typeOrAttr,component){var props=component.props||component;var bool=false;switch(typeOrAttr){case'section':bool='section'===getComponentType(props);break;case'row':bool='row'===getComponentType(props);break;case'row-inner':bool='et_pb_row_inner'===__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'type');break;case'column':bool='column'===getComponentType(props);break;case'column-inner':bool='et_pb_column_inner'===__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'type');break;case'module':bool='module'===getComponentType(props)&&!__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'is_module_child');break;case'fullwidth':bool=isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.fullwidth'));break;case'regular':bool='section'===getComponentType(props)&&!isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.fullwidth'))&&!isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.specialty'));break;case'specialty':bool=isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.specialty'));break;case'disabled':bool=isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.disabled'));break;case'locked':bool=isOn(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'attrs.locked'));break;case'removed':// Whether it's non-existent component
bool='et-fb-removed-component'===__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,'component_path','');break;default:bool=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,typeOrAttr);}return bool;},/**
* @alias Pure.isOn
*
* @deprecated
*
* @since 4.3 Deprecated
*/isOn:__WEBPACK_IMPORTED_MODULE_38__pure__["m" /* isOn */],/**
* @alias Pure.isOff
*
* @deprecated
*
* @since 4.3 Deprecated
*/isOff:__WEBPACK_IMPORTED_MODULE_38__pure__["l" /* isOff */],/**
* @alias Pure.isOnOff
*
* @deprecated
*
* @since 4.3 Deprecated
*/isOnOff:__WEBPACK_IMPORTED_MODULE_38__pure__["n" /* isOnOff */],/**
* @alias Pure.isYes
*
* @deprecated
*
* @since 4.3 Deprecated
*/isYes:__WEBPACK_IMPORTED_MODULE_38__pure__["p" /* isYes */],/**
* @alias Pure.isNo
*
* @deprecated
*
* @since 4.3 Deprecated
*/isNo:__WEBPACK_IMPORTED_MODULE_38__pure__["k" /* isNo */],/**
* @alias Pure.isDefault
*
* @deprecated
*
* @since 4.3 Deprecated
*/isDefault:__WEBPACK_IMPORTED_MODULE_38__pure__["h" /* isDefault */],isMobileDevice:function isMobileDevice(){if(null===_is_mobile_device){try{document.createEvent('TouchEvent');_is_mobile_device=this.$appWindow().width()<=1024;}catch(e){_is_mobile_device=false;}}return _is_mobile_device;},/**
* @alias Pure.isFileExtension
*
* @deprecated
*
* @since 4.3 Deprecated
*/isFileExtension:__WEBPACK_IMPORTED_MODULE_38__pure__["i" /* isFileExtension */],isIEOrEdge:function isIEOrEdge(){return document.documentMode||window.StyleMedia;},isIE:function isIE(){return this.$appWindow('body').hasClass('ie');},isBlockEditor:function isBlockEditor(){return __WEBPACK_IMPORTED_MODULE_24_lodash_has___default()(window,'wp.blocks');},isRealMobileDevice:function isRealMobileDevice(){return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);},getConditionalDefault:function getConditionalDefault(defaultValue,all_values,setting_resolver,isHover){if(!__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(defaultValue)||!__WEBPACK_IMPORTED_MODULE_7_lodash_isObject___default()(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(defaultValue,'1'))){// Single value, return it
return defaultValue;}// default value depends on dependField
var _defaultValue=_slicedToArray(defaultValue,2),dependField=_defaultValue[0],multipleDefaults=_defaultValue[1];if(isHover){dependField=__WEBPACK_IMPORTED_MODULE_37__hover_options_pure__["a" /* default */].getHoverField(dependField);}var defaultKey=setting_resolver?setting_resolver.resolve(dependField):__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(all_values,dependField);if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(defaultKey)){// uh oh... looks like we can't get a value for dependField
// let's just use the first default then and hope for the best
defaultKey=__WEBPACK_IMPORTED_MODULE_16_lodash_keys___default()(multipleDefaults)[0];}// Return the conditional default
return __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(multipleDefaults,defaultKey);},getValueOrConditionalDefault:function getValueOrConditionalDefault(key,all_values,defaults){var value=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(all_values,key);if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(value)&&value!==''){// We have a value, return it
return value;}return Utils.getConditionalDefault(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(defaults,key),all_values);},condition:function condition(conditionalTag){return __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(window.ETBuilderBackend,['conditionalTags',conditionalTag]);},/**
* @alias Pure.hasNumericValue
*
* @deprecated
*
* @since 4.3 Deprecated
*/hasNumericValue:__WEBPACK_IMPORTED_MODULE_38__pure__["f" /* hasNumericValue */],/**
* @alias Pure.hasValue
*
* @deprecated
*
* @since 4.3 Deprecated
*/hasValue:__WEBPACK_IMPORTED_MODULE_38__pure__["g" /* hasValue */],/**
* @alias Pure.get
*
* @deprecated
*
* @since 4.3 Deprecated
*/get:__WEBPACK_IMPORTED_MODULE_38__pure__["b" /* get */],/**
* Check responsive value existence of responsive inputs (text/range/text margin) by passing its
* *_last_edited value.
*
* @param string Saved *_last_edited attribute.
* @param _last_edited
* @returns Bool.
*/getResponsiveStatus:function getResponsiveStatus(_last_edited){var lastEdited=__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(_last_edited)?_last_edited.split('|'):['off','desktop'];return!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(lastEdited[0])?this.isOn(lastEdited[0]):false;},/**
* Get last edited mode based on *_last_edited attribute.
*
* @since 3.19.5
*
* @param {string} _last_edited Attribute.
* @returns {string} Last edited attribute.
*/getResponsiveLastMode:function getResponsiveLastMode(_last_edited){var lastEdited=__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(_last_edited)?_last_edited.split('|'):['off','desktop'];return __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(lastEdited,[1],'desktop');},parseShortcode:function parseShortcode(shortcode,callback,shortcodeID){var thisClass=this;var msie=document.documentMode;// Make sure the iframeID is unique.
// It's possible that several requests will be started at the same time and now() will return the same value, so append random number.
var iframeID="et-fb-preview-".concat(__WEBPACK_IMPORTED_MODULE_12_lodash_now___default()(),"-").concat(Math.floor(Math.random()*1000+1));var previewUrl="".concat(window.ETBuilderBackend.site_url,"/?et_pb_preview=true&et_pb_preview_nonce=").concat(window.ETBuilderBackend.nonces.preview,"&iframe_id=").concat(iframeID);// Roll in the next lifecycle to get correct shortcode wrapper's width
setTimeout(function(){var shortcodeWrapper=window.jQuery("*[data-shortcode-id=\"".concat(shortcodeID,"\"]"));var shortcodeWidth=shortcodeWrapper.length?"".concat(shortcodeWrapper.width(),"px"):'100%';var $iframe=window.jQuery('<iframe />',{id:iframeID,src:previewUrl,style:"position: absolute; bottom: 0; left: 0; opacity: 0; pointer-events: none; width: ".concat(shortcodeWidth,"; height: 100%;")});var hasRenderPage=false;var request_data={et_pb_preview_nonce:window.ETBuilderBackend.nonces.preview,is_fb_preview:true,shortcode:shortcode};/**
* Append iframe to body.
* Component DOM hasn't ready at this point so it needs to be appended to <body>.
*/window.jQuery('body').append($iframe);/**
* Load iframe's content into page.
*/$iframe.load(function(){/**
* Prevent unnecessary load.
*/if(hasRenderPage){return;}var preview=document.getElementById(iframeID);/**
* IE9 below fix (They have postMessage, but it has to be in string).
*/if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(msie)&&msie<10){request_data=JSON.stringify(request_data);}/**
* Pass shortcode structure to iFrame to be displayed.
*/preview.contentWindow.postMessage(request_data,previewUrl);/**
* Flag to prevent unnecessary load.
*/hasRenderPage=true;/**
* Create IE compatible event handler.
*/var childListenerMethod=window.addEventListener?'addEventListener':'attachEvent';var childListener=window[childListenerMethod];var childListenerEvent='attachEvent'===childListenerMethod?'onmessage':'message';/**
* Listen to message from child window.
*/childListener(childListenerEvent,function(event){if(event.data.iframe_id===iframeID&&__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(event.data.html)&&thisClass.hasValue(event.data)){callback(event.data);/**
* Remove event since the data has been passed to callback.
*/$iframe.remove();}},false);});},0);},processFontIcon:function processFontIcon(fontIcon,isFontIconsDown){if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(fontIcon)){return null;}var index=parseInt(fontIcon.replace(/[^0-9]/g,''));var iconSymbols=isFontIconsDown?window.ETBuilderBackend.fontIconsDown:window.ETBuilderBackend.fontIcons;if(null!==fontIcon.trim().match(/^%%/)&&!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(iconSymbols[index])){fontIcon=iconSymbols[index];}// Return null if empty so that can be used directly in render HTML attributes.
return fontIcon?window.jQuery.parseHTML(__WEBPACK_IMPORTED_MODULE_5_lodash_unescape___default()(fontIcon))[0].nodeValue:null;},generateResponsiveCss:function generateResponsiveCss(responsive_values,selector,css_property,additional_css){if(__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(responsive_values)){return'';}var processed_css=[];__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(responsive_values,function(value,device){if(''===value||'undefined'===typeof value){return;}var current_css={selector:selector,declaration:'',device:device};var append_css=typeof additional_css!=='undefined'&&''!==additional_css?additional_css:';';if(Array.isArray(value)&&!__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(value)){__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(value,function(this_value,this_property){if(''===this_value){return;}current_css.declaration+="".concat(this_property,":").concat(this_value).concat(append_css);});}else{current_css.declaration="".concat(css_property,":").concat(value).concat(append_css);}processed_css.push(current_css);});return processed_css;},/**
* @alias Pure.generatePlaceholderCss
*
* @deprecated
*
* @since 4.3 Deprecated
*/generatePlaceholderCss:__WEBPACK_IMPORTED_MODULE_38__pure__["a" /* generatePlaceholderCss */],/**
* @alias Pure.replaceCodeContentEntities
*
* @deprecated
*
* @since 4.3 Deprecated
*/replaceCodeContentEntities:__WEBPACK_IMPORTED_MODULE_38__pure__["r" /* replaceCodeContentEntities */],/**
* @alias Pure.removeFancyQuotes
*
* @deprecated
*
* @since 4.3 Deprecated
*/removeFancyQuotes:__WEBPACK_IMPORTED_MODULE_38__pure__["q" /* removeFancyQuotes */],// replication of et_builder_process_range_value()
processRangeValue:function processRangeValue(range,option_type){if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(range)){return'';}var range_processed='string'===typeof range?range.trim():range;var range_digit=parseFloat(range_processed);var range_string=range_processed.toString().replace(range_digit,'');var option_type_processed=typeof option_type!=='undefined'?option_type:'';var result;if(''===range_string){range_string='line_height'===option_type_processed&&3>=range_digit?'em':'px';}if(isNaN(range_digit)){return'';}result=range_digit.toString()+range_string;return result;},/**
* @alias Pure.getCorners
*
* @deprecated
*
* @since 4.3 Deprecated
*/getCorners:__WEBPACK_IMPORTED_MODULE_38__pure__["d" /* getCorners */],/**
* @alias Pure.getCorner
*
* @deprecated
*
* @since 4.3 Deprecated
*/getCorner:__WEBPACK_IMPORTED_MODULE_38__pure__["c" /* getCorner */],/**
* @alias Pure.getSpacing
*
* @deprecated
*
* @since 4.3 Deprecated
*/getSpacing:__WEBPACK_IMPORTED_MODULE_38__pure__["e" /* getSpacing */],getBreakpoints:function getBreakpoints(){return['desktop','tablet','phone'];},getPrevBreakpoint:function getPrevBreakpoint(name){return Utils.getBreakpoints()[__WEBPACK_IMPORTED_MODULE_28_lodash_indexOf___default()(Utils.getBreakpoints(),name)-1];},getNextBreakpoint:function getNextBreakpoint(name){return Utils.getBreakpoints()[__WEBPACK_IMPORTED_MODULE_28_lodash_indexOf___default()(Utils.getBreakpoints(),name)+1];},getPreviewModes:function getPreviewModes(){return['wireframe','zoom','desktop','tablet','phone'];},/*
getGradient(args) {
const defaultArgs = {
type: window.ETBuilderBackend.defaults.backgroundOptions.type,
direction: window.ETBuilderBackend.defaults.backgroundOptions.direction,
radialDirection: window.ETBuilderBackend.defaults.backgroundOptions.radialDirection,
colorStart: window.ETBuilderBackend.defaults.backgroundOptions.colorStart,
colorEnd: window.ETBuilderBackend.defaults.backgroundOptions.colorEnd,
startPosition: window.ETBuilderBackend.defaults.backgroundOptions.startPosition,
endPosition: window.ETBuilderBackend.defaults.backgroundOptions.endPosition,
};
args = assign(defaultArgs, pickBy(args, this.hasValue));
const direction = 'linear' === args.type ? args.direction : `circle at ${args.radialDirection}`;
const startPosition = ETBuilderSanitize.sanitizeInputUnit(args.startPosition, undefined, '%');
const endPosition = ETBuilderSanitize.sanitizeInputUnit(args.endPosition, undefined, '%');
return `${args.type}-gradient(
${direction},
${args.colorStart} ${startPosition},
${args.colorEnd} ${endPosition}
)`;
},
*/removeClassNameByPrefix:function removeClassNameByPrefix(prefix,el){var $element='undefined'===typeof el?window.jQuery('body'):window.jQuery(el);var domClasses=$element.attr('class');var regex=new RegExp("".concat(prefix,"[^\\s]+"),'g');if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(domClasses)){return;}var domClass=domClasses.replace(regex,'');$element.attr('class',window.jQuery.trim(domClass));},getKeyboardList:function getKeyboardList(name){var list;switch(name){case'sectionLayout':list=['49','50','51'];break;case'rowLayout':list=['49','50','51','52','53','54','55','56','57','48','189'];break;case'arrowDirections':list=['38',// up
'39',// right
'40',// down
'37'];break;default:list=false;break;}return list;},getRowLayouts:function getRowLayouts(type,layout){var rowLayouts='et_pb_row'===type?window.ETBuilderBackend.columnLayouts.regular:[];// Generate row layouts based on specialty layout
if('et_pb_row_inner'===type&&!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(layout)){var specialtyRowSpec=window.ETBuilderBackend.columnLayouts.specialty[layout];rowLayouts=__WEBPACK_IMPORTED_MODULE_14_lodash_map___default()(__WEBPACK_IMPORTED_MODULE_15_lodash_range___default()(specialtyRowSpec.columns),function(unformattedColumnIndex){var columnIndex=unformattedColumnIndex+1;return 1===columnIndex?'4_4':__WEBPACK_IMPORTED_MODULE_14_lodash_map___default()(__WEBPACK_IMPORTED_MODULE_15_lodash_range___default()(columnIndex),function(){return"1_".concat(columnIndex);}).join(',');});}return rowLayouts;},// The following funciton is totally different than functions in BB used to request and set font.
// TODO Do we need to replicate all the functions from BB which are used to set google fonts? Many of them can be modified by users via filters or simply overriden.
maybeLoadFont:function maybeLoadFont(font_name,font_option){var $head=this.$topWindow('head').add(window.jQuery('head'));var fonts_data=window.ETBuilderBackend.et_builder_fonts_data;var user_fonts=window.ETBuilderBackend.customFonts;var removedFonts=window.ETBuilderBackend.removedFonts;var useGoogleFonts=window.ETBuilderBackend.useGoogleFonts;var websafeFonts=__WEBPACK_IMPORTED_MODULE_16_lodash_keys___default()(window.ETBuilderBackend.websafeFonts);var font_styles=typeof fonts_data[font_name]!=='undefined'&&typeof fonts_data[font_name].styles!=='undefined'?":".concat(fonts_data[font_name].styles):'';var subset=typeof fonts_data[font_name]!=='undefined'&&typeof fonts_data[font_name].character_set!=='undefined'?"&".concat(fonts_data[font_name].character_set):'';var requestFontName=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(removedFonts,"".concat(font_name,".parent_font"),false)?removedFonts[font_name].parent_font:font_name;var fontClass=this.fontnameToClass(font_name);// load user font or google font
if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(user_fonts[font_name])){if($head.find("style#".concat(fontClass)).length){return;}var savedFontFiles=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(user_fonts[font_name],'font_url','');var fontSrc=__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(savedFontFiles)?"src: url('".concat(savedFontFiles,"');"):'';// generate the @font-face src from the uploaded font files
// all the font formats have to be added in certain order to provide the best browser support
if(''===fontSrc&&!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(savedFontFiles)){var allFontFiles={eot:{url:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(savedFontFiles,'eot',false),format:'embedded-opentype'},woff2:{url:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(savedFontFiles,'woff2',false),format:'woff2'},woff:{url:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(savedFontFiles,'woff',false),format:'woff'},ttf:{url:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(savedFontFiles,'ttf',false),format:'truetype'},otf:{url:__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(savedFontFiles,'otf',false),format:'opentype'}};if(allFontFiles.eot.url){fontSrc="src: url('".concat(allFontFiles.eot.url,"'); src: url('").concat(allFontFiles.eot.url,"?#iefix') format('embedded-opentype')");}__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(allFontFiles,function(fontData,extension){if('eot'!==extension&&fontData.url){fontSrc+=''===fontSrc?'src: ':', ';fontSrc+="url('".concat(fontData.url,"') format('").concat(fontData.format,"')");}});}$head.append("<style id=\"".concat(fontClass,"\">@font-face{font-family:\"").concat(font_name,"\"; ").concat(fontSrc,";}</style>"));}else{if($head.find("link#".concat(fontClass)).length||!useGoogleFonts||__WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(websafeFonts,font_name)){return;}// Convert google font name for URL
font_name=requestFontName.replace(/ /g,'+');$head.append("<link id=\"".concat(fontClass,"\" href=\"//fonts.googleapis.com/css?family=").concat(font_name).concat(font_styles).concat(subset,"\" rel=\"stylesheet\" type=\"text/css\" />"));}},fontnameToClass:function fontnameToClass(option_value){return"et_gf_".concat(option_value.replace(/ /g,'_').toLowerCase());},callWindow:function callWindow(fun){if(__WEBPACK_IMPORTED_MODULE_24_lodash_has___default()(window,fun)){for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(window,fun).apply(void 0,args);}},$appDocument:function $appDocument(){var selector=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.appDocument();return _app_window.window.jQuery(selector);},$appWindow:function $appWindow(){var selector=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.appWindow();return _app_window.window.jQuery(selector);},$topDocument:function $topDocument(){var selector=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.topDocument();return this.topWindow().window.jQuery(selector);},$topWindow:function $topWindow(){var selector=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.topWindow();return this.topWindow().window.jQuery(selector);},$TBViewport:function $TBViewport(){return this.$topWindow('.et-common-visual-builder:first');},$TBScrollTarget:function $TBScrollTarget(){return this.$TBViewport().find('#et-fb-app');},topViewportWidth:function topViewportWidth(){return this.isTB()?this.$TBViewport().width():this.$topWindow().width();},topViewportHeight:function topViewportHeight(){return this.isTB()?this.$TBViewport().height():this.$topWindow().height();},viewportScrollTop:function viewportScrollTop(){var mode=this.appWindow().ET_Builder.API.State.View_Mode;if(this.isTB()){return this.$TBScrollTarget().scrollTop();}return this.isBFB()||mode.isPhone()||mode.isTablet()?this.$topWindow().scrollTop():this.$appWindow().scrollTop();},/**
* Returns top window width
* If is BFB, then is not used the actual window width, but container where builder is rendered.
*
* @returns {number}
*/getTopWindowWidth:function getTopWindowWidth(){return Utils.isBFB()?Utils.$topWindow('#et_pb_layout').width():Utils.$topWindow().width();},appDocument:function appDocument(){return _app_document;},appWindow:function appWindow(){return _app_window;},topDocument:function topDocument(){return this.topWindow().document;},topWindow:function topWindow(){return window;// return top_window;
},hasFixedHeader:function hasFixedHeader(){return __WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(['fixed','absolute'],window.jQuery('header').css('position'));},isElementInViewport:function isElementInViewport(element){if(element.length>0){element=element[0];}if(__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(element)){return;}var _window=element.ownerDocument?element.ownerDocument.defaultView:element.defaultView;var $window=_window.window.jQuery&&_window.window.jQuery(_window);var iframe_rect=_window.frameElement?_window.frameElement.getBoundingClientRect():{};if(!$window){return;}var _element$getBoundingC=element.getBoundingClientRect(),top=_element$getBoundingC.top,height=_element$getBoundingC.height;if(iframe_rect.top){top-=Math.abs(iframe_rect.top);}var _window_height=$window.height();var offset=0;if(this.hasFixedHeader()){offset=window.jQuery('header').height();}return top<=_window_height&&top>=offset;},getCommentsMarkup:function getCommentsMarkup(headerLevel,formTitleLevel){var processedHeaderLevel=__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(headerLevel)?'h1':headerLevel;var commentsMarkup=window.ETBuilderBackend.commentsModuleMarkup;// update header level in comments markup if needed
if('h1'!==headerLevel){commentsMarkup=commentsMarkup.replace('<h1',"<".concat(headerLevel));commentsMarkup=commentsMarkup.replace('</h1>',"</".concat(headerLevel,">"));}// Update form title heading level in comments markup if needed.
if('h3'!==formTitleLevel){// Maybe there is a case when users set same heading level for header and
// form title element. Uses regex to fetch form title correctly.
var formTitleRegex=new RegExp('<h3 id="reply-title" class="comment-reply-title">(.*?)<\/h3>','g');commentsMarkup=__WEBPACK_IMPORTED_MODULE_13_lodash_replace___default()(commentsMarkup,formTitleRegex,function(matchedStrings){matchedStrings=matchedStrings.replace('<h3',"<".concat(formTitleLevel));matchedStrings=matchedStrings.replace('</h3>',"</".concat(formTitleLevel,">"));return matchedStrings;});}return commentsMarkup;},decodeHtmlEntities:function decodeHtmlEntities(value){value=!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(value)?'':value;return value.replace(/&#(\d+);/g,function(match,dec){return String.fromCharCode(dec);});},isLimitedMode:function isLimitedMode(){return this.condition('is_limited_mode');},isBFB:function isBFB(){return this.condition('is_bfb');},isTB:function isTB(){return this.condition('is_tb');},isLB:function isLB(){return this.condition('is_layout_block');},isFB:function isFB(){return!this.isBFB()&&!this.isTB()&&!this.isLB();},/**
* Get window scroll location based on preview mode & builder type.
*
* @since 3.21.1
* @param previewMode
* @param {string} preview Mode.
* @returns {string} App|top.
*/getWindowScrollLocation:function getWindowScrollLocation(previewMode){return!this.condition('is_bfb')&&__WEBPACK_IMPORTED_MODULE_11_lodash_includes___default()(['wireframe','desktop'],previewMode)?'app':'top';},hasBodyMargin:function hasBodyMargin(){return window.jQuery('#et_pb_root').hasClass('et-fb-has-body-margin');},/**
* Fix a slider's container min-height and image size/position via et_fix_slider_height();.
*
* @param {window.jQuery} $slider
*/fixSliderHeight:function fixSliderHeight($slider){setTimeout(function(){return window.et_fix_slider_height($slider);},600);},/**
* Fix broken animated and waypoint module in builder rendered as module content area. This builder content arrives
* late as string of HTML and need to be reinitialized.
*
* @param {window.jQuery} $slider
*/fixBuilderContent:function fixBuilderContent($slider){setTimeout(function(){// load waypoint modules such as counters and animated images
$slider.find('.et-waypoint, .et_pb_circle_counter, .et_pb_number_counter').each(function(){var $waypointModule=window.jQuery(this);if($waypointModule.hasClass('et_pb_circle_counter')){Utils.appWindow().et_pb_reinit_circle_counters($waypointModule);if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()($waypointModule.data('easyPieChart'))){$waypointModule.data('easyPieChart').update($waypointModule.data('number-value'));}}if($waypointModule.hasClass('et_pb_number_counter')){Utils.appWindow().et_pb_reinit_number_counters($waypointModule);if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()($waypointModule.data('easyPieChart'))){$waypointModule.data('easyPieChart').update($waypointModule.data('number-value'));}}if($waypointModule.find('.et_pb_counter_amount').length>0){$waypointModule.find('.et_pb_counter_amount').each(function(){Utils.appWindow().et_bar_counters_init(window.jQuery(this));});}$waypointModule.css({opacity:'1'});});// Initialize parallax background
if($slider.find('.et_parallax_bg').length){$slider.find('.et_parallax_bg').each(function(){window.et_pb_parallax_init(window.jQuery(this));});}Utils.appWindow().et_reinit_waypoint_modules();if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(window.et_shortcodes_init)){Utils.appWindow().et_shortcodes_init($slider);}Utils.$appWindow().trigger('resize');},0);},triggerResizeForUIUpdate:function triggerResizeForUIUpdate(){var _this=this;clearTimeout(window.ETBuilderFauxResize);window.ETBuilderFauxResize=setTimeout(function(){var thisClass=_this;window.jQuery(window).trigger('resize');Utils.callWindow('et_fix_page_container_position');// Automatically blur if WordPress' main tinyMCE iframe is intentionally focused in BFB to avoid
// keydown event which triggers builder shortcut not being tracked
if(thisClass.condition('is_bfb')){// Wait for 200ms. It generally took 200ms or more from any event to unintentional focus state of #content_ifr
setTimeout(function(){if(window.jQuery(document.activeElement).is('iframe')){window.jQuery(document.activeElement).trigger('blur');}},200);}},200);},/**
* Retrieve assigned heading level from module attributes.
*
* @param Module Props.
* @param props
* @param defaultLevel
* @returns String HTML heading level. `h2` by default.
*/getHeadingLevel:function getHeadingLevel(props){var defaultLevel=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'h2';var parentAttrs=props.parentAttrs;var attrs=props.attrs;if(this.hasValue(attrs.header_level)){return attrs.header_level;}if(this.hasValue(parentAttrs)&&this.hasValue(parentAttrs.header_level)){return parentAttrs.header_level;}return defaultLevel;},/**
* Generates row CSS class which represents the row structure.
*
* @param Row Props.
* @param rowProps
* @returns String Row spcecial structure class like et_pb_row_1-4_3-4 etc.
*/generateRowStructureClass:function generateRowStructureClass(rowProps){if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(rowProps.content)||''===rowProps.content||__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(rowProps.content)){return'';}var rowClass='';__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(rowProps.content,function(columnData){var columnType=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(columnData,'attrs.type');if(columnType&&__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(columnType)){rowClass+="_".concat(columnType.replace('_','-').trim());}});switch(rowClass){case'_4-4':case'_1-2_1-2':case'_1-3_1-3_1-3':case'_2-5_3-5':case'_3-5_2-5':case'_1-3_2-3':case'_2-3_1-3':case'_1-5_3-5_1-5':case'_3-8_3-8':case'_1-3_1-3':// intentional fallthrough. These row structure class doesn't need to be printed on VB
// because these structures are not printed on FE as well
rowClass='';break;case'_1-4_1-4_1-4_1-4':rowClass='et_pb_row_4col';break;case'_1-5_1-5_1-5_1-5_1-5':rowClass='et_pb_row_5col';break;case'_1-6_1-6_1-6_1-6_1-6_1-6':rowClass='et_pb_row_6col';break;default:rowClass="et_pb_row".concat(rowClass);}return rowClass;},shouldComponentUpdate:function shouldComponentUpdate(component,nextProps,nextState){var nextPropsUpdated=nextProps;var currentPropsUpdated=component.props;// Use reduced versions of props in wireframe mode to avoid unneeded renders.
if(component.props.wireframeMode){nextPropsUpdated=this._cleanPropsForWireframeComparison(nextProps);currentPropsUpdated=this._cleanPropsForWireframeComparison(component.props);}return!__WEBPACK_IMPORTED_MODULE_22_lodash_isEqual___default()(nextPropsUpdated,currentPropsUpdated)||!__WEBPACK_IMPORTED_MODULE_22_lodash_isEqual___default()(nextState,component.state);},/**
* Prepare module props for the comparison omitting all the data which doesn't matter in Wireframe mode.
*
* @param props
*/_cleanPropsForWireframeComparison:function _cleanPropsForWireframeComparison(props){var _this2=this;if(__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(props)){return props;}var cleanProps=__WEBPACK_IMPORTED_MODULE_30_lodash_omit___default()(props,['attrs','children','content']);if(props.attrs){cleanProps.attrs=__WEBPACK_IMPORTED_MODULE_1_lodash_pick___default()(props.attrs,['locked','global_module','admin_label','collapsed','ab_subject_id','ab_goal','disabled','disabled_on','column_structure','type','_deleted']);}if(props.content&&__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(props.content)&&!__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(props.content)){cleanProps.content=[];__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(props.content,function(singleProp){cleanProps.content.push(_this2._cleanPropsForWireframeComparison(singleProp));});}else if(!__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(props.content)){cleanProps.content='';}return cleanProps;},getAdminBarHeight:function getAdminBarHeight(){if(this.isTB()){return 32;}var $bar=this.$topWindow('#wpadminbar');return $bar.length>0?parseInt($bar.innerHeight()):0;},getScrollbarWidth:__WEBPACK_IMPORTED_MODULE_36__lib_util__["a" /* getScrollbarWidth */],maybeGetScrollbarWidth:function maybeGetScrollbarWidth(){if(Utils.isBFB()){return 0;}var $html=Utils.isTB()?Utils.$appWindow('html'):Utils.$topWindow('html');if(!Utils.isTB()&&($html.hasClass('et-fb-preview--tablet')||$html.hasClass('et-fb-preview--phone'))){return 0;}var adminbarHeight=this.getAdminBarHeight();var hasScrollbar=Utils.$appWindow('html').height()+adminbarHeight>Utils.$topWindow('html').height();return hasScrollbar?Utils.getScrollbarWidth():0;},getScrollTargets:function getScrollTargets(){var mode=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(Utils.appWindow(),'ET_Builder.API.State.View_Mode',{});var $targets=Utils.$appWindow('html');if(Utils.isTB()){$targets=this.$TBScrollTarget();}else if(!Utils.isBlockEditor()&&(Utils.isBFB()||!(mode.isDesktop()||mode.isWireframe()))){$targets=Utils.$topWindow('html');}return $targets;},getScrollEventTarget:function getScrollEventTarget(){var mode=Utils.appWindow().ET_Builder.API.State.View_Mode;var target=Utils.appWindow();if(Utils.isTB()){target=this.$TBScrollTarget().get(0);}else if(Utils.isBFB()||!(mode.isDesktop()||mode.isWireframe())){target=Utils.topWindow();}return target;},enableScrollLock:function enableScrollLock(){var $pageSettingsBar=Utils.$topWindow('.et-fb-page-settings-bar');var $wpadminbar=Utils.$topWindow('#wpadminbar');var $fixedTopHeader=Utils.$topWindow('.et_fixed_nav:not(.et_vertical_nav) #top-header');var $fixedMainHeader=Utils.$topWindow('.et_fixed_nav:not(.et_vertical_nav) #main-header');var mode=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(Utils.appWindow(),'ET_Builder.API.State.View_Mode',{});// Page Settings Bar Location
var isPageSettingsCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--corner');var isPageSettingsRightCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--right-corner');var isPageSettingsLeftCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--left-corner');var isPageSettingsRight=$pageSettingsBar.hasClass('et-fb-page-settings-bar--right');var isPageSettingsVertical=$pageSettingsBar.hasClass('et-fb-page-settings-bar--vertical');var $scrollTargets=this.getScrollTargets();$scrollTargets.css({overflowY:'hidden',paddingRight:Utils.getScrollbarWidth()});if(!Utils.isBFB()){// If page settings bar is top or bottom, subtract scrollbar width from width
if(!isPageSettingsCorner&&!isPageSettingsVertical){$pageSettingsBar.css('width',"calc(100% - ".concat(SCROLLBAR_WIDTH,"px)"));}// If page settings bar is left corner, offset right column by scrollbar width
if(isPageSettingsLeftCorner){$pageSettingsBar.find('.et-fb-page-settings-bar__column--right').css('right',SCROLLBAR_WIDTH);}}// Offset wpadminbar by scrollbar width
$wpadminbar.css('width',"calc(100% - ".concat(SCROLLBAR_WIDTH,"px)"));// Offset header by scrollbar width
$fixedTopHeader.css('width',"calc(100% - ".concat(SCROLLBAR_WIDTH,"px)"));$fixedMainHeader.css('width',"calc(100% - ".concat(SCROLLBAR_WIDTH,"px)"));},disableScrollLock:function disableScrollLock(){var $pageSettingsBar=Utils.$topWindow('.et-fb-page-settings-bar');var $wpadminbar=Utils.$topWindow('#wpadminbar');var $fixedTopHeader=Utils.$topWindow('.et_fixed_nav:not(.et_vertical_nav) #top-header');var $fixedMainHeader=Utils.$topWindow('.et_fixed_nav:not(.et_vertical_nav) #main-header');var mode=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(Utils.appWindow(),'ET_Builder.API.State.View_Mode',{});// Page Settings Bar Location
var isPageSettingsCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--corner');var isPageSettingsRightCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--right-corner');var isPageSettingsLeftCorner=$pageSettingsBar.hasClass('et-fb-page-settings-bar--left-corner');var isPageSettingsRight=$pageSettingsBar.hasClass('et-fb-page-settings-bar--right');var isPageSettingsVertical=$pageSettingsBar.hasClass('et-fb-page-settings-bar--vertical');var $scrollTargets=this.getScrollTargets();$scrollTargets.css({overflowY:'auto',paddingRight:0});if(!Utils.isBFB()&&!Utils.isTB()){// If page settings bar is top or bottom remove width
if(!isPageSettingsCorner&&!isPageSettingsVertical){$pageSettingsBar.css('width','');}// If page settings bar is left corner, remove scrollbar width offset from right column
if(isPageSettingsLeftCorner){$pageSettingsBar.find('.et-fb-page-settings-bar__column--right').css('right',0);}}if(Utils.condition('is_bfb')){// Remove admin topbar offset
$wpadminbar.css('width','100%');}// Remove header offset
$fixedTopHeader.css('width','');$fixedMainHeader.css('width','');},cookies:cookies,getEventsTarget:function getEventsTarget(responsiveView){return this.isBFB()||responsiveView?this.topWindow():this.appWindow();},linkRel:function linkRel(savedRel){var rel=[];if(savedRel){var relMap=['bookmark','external','nofollow','noreferrer','noopener'];var selectedRels=savedRel.split('|');selectedRels.forEach(function(value,index){if(!value||'off'===value){return;}rel.push(relMap[index]);});}return rel.length?rel.join(' '):null;},// It's a replication of et_builder_set_element_font()
setElementFont:function setElementFont(font_data,use_important,default_values){var style='';if(''===font_data||__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(font_data)){return'';}// It's a replication of et_builder_get_websafe_font_stack() function from BB
function getWebsafeFontStack(font_type){var type=font_type||'sans-serif';var font_stack=type;switch(type){case'sans-serif':font_stack='Helvetica, Arial, Lucida, sans-serif';break;case'serif':font_stack='Georgia, "Times New Roman", serif';break;case'cursive':font_stack='cursive';break;}return font_stack;}// It's a replication of et_builder_get_font_family() function from BB
function setElementFontFamily(font_name,use_important){var fonts=__WEBPACK_IMPORTED_MODULE_24_lodash_has___default()(window.ETBuilderBackend.customFonts,font_name,false)?window.ETBuilderBackend.customFonts:window.ETBuilderBackend.et_builder_fonts_data;var important_tag=use_important?' !important':'';var removedFonts=window.ETBuilderBackend.removedFonts;var websafe_font_stack;var font_style;var font_weight;var font_name_ms;var style;font_name_ms=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(fonts[font_name])&&!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(fonts[font_name].add_ms_version)?"'".concat(font_name," MS', "):'';if(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(removedFonts,font_name,false)){font_style=removedFonts[font_name].styles;font_name=removedFonts[font_name].parent_font;}if(''!==font_style){font_weight=" font-weight:".concat(font_style,";");}websafe_font_stack=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(fonts[font_name])?getWebsafeFontStack(fonts[font_name].type):'serif';style="".concat('font-family:'+"'").concat(font_name,"',").concat(font_name_ms).concat(websafe_font_stack).concat(important_tag,";").concat(font_weight);return style;}function setElementFontStyle(property,default_value,value,property_default,property_value,use_important){var style='';var important_tag=use_important?' !important':'';if(value&&!default_value){style="".concat(property,":").concat(property_value).concat(important_tag,";");}else if(!value&&default_value){style="".concat(property,":").concat(property_default).concat(important_tag,";");}return style;}var font_values=font_data?font_data.split('|'):[];var default_values_processed='undefined'===typeof default_values?'||||||||':default_values;var font_values_default=default_values_processed.split('|');if(!__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(font_values)){var font_name=font_values[0];var font_weight=''!==font_values[1]?font_values[1]:'';var is_font_italic='on'===font_values[2];var is_font_uppercase='on'===font_values[3];var is_font_underline='on'===font_values[4];var is_font_small_caps='on'===font_values[5];var is_font_line_through='on'===font_values[6];var font_line_color=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(font_values[7])?font_values[7]:'';var font_line_style=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(font_values[8])?font_values[8]:'';var font_name_default='Default';var font_weight_default=''!==font_values_default[1]?font_values_default[1]:'';var is_font_italic_default='on'===font_values_default[2];var is_font_uppercase_default='on'===font_values_default[3];var is_font_underline_default='on'===font_values_default[4];var is_font_small_caps_default='on'===font_values_default[5];var is_font_line_through_default='on'===font_values_default[6];var font_line_color_default='';var font_line_style_default='';// transform old values to new format
font_weight='on'===font_weight?'700':font_weight;font_weight_default='on'===font_weight_default?'700':font_weight_default;if(''!==font_name&&font_name_default!==font_name){this.maybeLoadFont(font_name);style+=setElementFontFamily(font_name,use_important);}style+=setElementFontStyle('font-weight',''!==font_weight_default,''!==font_weight,'normal',font_weight,use_important);style+=setElementFontStyle('font-style',is_font_italic_default,is_font_italic,'normal','italic',use_important);style+=setElementFontStyle('text-transform',is_font_uppercase_default,is_font_uppercase,'none','uppercase',use_important);style+=setElementFontStyle('text-decoration',is_font_underline_default,is_font_underline,'none','underline',use_important);style+=setElementFontStyle('font-variant',is_font_small_caps_default,is_font_small_caps,'none','small-caps',use_important);style+=setElementFontStyle('text-decoration',is_font_line_through_default,is_font_line_through,'none','line-through',use_important);style+=setElementFontStyle('text-decoration-style',''!==font_line_style_default,''!==font_line_style,'solid',font_line_style,use_important);style+=setElementFontStyle('-webkit-text-decoration-color',''!==font_line_color_default,''!==font_line_color,'',font_line_color,use_important);style+=setElementFontStyle('text-decoration-color',''!==font_line_color_default,''!==font_line_color,'',font_line_color,use_important);style=style.trim();}return style;},/**
* Set reset CSS style declaration to normalize the existing font styles value from another font
* options group.
*
* @since 3.23
*
* @param {string} currentValue Current font option value.
* @param {string} comparedValue Compared or parent font option value.
* @param {boolean} useImportant Imporant status.
* @returns {string} Generated reset font styles.
*/setResetFontStyle:function setResetFontStyle(currentValue,comparedValue){var useImportant=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;// Being save, ensure current and compared values are valid string.
if(!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(currentValue)||!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(comparedValue)){return'';}var currentPieces=currentValue.split('|');var comparedPieces=comparedValue.split('|');if(__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(currentPieces)||__WEBPACK_IMPORTED_MODULE_9_lodash_isEmpty___default()(comparedPieces)){return'';}// Current value font style status.
var isCurrentItalic=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(currentPieces[2])&&'on'===currentPieces[2];var isCurrentUppercase=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(currentPieces[3])&&'on'===currentPieces[3];var isCurrentUnderline=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(currentPieces[4])&&'on'===currentPieces[4];var isCurrentSmallCaps=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(currentPieces[5])&&'on'===currentPieces[5];var isCurrentLineThrough=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(currentPieces[6])&&'on'===currentPieces[6];// Compared value font style status.
var isComparedItalic=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(comparedPieces[2])&&'on'===comparedPieces[2];var isComparedUppercase=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(comparedPieces[3])&&'on'===comparedPieces[3];var isComparedUnderline=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(comparedPieces[4])&&'on'===comparedPieces[4];var isComparedSmallCaps=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(comparedPieces[5])&&'on'===comparedPieces[5];var isComparedLineThrough=!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(comparedPieces[6])&&'on'===comparedPieces[6];var style='';var important=useImportant?' !important':'';// Reset italic.
if(!isCurrentItalic&&isComparedItalic){style+="font-style: normal".concat(important,";");}// Reset uppercase.
if(!isCurrentUppercase&&isComparedUppercase){style+="text-transform: none".concat(important,";");}// Reset small caps.
if(!isCurrentSmallCaps&&isComparedSmallCaps){style+="font-variant: none".concat(important,";");}// Reset underline.
if(!isCurrentUnderline&&isComparedUnderline){var underlineValue=isCurrentLineThrough||isComparedLineThrough?'line-through':'none';style+="text-decoration: ".concat(underlineValue).concat(important,";");}// Reset line through.
if(!isCurrentLineThrough&&isComparedLineThrough){var lineThroughValue=isCurrentUnderline||isComparedUnderline?'underline':'none';style+="text-decoration: ".concat(lineThroughValue).concat(important,";");}return style;},/**
* Decode encoded string of option_list field type into object.
*
* @param string Encoded string of saved option_list field type attribute.
* @param value
* @returns Object.
*/decodeOptionListValue:function decodeOptionListValue(value){var encodedBrackets=['[',']'];var decodedBrackets=['[',']'];return!value?value:JSON.parse(__WEBPACK_IMPORTED_MODULE_13_lodash_replace___default()(__WEBPACK_IMPORTED_MODULE_13_lodash_replace___default()(value,encodedBrackets[0],decodedBrackets[0]),encodedBrackets[1],decodedBrackets[1]));},/**
* Check whether current module has background or not.
*
* @param {object} module Attributes.
* @param {Array} background Types to be checked.
* @param moduleAttrs
* @param backgroundTypes
* @returns {bool} Has background or not.
*/moduleHasBackground:function moduleHasBackground(moduleAttrs,backgroundTypes){var _this3=this;var allBackgroundTypes=['color','gradient','image','video'];var types=__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(backgroundTypes)?allBackgroundTypes:backgroundTypes;var hasBackground=false;var hasBackgroundVideoMp4;var hasBackgroundVideoWebm;__WEBPACK_IMPORTED_MODULE_10_lodash_forEach___default()(types,function(type){switch(type){case'color':hasBackground=_this3.hasValue(moduleAttrs.background_color);break;case'gradient':hasBackground=_this3.isOn(moduleAttrs.use_background_color_gradient);break;case'image':hasBackground=_this3.hasValue(moduleAttrs.background_image);break;case'video':hasBackgroundVideoMp4=_this3.hasValue(moduleAttrs.background_video_mp4);hasBackgroundVideoWebm=_this3.hasValue(moduleAttrs.background_video_webm);hasBackground=hasBackgroundVideoMp4||hasBackgroundVideoWebm;break;}// Stop forEach loop if one of the background has value.
// Return false stops lodash's forEach loop from continuing
return!hasBackground;});return hasBackground;},/**
* Normalize video dimension.
*
* @param $element window.jQuery element.
*/fitVids:function fitVids($element){if($element.length){$element.fitVids({customSelector:"iframe[src^='http://www.hulu.com'], iframe[src^='http://www.dailymotion.com'], iframe[src^='http://www.funnyordie.com'], iframe[src^='https://embed-ssl.ted.com'], iframe[src^='http://embed.revision3.com'], iframe[src^='https://flickr.com'], iframe[src^='http://blip.tv'], iframe[src^='http://www.collegehumor.com']"});}},toTextOrientation:toTextOrientation,getTextOrientation:__WEBPACK_IMPORTED_MODULE_21_lodash_fp_compose___default()(toTextOrientation,toRTLTextOrientation),isBuilderFocused:function isBuilderFocused(){return this.$appDocument(window.ETBuilderBackend.css.containerPrefix).is(':hover')||this.$topDocument(window.ETBuilderBackend.css.containerPrefix).is(':hover');},/**
* Get valid fixed header height in Divi or Extra theme.
*
* @returns Int.
*/getFixedHeaderHeight:function getFixedHeaderHeight(){var $body=Utils.$appWindow('body');var height=0;if($body.hasClass('et_divi_theme')&&Utils.$topWindow().width()>=980&&!$body.hasClass('et_vertical_nav')){height+=parseInt(Utils.$appWindow('#top-header.et-fixed-header').height());height+=parseInt(Utils.$appWindow('#main-header.et-fixed-header').height());}if($body.hasClass('et_extra')){height+=parseInt(Utils.$appWindow('.et-fixed-header #main-header').height());}return 0;},/**
* Parse inline CSS as object pair.
*
* @param string Inline CSS.
* @param inlineCSS
* @returns Object.
*/parseInlineCssIntoObject:function parseInlineCssIntoObject(inlineCSS){return __WEBPACK_IMPORTED_MODULE_31_lodash_fromPairs___default()(__WEBPACK_IMPORTED_MODULE_14_lodash_map___default()(inlineCSS.split('; '),function(property){return property.split(': ');}));},/**
* Get processed tab slug.
*
* Convert `advanced` into `design` because in settings modal, we use `design` as tab slug.
*
* @since 3.29.3
*
* @param {string} slug
*
* @returns {string}
*/getProcessedTabSlug:function getProcessedTabSlug(slug){if('advanced'===slug){return'design';}return slug;},/**
* Get module address sequences as array.
*
* For example: 1.0.1.3.
*
* Will returned as ['1', '1.0', '1.0.1', '1.0.1.3'];.
*
* @since 4.0.7
*
* @param {string | Array} address
*
* @returns {Array}
*/getModuleAddressSequence:function getModuleAddressSequence(address){var addressArray=__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(address)?address:address.split('.');return __WEBPACK_IMPORTED_MODULE_16_lodash_keys___default()(addressArray).map(function(index){return __WEBPACK_IMPORTED_MODULE_18_lodash_take___default()(addressArray,parseInt(index,10)+1).join('.');});},/**
* Get font sub field indexes.
*
* Grouped based how it appear in the module settings modal.
*
* @since 4.0.7
*
* @param {string} subFieldKey
*
* @returns {Array}
*/getFontFieldIndexes:function getFontFieldIndexes(subFieldKey){var subFieldIndex={font:[0],weight:[1],style:[2,3,4,5,6],line_style:[7],line_color:[8]};return __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(subFieldIndex,subFieldKey,[]);},flattenFields:function flattenFields(fields){return __WEBPACK_IMPORTED_MODULE_33_lodash_reduce___default()(fields,function(accumulator,field,key){if('composite'===field.type){var structure=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(field,'composite_structure',{});var subFields=__WEBPACK_IMPORTED_MODULE_14_lodash_map___default()(structure,'controls').reduce(function(accumulatorControls,controls){var controlsMapped=__WEBPACK_IMPORTED_MODULE_34_lodash_mapValues___default()(controls,function(control,controlKey){var controlName=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(control,'name',controlKey);var tabSlug=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(control,'tab_slug',__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(field,'tab_slug',''));var toggleSlug=__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(control,'toggle_slug',__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(field,'toggle_slug',''));return __WEBPACK_IMPORTED_MODULE_0_lodash_assign___default()({},control,{name:controlName,tab_slug:Utils.getProcessedTabSlug(tabSlug),toggle_slug:toggleSlug});});return _objectSpread2(_objectSpread2({},accumulatorControls),controlsMapped);},{});return _objectSpread2(_objectSpread2({},accumulator),subFields);}return _objectSpread2(_objectSpread2({},accumulator),{},_defineProperty({},key,field));},{});},/**
* Check if browser has localStorage support or not.
*
* @since 3.28
*
* @returns {bool}
*/hasLocalStorage:function hasLocalStorage(){if(!__WEBPACK_IMPORTED_MODULE_3_lodash_isNull___default()(has_localStorage)){return has_localStorage;}try{has_localStorage=!!window.ET_Builder.Frames.top.localStorage;}catch(e){}return has_localStorage;},/**
* Shows the core modal by helper's ID.
*
* @param {string} modalId The modal ID taken from the window.ETBuilderBackend helpers.
*/showCoreModal:function showCoreModal(modalId){var modalSettings=window.ETBuilderBackend[modalId];if(modalSettings){var header=window.ETBuilderBackend[modalId].header;var text=window.ETBuilderBackend[modalId].text;var buttons=window.ETBuilderBackend[modalId].buttons;var modalTemplate=window.ETBuilderBackend.coreModalTemplate;var buttonsTemplate=window.ETBuilderBackend.coreModalButtonsTemplate;var classes=window.ETBuilderBackend[modalId].classes;var buttonsHtml=buttons?__WEBPACK_IMPORTED_MODULE_33_lodash_reduce___default()(buttons,function(acc,button){return acc+button;},''):'';buttonsHtml=this.sprintf(buttonsTemplate,buttonsHtml);var buttonsClass=__WEBPACK_IMPORTED_MODULE_16_lodash_keys___default()(buttons).length>1?'et-core-modal-two-buttons':'';var modalHtml=this.sprintf(modalTemplate,header,text,buttonsHtml);this.$topWindow('.et-core-modal-overlay').remove();this.$topWindow(modalHtml).appendTo(this.$topWindow('body')).addClass(buttonsClass).addClass(classes);this.$appWindow().trigger('et-core-modal-active');}},/**
* Hides the core modal gracefully.
*
* @param {string} modalClass The modal unique CSS class.
*/hideCoreModal:function hideCoreModal(modalClass){this.$topWindow(".".concat(modalClass)).addClass('et-core-closing').delay(600).queue(function(){Utils.$topWindow(this).removeClass('et-core-active et-core-closing').dequeue().remove();});},/**
* DO NOT FOR SECURITY REASONS.
*
* Filters the string for any HTML tags.
*
* @param string
*
* @returns {string}
*/stripHTMLTags:function stripHTMLTags(string){return string.replace(/(<([^>]+)>)/ig,'');}};Utils.maybeLoadFont=__WEBPACK_IMPORTED_MODULE_32_lodash_memoize___default()(Utils.maybeLoadFont.bind(Utils));window.ET_FB=window.ET_FB||{};window.ET_FB.utils={log:Utils.log,defaultAllLogAreas:['general','store_action_obj','store_emit','warning'],debug:function debug(){// Hardcoded overwritten output
if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(ET_FB_SETTINGS.debug)){return ET_FB_SETTINGS.debug;}try{ET_FB_SETTINGS.debug='true'===localStorage.getItem('et_fb_debug');return ET_FB_SETTINGS.debug;}catch(e){// do not use localStorage if it full or any other error occurs
return false;}},debugOn:function debugOn(){try{// Update localStorage for persistent saving
localStorage.setItem('et_fb_debug','true');ET_FB_SETTINGS.debug=true;// Notify user
return'Debug mode is activated';}catch(e){// do not use localStorage if it full or any other error occurs
// Notify user
return'Debug mode was not activated due to lack of support or other error';}},debugOff:function debugOff(){// Update localStorage for persistent saving
localStorage.setItem('et_fb_debug','false');ET_FB_SETTINGS.debug=false;// Notify user
return'Debug mode is deactivated';},debugSetLogAreas:function debugSetLogAreas(areas){// Update localStorage for persistent saving
localStorage.setItem('et_fb_debug_log_areas',areas);return"Separate by space to set multiple areas. You are now logging these areas: ".concat(this.debugLogAreas().join(', '));},debugAddLogArea:function debugAddLogArea(area){var areas=localStorage.getItem('et_fb_debug_log_areas');// Update localStorage for persistent saving
localStorage.setItem('et_fb_debug_log_areas',"".concat(areas," ").concat(area));return"Separate by space to set multiple areas. You are now logging these areas: ".concat(this.debugLogAreas().join(', '));},debugSetAllLogAreas:function debugSetAllLogAreas(){localStorage.setItem('et_fb_debug_log_areas',this.defaultAllLogAreas.join(' '));return"You are now logging these areas: ".concat(this.defaultAllLogAreas.join(', '));},debugLogAreas:function debugLogAreas(){var areas=localStorage.getItem('et_fb_debug_log_areas');// Hardcoded overwritten output
if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(ET_FB_SETTINGS.enableAllLogAreas)&&ET_FB_SETTINGS.enableAllLogAreas){return this.defaultAllLogAreas;}if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isUndefined___default()(ET_FB_SETTINGS.enabledLogAreas)){return ET_FB_SETTINGS.enabledLogAreas;}return null===areas?this.defaultAllLogAreas:areas.split(' ');}};var applyMixinsSafely=Utils.applyMixinsSafely,intentionallyCloneDeep=Utils.intentionallyCloneDeep,intentionallyClone=Utils.intentionallyClone,sanitized_previously=Utils.sanitized_previously,log=Utils.log,is=Utils.is,isOn=Utils.isOn,isOff=Utils.isOff,isOnOff=Utils.isOnOff,isYes=Utils.isYes,isNo=Utils.isNo,isDefault=Utils.isDefault,isMobileDevice=Utils.isMobileDevice,isIEOrEdge=Utils.isIEOrEdge,isIE=Utils.isIE,isBlockEditor=Utils.isBlockEditor,condition=Utils.condition,hasLocalStorage=Utils.hasLocalStorage,hasNumericValue=Utils.hasNumericValue,hasValue=Utils.hasValue,getResponsiveStatus=Utils.getResponsiveStatus,parseShortcode=Utils.parseShortcode,processFontIcon=Utils.processFontIcon,generateResponsiveCss=Utils.generateResponsiveCss,generatePlaceholderCss=Utils.generatePlaceholderCss,replaceCodeContentEntities=Utils.replaceCodeContentEntities,removeFancyQuotes=Utils.removeFancyQuotes,processRangeValue=Utils.processRangeValue,getCorners=Utils.getCorners,getCorner=Utils.getCorner,getSpacing=Utils.getSpacing,getBreakpoints=Utils.getBreakpoints,getViewModeByWidth=Utils.getViewModeByWidth,getPreviewModes=Utils.getPreviewModes,getGradient=Utils.getGradient,removeClassNameByPrefix=Utils.removeClassNameByPrefix,getKeyboardList=Utils.getKeyboardList,getRowLayouts=Utils.getRowLayouts,maybeLoadFont=Utils.maybeLoadFont,fontnameToClass=Utils.fontnameToClass,getCommentsMarkup=Utils.getCommentsMarkup,callWindow=Utils.callWindow,decodeHtmlEntities=Utils.decodeHtmlEntities,hasBodyMargin=Utils.hasBodyMargin,fixSliderHeight=Utils.fixSliderHeight,fixBuilderContent=Utils.fixBuilderContent,triggerResizeForUIUpdate=Utils.triggerResizeForUIUpdate,enableScrollLock=Utils.enableScrollLock,disableScrollLock=Utils.disableScrollLock,linkRel=Utils.linkRel,setElementFont=Utils.setElementFont,decodeOptionListValue=Utils.decodeOptionListValue,sprintf=Utils.sprintf,isJson=Utils.isJson,isValidHtml=Utils.isValidHtml,getNextBreakpoint=Utils.getNextBreakpoint,getPrevBreakpoint=Utils.getPrevBreakpoint,appDocument=Utils.appDocument,$appDocument=Utils.$appDocument,appWindow=Utils.appWindow,$appWindow=Utils.$appWindow,topDocument=Utils.topDocument,$topDocument=Utils.$topDocument,topWindow=Utils.topWindow,$topWindow=Utils.$topWindow,getFixedHeaderHeight=Utils.getFixedHeaderHeight,parseInlineCssIntoObject=Utils.parseInlineCssIntoObject,getOS=Utils.getOS,isModuleLocked=Utils.isModuleLocked,isModuleDeleted=Utils.isModuleDeleted,getComponentType=Utils.getComponentType,getModuleSectionType=Utils.getModuleSectionType,getModuleAncestor=Utils.getModuleAncestor,getScrollbarWidth=Utils.getScrollbarWidth,getProcessedTabSlug=Utils.getProcessedTabSlug,getModuleAddressSequence=Utils.getModuleAddressSequence,getFontFieldIndexes=Utils.getFontFieldIndexes,isRealMobileDevice=Utils.isRealMobileDevice,stripHTMLTags=Utils.stripHTMLTags;/* harmony default export */ __webpack_exports__["a"] = (Utils);
/***/ }),
/* 26 */
/*!*******************************************!*\
!*** ./node_modules/lodash/isFunction.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isObject = __webpack_require__(/*! ./isObject */ 2);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
} // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/* 27 */
/*!********************************************!*\
!*** ./node_modules/lodash/isArguments.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ 162),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* 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');
};
module.exports = isArguments;
/***/ }),
/* 28 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isBuffer.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var root = __webpack_require__(/*! ./_root */ 1),
stubFalse = __webpack_require__(/*! ./stubFalse */ 163);
/** Detect free variable `exports`. */
var freeExports = ( false ? "undefined" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && ( false ? "undefined" : _typeof(module)) == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* 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;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/module.js */ 29)(module)))
/***/ }),
/* 29 */
/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
module.exports = function (module) {
if (!module.webpackPolyfill) {
module.deprecate = function () {};
module.paths = []; // module.parent = undefined by default
if (!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function get() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function get() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 30 */
/*!*****************************************!*\
!*** ./node_modules/lodash/includes.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ 58),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5),
isString = __webpack_require__(/*! ./isString */ 31),
toInteger = __webpack_require__(/*! ./toInteger */ 7),
values = __webpack_require__(/*! ./values */ 170);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
}
module.exports = includes;
/***/ }),
/* 31 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isString.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isArray = __webpack_require__(/*! ./isArray */ 0),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
}
module.exports = isString;
/***/ }),
/* 32 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseGet.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 16),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/**
* 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 = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return index && index == length ? object : undefined;
}
module.exports = baseGet;
/***/ }),
/* 33 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_nativeCreate.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 34 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_ListCache.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ 181),
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ 182),
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ 183),
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ 184),
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ 185);
/**
* 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]);
}
} // Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/* 35 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_assocIndexOf.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ 36);
/**
* 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;
}
module.exports = assocIndexOf;
/***/ }),
/* 36 */
/*!***********************************!*\
!*** ./node_modules/lodash/eq.js ***!
\***********************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = eq;
/***/ }),
/* 37 */
/*!********************************************!*\
!*** ./node_modules/lodash/_getMapData.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(/*! ./_isKeyable */ 187);
/**
* 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;
}
module.exports = getMapData;
/***/ }),
/* 38 */
/*!****************************************!*\
!*** ./node_modules/lodash/forEach.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ 39),
baseEach = __webpack_require__(/*! ./_baseEach */ 63),
castFunction = __webpack_require__(/*! ./_castFunction */ 65),
isArray = __webpack_require__(/*! ./isArray */ 0);
/**
* 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
*
* _.forEach([1, 2], 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, castFunction(iteratee));
}
module.exports = forEach;
/***/ }),
/* 39 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_arrayEach.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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 == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
/***/ }),
/* 40 */
/*!*******************************************!*\
!*** ./node_modules/lodash/fp/convert.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseConvert = __webpack_require__(/*! ./_baseConvert */ 196),
util = __webpack_require__(/*! ./_util */ 198);
/**
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied. If `name` is an object its methods
* will be converted.
*
* @param {string} name The name of the function to wrap.
* @param {Function} [func] The function to wrap.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function|Object} Returns the converted function or object.
*/
function convert(name, func, options) {
return baseConvert(util, name, func, options);
}
module.exports = convert;
/***/ }),
/* 41 */
/*!********************************************!*\
!*** ./node_modules/lodash/_createWrap.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseSetData = __webpack_require__(/*! ./_baseSetData */ 98),
createBind = __webpack_require__(/*! ./_createBind */ 200),
createCurry = __webpack_require__(/*! ./_createCurry */ 201),
createHybrid = __webpack_require__(/*! ./_createHybrid */ 100),
createPartial = __webpack_require__(/*! ./_createPartial */ 213),
getData = __webpack_require__(/*! ./_getData */ 69),
mergeData = __webpack_require__(/*! ./_mergeData */ 214),
setData = __webpack_require__(/*! ./_setData */ 107),
setWrapToString = __webpack_require__(/*! ./_setWrapToString */ 109),
toInteger = __webpack_require__(/*! ./toInteger */ 7);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
module.exports = createWrap;
/***/ }),
/* 42 */
/*!********************************************!*\
!*** ./node_modules/lodash/_createCtor.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 43),
isObject = __webpack_require__(/*! ./isObject */ 2);
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function () {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0:
return new Ctor();
case 1:
return new Ctor(args[0]);
case 2:
return new Ctor(args[0], args[1]);
case 3:
return new Ctor(args[0], args[1], args[2]);
case 4:
return new Ctor(args[0], args[1], args[2], args[3]);
case 5:
return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6:
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7:
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
module.exports = createCtor;
/***/ }),
/* 43 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseCreate.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 2);
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = function () {
function object() {}
return function (proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object();
object.prototype = undefined;
return result;
};
}();
module.exports = baseCreate;
/***/ }),
/* 44 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_copyArray.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = copyArray;
/***/ }),
/* 45 */
/*!************************************************!*\
!*** ./node_modules/lodash/_replaceHolders.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
module.exports = replaceHolders;
/***/ }),
/* 46 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_assignValue.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 73),
eq = __webpack_require__(/*! ./eq */ 36);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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)) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ }),
/* 47 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseClone.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 74),
arrayEach = __webpack_require__(/*! ./_arrayEach */ 39),
assignValue = __webpack_require__(/*! ./_assignValue */ 46),
baseAssign = __webpack_require__(/*! ./_baseAssign */ 111),
baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ 220),
cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ 223),
copyArray = __webpack_require__(/*! ./_copyArray */ 44),
copySymbols = __webpack_require__(/*! ./_copySymbols */ 224),
copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ 226),
getAllKeys = __webpack_require__(/*! ./_getAllKeys */ 115),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ 117),
getTag = __webpack_require__(/*! ./_getTag */ 14),
initCloneArray = __webpack_require__(/*! ./_initCloneArray */ 227),
initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ 228),
initCloneObject = __webpack_require__(/*! ./_initCloneObject */ 233),
isArray = __webpack_require__(/*! ./isArray */ 0),
isBuffer = __webpack_require__(/*! ./isBuffer */ 28),
isMap = __webpack_require__(/*! ./isMap */ 234),
isObject = __webpack_require__(/*! ./isObject */ 2),
isSet = __webpack_require__(/*! ./isSet */ 236),
keys = __webpack_require__(/*! ./keys */ 6);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (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) {
result = isFlat || isFunc ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, 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 (isSet(value)) {
value.forEach(function (subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
return result;
}
if (isMap(value)) {
value.forEach(function (subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function (subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
} // Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
/***/ }),
/* 48 */
/*!******************************************!*\
!*** ./node_modules/lodash/_flatRest.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var flatten = __webpack_require__(/*! ./flatten */ 261),
overRest = __webpack_require__(/*! ./_overRest */ 125),
setToString = __webpack_require__(/*! ./_setToString */ 71);
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;
/***/ }),
/* 49 */
/*!*************************************!*\
!*** ./node_modules/lodash/last.js ***!
\*************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
/***/ }),
/* 50 */
/*!********************************************!*\
!*** ./includes/modules/Testify/style.css ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 51 */
/*!******************************************!*\
!*** ./node_modules/lodash/_baseKeys.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(/*! ./_isPrototype */ 19),
nativeKeys = __webpack_require__(/*! ./_nativeKeys */ 152);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.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;
}
module.exports = baseKeys;
/***/ }),
/* 52 */
/*!*************************************!*\
!*** ./node_modules/lodash/_Map.js ***!
\*************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11),
root = __webpack_require__(/*! ./_root */ 1);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 53 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isLength.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* 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;
}
module.exports = isLength;
/***/ }),
/* 54 */
/*!*********************************************!*\
!*** ./node_modules/lodash/isTypedArray.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ 164),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 55),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ 56);
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* 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;
module.exports = isTypedArray;
/***/ }),
/* 55 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseUnary.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
};
}
module.exports = baseUnary;
/***/ }),
/* 56 */
/*!******************************************!*\
!*** ./node_modules/lodash/_nodeUtil.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 86);
/** Detect free variable `exports`. */
var freeExports = ( false ? "undefined" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && ( false ? "undefined" : _typeof(module)) == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = function () {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}();
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/module.js */ 29)(module)))
/***/ }),
/* 57 */
/*!***************************************!*\
!*** ./node_modules/lodash/lodash.js ***!
\***************************************/
/*! dynamic exports provided */
/*! exports used: forEach, get, includes, indexOf, initial, isArray, isEmpty, isObject, isString, isUndefined, join, last, lowerCase, map, mapValues, remove */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, module) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;
(function () {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.17.5';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used as default options for `_.truncate`. */
var DEFAULT_TRUNC_LENGTH = 30,
DEFAULT_TRUNC_OMISSION = '...';
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/** Used to indicate the type of lazy iteratees. */
var LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2,
LAZY_WHILE_FLAG = 3;
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG]];
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
domExcTag = '[object DOMException]',
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]',
weakSetTag = '[object WeakSet]';
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 empty string literals in compiled template source. */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reUnescapedHtml = /[&<>"']/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source),
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/** Used to match template delimiters. */
var reEscape = /<%-([\s\S]+?)%>/g,
reEvaluate = /<%([\s\S]+?)%>/g,
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Used to match
* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
/** Used to ensure capturing order of template delimiters. */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals. */
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
/** Used to compose unicode character classes. */
var rsAstralRange = "\\ud800-\\udfff",
rsComboMarksRange = "\\u0300-\\u036f",
reComboHalfMarksRange = "\\ufe20-\\ufe2f",
rsComboSymbolsRange = "\\u20d0-\\u20ff",
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsDingbatRange = "\\u2700-\\u27bf",
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = "\\u2000-\\u206f",
rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = "\\ufe0e\\ufe0f",
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsAstral = '[' + rsAstralRange + ']',
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = "\\ud83c[\\udffb-\\udfff]",
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}",
rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]",
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = "\\u200d";
/** Used to compose unicode regexes. */
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/** Used to match complex or compound words. */
var reUnicodeWord = RegExp([rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji].join('|'), 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/** Used to assign default `context` object properties. */
var contextProps = ['Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'];
/** Used to make template sourceURLs easier to identify. */
var templateCounter = -1;
/** 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;
/** 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;
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A',
'\xc1': 'A',
'\xc2': 'A',
'\xc3': 'A',
'\xc4': 'A',
'\xc5': 'A',
'\xe0': 'a',
'\xe1': 'a',
'\xe2': 'a',
'\xe3': 'a',
'\xe4': 'a',
'\xe5': 'a',
'\xc7': 'C',
'\xe7': 'c',
'\xd0': 'D',
'\xf0': 'd',
'\xc8': 'E',
'\xc9': 'E',
'\xca': 'E',
'\xcb': 'E',
'\xe8': 'e',
'\xe9': 'e',
'\xea': 'e',
'\xeb': 'e',
'\xcc': 'I',
'\xcd': 'I',
'\xce': 'I',
'\xcf': 'I',
'\xec': 'i',
'\xed': 'i',
'\xee': 'i',
'\xef': 'i',
'\xd1': 'N',
'\xf1': 'n',
'\xd2': 'O',
'\xd3': 'O',
'\xd4': 'O',
'\xd5': 'O',
'\xd6': 'O',
'\xd8': 'O',
'\xf2': 'o',
'\xf3': 'o',
'\xf4': 'o',
'\xf5': 'o',
'\xf6': 'o',
'\xf8': 'o',
'\xd9': 'U',
'\xda': 'U',
'\xdb': 'U',
'\xdc': 'U',
'\xf9': 'u',
'\xfa': 'u',
'\xfb': 'u',
'\xfc': 'u',
'\xdd': 'Y',
'\xfd': 'y',
'\xff': 'y',
'\xc6': 'Ae',
'\xe6': 'ae',
'\xde': 'Th',
'\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
"\u0100": 'A',
"\u0102": 'A',
"\u0104": 'A',
"\u0101": 'a',
"\u0103": 'a',
"\u0105": 'a',
"\u0106": 'C',
"\u0108": 'C',
"\u010A": 'C',
"\u010C": 'C',
"\u0107": 'c',
"\u0109": 'c',
"\u010B": 'c',
"\u010D": 'c',
"\u010E": 'D',
"\u0110": 'D',
"\u010F": 'd',
"\u0111": 'd',
"\u0112": 'E',
"\u0114": 'E',
"\u0116": 'E',
"\u0118": 'E',
"\u011A": 'E',
"\u0113": 'e',
"\u0115": 'e',
"\u0117": 'e',
"\u0119": 'e',
"\u011B": 'e',
"\u011C": 'G',
"\u011E": 'G',
"\u0120": 'G',
"\u0122": 'G',
"\u011D": 'g',
"\u011F": 'g',
"\u0121": 'g',
"\u0123": 'g',
"\u0124": 'H',
"\u0126": 'H',
"\u0125": 'h',
"\u0127": 'h',
"\u0128": 'I',
"\u012A": 'I',
"\u012C": 'I',
"\u012E": 'I',
"\u0130": 'I',
"\u0129": 'i',
"\u012B": 'i',
"\u012D": 'i',
"\u012F": 'i',
"\u0131": 'i',
"\u0134": 'J',
"\u0135": 'j',
"\u0136": 'K',
"\u0137": 'k',
"\u0138": 'k',
"\u0139": 'L',
"\u013B": 'L',
"\u013D": 'L',
"\u013F": 'L',
"\u0141": 'L',
"\u013A": 'l',
"\u013C": 'l',
"\u013E": 'l',
"\u0140": 'l',
"\u0142": 'l',
"\u0143": 'N',
"\u0145": 'N',
"\u0147": 'N',
"\u014A": 'N',
"\u0144": 'n',
"\u0146": 'n',
"\u0148": 'n',
"\u014B": 'n',
"\u014C": 'O',
"\u014E": 'O',
"\u0150": 'O',
"\u014D": 'o',
"\u014F": 'o',
"\u0151": 'o',
"\u0154": 'R',
"\u0156": 'R',
"\u0158": 'R',
"\u0155": 'r',
"\u0157": 'r',
"\u0159": 'r',
"\u015A": 'S',
"\u015C": 'S',
"\u015E": 'S',
"\u0160": 'S',
"\u015B": 's',
"\u015D": 's',
"\u015F": 's',
"\u0161": 's',
"\u0162": 'T',
"\u0164": 'T',
"\u0166": 'T',
"\u0163": 't',
"\u0165": 't',
"\u0167": 't',
"\u0168": 'U',
"\u016A": 'U',
"\u016C": 'U',
"\u016E": 'U',
"\u0170": 'U',
"\u0172": 'U',
"\u0169": 'u',
"\u016B": 'u',
"\u016D": 'u',
"\u016F": 'u',
"\u0171": 'u',
"\u0173": 'u',
"\u0174": 'W',
"\u0175": 'w',
"\u0176": 'Y',
"\u0177": 'y',
"\u0178": 'Y',
"\u0179": 'Z',
"\u017B": 'Z',
"\u017D": 'Z',
"\u017A": 'z',
"\u017C": 'z',
"\u017E": 'z',
"\u0132": 'IJ',
"\u0133": 'ij',
"\u0152": 'Oe',
"\u0153": 'oe',
"\u0149": "'n",
"\u017F": 's'
};
/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'"
};
/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
"\u2028": 'u2028',
"\u2029": 'u2029'
};
/** Built-in method references without a dependency on `root`. */
var freeParseFloat = parseFloat,
freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = (typeof self === "undefined" ? "undefined" : _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 = ( false ? "undefined" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && ( false ? "undefined" : _typeof(module)) == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = function () {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}();
/* Node.js helper references. */
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
nodeIsDate = nodeUtil && nodeUtil.isDate,
nodeIsMap = nodeUtil && nodeUtil.isMap,
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
nodeIsSet = nodeUtil && nodeUtil.isSet,
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/*--------------------------------------------------------------------------*/
/**
* 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);
}
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
/**
* 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 == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.forEachRight` 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 arrayEachRight(array, iteratee) {
var length = array == null ? 0 : array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.every` 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 all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
/**
* 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;
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
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 `_.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 == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* A specialized version of `_.reduceRight` 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 last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
/**
* 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;
}
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
/**
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function (value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
}
});
return result;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index-- : ++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
}
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array == null ? 0 : array.length;
return length ? baseSum(array, iteratee) / length : NAN;
}
/**
* 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 `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function (key) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function (value, index, collection) {
accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : result + current;
}
}
return result;
}
/**
* 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 `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function (key) {
return [key, object[key]];
});
}
/**
* 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);
};
}
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function (key) {
return object[key];
});
}
/**
* 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);
}
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
var escapeHtmlChar = basePropertyOf(htmlEscapes);
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
/**
* 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 `string` contains Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
*/
function hasUnicode(string) {
return reHasUnicode.test(string);
}
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
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));
};
}
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
/**
* Gets the value at `key`, unless `key` is "__proto__".
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function safeGet(object, key) {
return key == '__proto__' ? undefined : object[key];
}
/**
* 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;
}
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function (value) {
result[++index] = [value, value];
});
return result;
}
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* A specialized version of `_.lastIndexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictLastIndexOf(array, value, fromIndex) {
var index = fromIndex + 1;
while (index--) {
if (array[index] === value) {
return index;
}
}
return index;
}
/**
* Gets the number of symbols in `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
}
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
}
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
/**
* Gets the size of a Unicode `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
function unicodeSize(string) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string)) {
++result;
}
return result;
}
/**
* Converts a Unicode `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
/**
* Splits a Unicode `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function unicodeWords(string) {
return string.match(reUnicodeWord) || [];
}
/*--------------------------------------------------------------------------*/
/**
* Create a new pristine `lodash` function using the `context` object.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Util
* @param {Object} [context=root] The context object.
* @returns {Function} Returns a new `lodash` function.
* @example
*
* _.mixin({ 'foo': _.constant('foo') });
*
* var lodash = _.runInContext();
* lodash.mixin({ 'bar': lodash.constant('bar') });
*
* _.isFunction(_.foo);
* // => true
* _.isFunction(_.bar);
* // => false
*
* lodash.isFunction(lodash.foo);
* // => false
* lodash.isFunction(lodash.bar);
* // => true
*
* // Create a suped-up `defer` in Node.js.
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
*/
var runInContext = function runInContext(context) {
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
/** Built-in constructor references. */
var Array = context.Array,
Date = context.Date,
Error = context.Error,
Function = context.Function,
Math = context.Math,
Object = context.Object,
RegExp = context.RegExp,
String = context.String,
TypeError = context.TypeError;
/** 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 = context['__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 generate unique IDs. */
var idCounter = 0;
/** 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 infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/** Used to restore the original `_` reference in `_.noConflict`. */
var oldDash = root._;
/** 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 ? context.Buffer : undefined,
_Symbol = context.Symbol,
Uint8Array = context.Uint8Array,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice,
spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined,
symIterator = _Symbol ? _Symbol.iterator : undefined,
symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
var defineProperty = function () {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}();
/** Mocked built-ins. */
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
ctxNow = Date && Date.now !== root.Date.now && Date.now,
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max,
nativeMin = Math.min,
nativeNow = Date.now,
nativeParseInt = context.parseInt,
nativeRandom = Math.random,
nativeReverse = arrayProto.reverse;
/* Built-in method references that are verified to be native. */
var DataView = getNative(context, 'DataView'),
Map = getNative(context, 'Map'),
Promise = getNative(context, 'Promise'),
Set = getNative(context, 'Set'),
WeakMap = getNative(context, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap();
/** Used to lookup unminified function names. */
var realNames = {};
/** 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 `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = function () {
function object() {}
return function (proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object();
object.prototype = undefined;
return result;
};
}();
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {} // No operation performed.
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
/**
* By default, the template delimiters used by lodash are like those in
* embedded Ruby (ERB) as well as ES2015 template strings. Change the
* following template settings to use alternative delimiters.
*
* @static
* @memberOf _
* @type {Object}
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'escape': reEscape,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'evaluate': reEvaluate,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type {string}
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type {Object}
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type {Function}
*/
'_': lodash
}
}; // Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
/**
* Reverses the direction of lazy iteration.
*
* @private
* @name reverse
* @memberOf LazyWrapper
* @returns {Object} Returns the new reversed `LazyWrapper` object.
*/
function lazyReverse() {
if (this.__filtered__) {
var result = new LazyWrapper(this);
result.__dir__ = -1;
result.__filtered__ = true;
} else {
result = this.clone();
result.__dir__ *= -1;
}
return result;
}
/**
* Extracts the unwrapped value from its lazy wrapper.
*
* @private
* @name value
* @memberOf LazyWrapper
* @returns {*} Returns the unwrapped value.
*/
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
length = end - start,
index = isRight ? end : start - 1,
iteratees = this.__iteratees__,
iterLength = iteratees.length,
resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || !isRight && arrLength == length && takeCount == length) {
return baseWrapperValue(array, this.__actions__);
}
var result = [];
outer: while (length-- && resIndex < takeCount) {
index += dir;
var iterIndex = -1,
value = array[index];
while (++iterIndex < iterLength) {
var data = iteratees[iterIndex],
iteratee = data.iteratee,
type = data.type,
computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
result[resIndex++] = value;
}
return result;
} // Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
/*------------------------------------------------------------------------*/
/**
* 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;
}
/**
* A specialized version of `_.sample` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @returns {*} Returns the random element.
*/
function arraySample(array) {
var length = array.length;
return length ? array[baseRandom(0, length - 1)] : undefined;
}
/**
* A specialized version of `_.sampleSize` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function arraySampleSize(array, n) {
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
}
/**
* A specialized version of `_.shuffle` for arrays.
*
* @private
* @param {Array} array The array to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function arrayShuffle(array) {
return shuffleSelf(copyArray(array));
}
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @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 assignMergeValue(object, key, value) {
if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
baseAssignValue(object, key, value);
}
}
/**
* 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)) {
baseAssignValue(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;
}
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function (value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
/**
* 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 `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @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 baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
result = Array(length),
skip = object == null;
while (++index < length) {
result[index] = skip ? undefined : get(object, paths[index]);
}
return result;
}
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (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) {
result = isFlat || isFunc ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, 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 (isSet(value)) {
value.forEach(function (subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
return result;
}
if (isMap(value)) {
value.forEach(function (subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function (subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
} // Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source);
return function (object) {
return baseConformsTo(object, source, props);
};
}
/**
* The base implementation of `_.conformsTo` which accepts `props` to check.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
*/
function baseConformsTo(object, source, props) {
var length = props.length;
if (object == null) {
return !length;
}
object = Object(object);
while (length--) {
var key = props[length],
predicate = source[key],
value = object[key];
if (value === undefined && !(key in object) || !predicate(value)) {
return false;
}
}
return true;
}
/**
* The base implementation of `_.delay` and `_.defer` which accepts `args`
* to provide to `func`.
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {Array} args The arguments to provide to `func`.
* @returns {number|Object} Returns the timer id or timeout object.
*/
function baseDelay(func, wait, args) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return setTimeout(function () {
func.apply(undefined, args);
}, wait);
}
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
} else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer: while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = comparator || value !== 0 ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
} else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
/**
* 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 `_.forEachRight` 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 baseEachRight = createBaseEach(baseForOwnRight, true);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function (value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
var computed = current,
result = value;
}
}
return result;
}
/**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
*/
function baseFill(array, value, start, end) {
var length = array.length;
start = toInteger(start);
if (start < 0) {
start = -start > length ? 0 : length + start;
}
end = end === undefined || end > length ? length : toInteger(end);
if (end < 0) {
end += length;
}
end = start > end ? 0 : toLength(end);
while (start < end) {
array[start++] = value;
}
return array;
}
/**
* 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 `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return 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();
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @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 baseForRight = createBaseFor(true);
/**
* 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 `_.forOwnRight` 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 baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
/**
* The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from `props`.
*
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function (key) {
return isFunction(object[key]);
});
}
/**
* 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 = castPath(path, object);
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 `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 `_.gt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
*/
function baseGt(value, other) {
return value > other;
}
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
/**
* 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 `_.inRange` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer: while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = comparator || value !== 0 ? value : 0;
if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts
* `object` with values transformed by `iteratee` and set by `setter`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform values.
* @param {Object} accumulator The initial inverted object.
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
baseForOwn(object, function (value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
path = castPath(path, object);
object = parent(object, path);
var func = object == null ? object : object[toKey(last(path))];
return func == null ? undefined : apply(func, object, args);
}
/**
* 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 `_.isArrayBuffer` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
*/
function baseIsArrayBuffer(value) {
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
}
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && baseGetTag(value) == dateTag;
}
/**
* 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 `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
/**
* 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, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, 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) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isRegExp` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
*/
function baseIsRegExp(value) {
return isObjectLike(value) && baseGetTag(value) == regexpTag;
}
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
/**
* 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 `_.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 `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.lt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
*/
function baseLt(value, other) {
return value < other;
}
/**
* The base implementation of `_.map` 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} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function (value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
/**
* 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, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function (srcValue, key) {
if (isObject(srcValue)) {
stack || (stack = new Stack());
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
} else {
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object, key),
srcValue = safeGet(source, key),
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
} else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
} else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
} else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
} else {
newValue = [];
}
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
} else if (!isObject(objValue) || srcIndex && isFunction(objValue)) {
newValue = initCloneObject(srcValue);
}
} else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
/**
* The base implementation of `_.nth` which doesn't coerce arguments.
*
* @private
* @param {Array} array The array to query.
* @param {number} n The index of the element to return.
* @returns {*} Returns the nth element of `array`.
*/
function baseNth(array, n) {
var length = array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
return isIndex(n, length) ? array[n] : undefined;
}
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
var result = baseMap(collection, function (value, key, collection) {
var criteria = arrayMap(iteratees, function (iteratee) {
return iteratee(value);
});
return {
'criteria': criteria,
'index': ++index,
'value': value
};
});
return baseSortBy(result, function (object, other) {
return compareMultiple(object, other, orders);
});
}
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function (value, path) {
return hasIn(object, path);
});
}
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
/**
* 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 `_.pullAllBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
*/
function basePullAll(array, values, iteratee, comparator) {
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length,
seen = array;
if (array === values) {
values = copyArray(values);
}
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIndex = 0,
value = values[index],
computed = iteratee ? iteratee(value) : value;
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) {
splice.call(seen, fromIndex, 1);
}
splice.call(array, fromIndex, 1);
}
}
return array;
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
} else {
baseUnset(array, index);
}
}
}
return array;
}
/**
* The base implementation of `_.random` without support for returning
* floating-point numbers.
*
* @private
* @param {number} lower The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the random number.
*/
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
/**
* The base implementation of `_.repeat` which doesn't coerce arguments.
*
* @private
* @param {string} string The string to repeat.
* @param {number} n The number of times to repeat the string.
* @returns {string} Returns the repeated string.
*/
function baseRepeat(string, n) {
var result = '';
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
} // Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
}
n = nativeFloor(n / 2);
if (n) {
string += string;
}
} while (n);
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) {
return setToString(overRest(func, start, identity), func + '');
}
/**
* The base implementation of `_.sample`.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
*/
function baseSample(collection) {
return arraySample(values(collection));
}
/**
* The base implementation of `_.sampleSize` without param guards.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function baseSampleSize(collection, n) {
var array = values(collection);
return shuffleSelf(array, baseClamp(n, 0, array.length));
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function (func, data) {
metaMap.set(func, data);
return func;
};
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function (func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
/**
* The base implementation of `_.shuffle`.
*
* @private
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function baseShuffle(collection) {
return shuffleSelf(values(collection));
}
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : length + start;
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : end - start >>> 0;
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection 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 baseSome(collection, predicate) {
var result;
baseEach(collection, function (value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array == null ? low : array.length;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = low + high >>> 1,
computed = array[mid];
if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
/**
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
* which invokes `iteratee` for `value` and each element of `array` to compute
* their sort ranking. The iteratee is invoked with one argument; (value).
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The iteratee invoked per element.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array == null ? 0 : array.length,
valIsNaN = value !== value,
valIsNull = value === null,
valIsSymbol = isSymbol(value),
valIsUndefined = value === undefined;
while (low < high) {
var mid = nativeFloor((low + high) / 2),
computed = iteratee(array[mid]),
othIsDefined = computed !== undefined,
othIsNull = computed === null,
othIsReflexive = computed === computed,
othIsSymbol = isSymbol(computed);
if (valIsNaN) {
var setLow = retHighest || othIsReflexive;
} else if (valIsUndefined) {
setLow = othIsReflexive && (retHighest || othIsDefined);
} else if (valIsNull) {
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
} else if (valIsSymbol) {
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
} else if (othIsNull || othIsSymbol) {
setLow = false;
} else {
setLow = retHighest ? computed <= value : computed < value;
}
if (setLow) {
low = mid + 1;
} else {
high = mid;
}
}
return nativeMin(high, MAX_ARRAY_INDEX);
}
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array, iteratee) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!index || !eq(computed, seen)) {
var seen = computed;
result[resIndex++] = value === 0 ? 0 : value;
}
}
return result;
}
/**
* The base implementation of `_.toNumber` which doesn't ensure correct
* conversions of binary, hexadecimal, or octal string values.
*
* @private
* @param {*} value The value to process.
* @returns {number} Returns the number.
*/
function baseToNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
return +value;
}
/**
* 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 (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
} else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache();
} else {
seen = iteratee ? [] : result;
}
outer: while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = comparator || value !== 0 ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
} else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
/**
* The base implementation of `_.update`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to update.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseUpdate(object, path, updater, customizer) {
return baseSet(object, path, updater(baseGet(object, path)), customizer);
}
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
* without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the slice of `array`.
*/
function baseWhile(array, predicate, isDrop, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
}
/**
* The base implementation of `wrapperValue` which returns the result of
* performing a sequence of actions on the unwrapped `value`, where each
* successive action is supplied the return value of the previous.
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
var result = value;
if (result instanceof LazyWrapper) {
result = result.value();
}
return arrayReduce(actions, function (result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var length = arrays.length;
if (length < 2) {
return length ? baseUniq(arrays[0]) : [];
}
var index = -1,
result = Array(length);
while (++index < length) {
var array = arrays[index],
othIndex = -1;
while (++othIndex < length) {
if (othIndex != index) {
result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
}
}
}
return baseUniq(baseFlatten(result, 1), iteratee, comparator);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
/**
* A `baseRest` alias which can be replaced with `identity` by module
* replacement plugins.
*
* @private
* @type {Function}
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
var castRest = baseRest;
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return !start && end >= length ? array : baseSlice(array, start, end);
}
/**
* A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
*
* @private
* @param {number|Object} id The timer id or timeout object of the timer to clear.
*/
var clearTimeout = ctxClearTimeout || function (id) {
return root.clearTimeout(id);
};
/**
* 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 length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(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 `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 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);
}
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
return 1;
}
if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
return -1;
}
}
return 0;
}
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
} // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
/**
* 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) {
var isNew = !object;
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;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
/**
* Copies own symbols 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);
}
/**
* Copies own and inherited symbols 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 copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function (collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
};
}
/**
* 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;
});
}
/**
* 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;
};
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function (string) {
string = toString(string);
var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined;
var chr = strSymbols ? strSymbols[0] : string.charAt(0);
var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1);
return chr[methodName]() + trailing;
};
}
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function (string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function () {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0:
return new Ctor();
case 1:
return new Ctor(args[0]);
case 2:
return new Ctor(args[0], args[1]);
case 3:
return new Ctor(args[0], args[1], args[2]);
case 4:
return new Ctor(args[0], args[1], args[2], args[3]);
case 5:
return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6:
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7:
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length);
}
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function (collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = getIteratee(predicate, 3);
collection = keys(collection);
predicate = function predicate(key) {
return iteratee(iterable[key], key, iterable);
};
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function (funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
}
}
return function () {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
/**
* Creates a function like `_.invertBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} toIteratee The function to resolve iteratees.
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
return function (object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
/**
* Creates a function that performs a mathematical operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @param {number} [defaultValue] The value used for `undefined` arguments.
* @returns {Function} Returns the new mathematical operation function.
*/
function createMathOperation(operator, defaultValue) {
return function (value, other) {
var result;
if (value === undefined && other === undefined) {
return defaultValue;
}
if (value !== undefined) {
result = value;
}
if (other !== undefined) {
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};
}
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new over function.
*/
function createOver(arrayFunc) {
return flatRest(function (iteratees) {
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
return baseRest(function (args) {
var thisArg = this;
return arrayFunc(iteratees, function (iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
/**
* Creates the padding for `string` based on `length`. The `chars` string
* is truncated if the number of characters exceeds `length`.
*
* @private
* @param {number} length The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padding for `string`.
*/
function createPadding(length, chars) {
chars = chars === undefined ? ' ' : baseToString(chars);
var charsLength = chars.length;
if (charsLength < 2) {
return charsLength ? baseRepeat(chars, length) : chars;
}
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length);
}
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = this && this !== root && this instanceof wrapper ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function (start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
} // Ensure the sign of `-0` is preserved.
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
step = step === undefined ? start < end ? 1 : -1 : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
/**
* Creates a function that performs a relational operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @returns {Function} Returns the new relational operation function.
*/
function createRelationalOperation(operator) {
return function (value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value);
other = toNumber(other);
}
return operator(value, other);
};
}
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function (number, precision) {
number = toNumber(number);
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {
return new Set(values);
};
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function (object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
/**
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
* of source objects to the destination object for all destination properties
* that resolve to `undefined`.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function customDefaultsAssignIn(objValue, srcValue, key, object) {
if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
return srcValue;
}
return objValue;
}
/**
* Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
* objects into destination objects that are passed thru.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to merge.
* @param {Object} object The parent object of `objValue`.
* @param {Object} source The parent object of `srcValue`.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
* @returns {*} Returns the value to assign.
*/
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
stack['delete'](srcValue);
}
return objValue;
}
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
/**
* 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;
}
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
/**
* 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);
}
/**
* Creates an array of own and inherited 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 getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function (func) {
return metaMap.get(func);
};
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = func.name + '',
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
return object.placeholder;
}
/**
* Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
* this function returns the custom method, otherwise it returns `baseIteratee`.
* If arguments are provided, the chosen function is invoked with them and
* its result is returned.
*
* @private
* @param {*} [value] The value to convert to an iteratee.
* @param {number} [arity] The arity of the created iteratee.
* @returns {Function} Returns the chosen function or its result.
*/
function getIteratee() {
var result = lodash.iteratee || iteratee;
result = result === iteratee ? baseIteratee : result;
return arguments.length ? result(arguments[0], arguments[1]) : 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;
}
/**
* 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);
});
};
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
/**
* 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 getTag(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;
};
}
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
*
* @private
* @param {number} start The start of the view.
* @param {number} end The end of the view.
* @param {Array} transforms The transformations to apply to the view.
* @returns {Object} Returns an object containing the `start` and `end`
* positions of the view.
*/
function getView(start, end, transforms) {
var index = -1,
length = transforms.length;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop':
start += size;
break;
case 'dropRight':
end -= size;
break;
case 'take':
end = nativeMin(end, start + size);
break;
case 'takeRight':
start = nativeMax(start, end - size);
break;
}
}
return {
'start': start,
'end': end
};
}
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
/**
* 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 = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
/**
* 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 = new 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`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, 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 new Ctor();
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return new Ctor();
case symbolTag:
return cloneSymbol(object);
}
}
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
}
/**
* 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) {
var type = _typeof(value);
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (type == 'number' || type != 'symbol' && reIsUint.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(object)) {
return false;
}
var type = _typeof(index);
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is 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 a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
/**
* 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 `func` is capable of being masked.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
*/
var isMaskable = coreJsData ? isFunction : stubFalse;
/**
* 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));
};
}
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function (key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; // Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
} // Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2]; // Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
} // Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
} // Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
} // Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
} // Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
} // Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
} // Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/**
* 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);
}
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @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.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? func.length - 1 : start, 0);
return function () {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
/**
* A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @returns {number|Object} Returns the timer id or timeout object.
*/
var setTimeout = ctxSetTimeout || function (func, wait) {
return root.setTimeout(func, wait);
};
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = reference + '';
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function () {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
/**
* A specialized version of `_.shuffle` which mutates and sets the size of `array`.
*
* @private
* @param {Array} array The array to shuffle.
* @param {number} [size=array.length] The size of `array`.
* @returns {Array} Returns `array`.
*/
function shuffleSelf(array, size) {
var index = -1,
length = array.length,
lastIndex = length - 1;
size = size === undefined ? length : size;
while (++index < size) {
var rand = baseRandom(index, lastIndex),
value = array[rand];
array[rand] = array[index];
array[index] = value;
}
array.length = size;
return array;
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function (string) {
var result = [];
if (string.charCodeAt(0) === 46
/* . */
) {
result.push('');
}
string.replace(rePropName, function (match, number, quote, subString) {
result.push(quote ? subString.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 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 '';
}
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function (pair) {
var value = '_.' + pair[0];
if (bitmask & pair[1] && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an array of elements split into groups the length of `size`.
* If `array` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=1] The length of each chunk
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the new array of chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size, guard) {
if (guard ? isIterateeCall(array, size, guard) : size === undefined) {
size = 1;
} else {
size = nativeMax(toInteger(size), 0);
}
var length = array == null ? 0 : array.length;
if (!length || size < 1) {
return [];
}
var index = 0,
resIndex = 0,
result = Array(nativeCeil(length / size));
while (index < length) {
result[resIndex++] = baseSlice(array, index, index += size);
}
return result;
}
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
/**
* Creates a new array concatenating `array` with any additional arrays
* and/or values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to concatenate.
* @param {...*} [values] The values to concatenate.
* @returns {Array} Returns the new concatenated array.
* @example
*
* var array = [1];
* var other = _.concat(array, 2, [3], [[4]]);
*
* console.log(other);
* // => [1, 2, 3, [4]]
*
* console.log(array);
* // => [1]
*/
function concat() {
var length = arguments.length;
if (!length) {
return [];
}
var args = Array(length - 1),
array = arguments[0],
index = length;
while (index--) {
args[index - 1] = arguments[index];
}
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
}
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function (array, values) {
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
});
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2]
*
* // The `_.property` iteratee shorthand.
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = baseRest(function (array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : [];
});
/**
* This method is like `_.difference` except that it accepts `comparator`
* which is invoked to compare elements of `array` to `values`. The order and
* references of result values are determined by the first array. The comparator
* is invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.pullAllWith`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
*
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
* // => [{ 'x': 2, 'y': 1 }]
*/
var differenceWith = baseRest(function (array, values) {
var comparator = last(values);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : [];
});
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = guard || n === undefined ? 1 : toInteger(n);
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = guard || n === undefined ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.dropRightWhile(users, function(o) { return !o.active; });
* // => objects for ['barney']
*
* // The `_.matches` iteratee shorthand.
* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['barney', 'fred']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropRightWhile(users, ['active', false]);
* // => objects for ['barney']
*
* // The `_.property` iteratee shorthand.
* _.dropRightWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate) {
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
}
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.dropWhile(users, function(o) { return !o.active; });
* // => objects for ['pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.dropWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropWhile(users, ['active', false]);
* // => objects for ['pebbles']
*
* // The `_.property` iteratee shorthand.
* _.dropWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate) {
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
}
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*/
function fill(array, value, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, getIteratee(predicate, 3), index);
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
* // => 2
*
* // The `_.matches` iteratee shorthand.
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastIndex(users, ['active', false]);
* // => 2
*
* // The `_.property` iteratee shorthand.
* _.findLastIndex(users, 'active');
* // => 0
*/
function findLastIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length - 1;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
}
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, INFINITY) : [];
}
/**
* Recursively flatten `array` up to `depth` times.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Array
* @param {Array} array The array to flatten.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* var array = [1, [2, [3, [4]], 5]];
*
* _.flattenDepth(array, 1);
* // => [1, 2, [3, [4]], 5]
*
* _.flattenDepth(array, 2);
* // => [1, 2, 3, [4], 5]
*/
function flattenDepth(array, depth) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(array, depth);
}
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['a', 1], ['b', 2]]);
* // => { 'a': 1, 'b': 2 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs == null ? 0 : pairs.length,
result = {};
while (++index < length) {
var pair = pairs[index];
result[pair[0]] = pair[1];
}
return result;
}
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return array && array.length ? array[0] : undefined;
}
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 0, -1) : [];
}
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function (arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
});
/**
* This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [2.1]
*
* // The `_.property` iteratee shorthand.
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = baseRest(function (arrays) {
var iteratee = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
} else {
mapped.pop();
}
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee, 2)) : [];
});
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The order and references
* of result values are determined by the first array. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = baseRest(function (arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
comparator = typeof comparator == 'function' ? comparator : undefined;
if (comparator) {
mapped.pop();
}
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined, comparator) : [];
});
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array == null ? '' : nativeJoin.call(array, separator);
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // Search from the `fromIndex`.
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
}
/**
* Gets the element at index `n` of `array`. If `n` is negative, the nth
* element from the end is returned.
*
* @static
* @memberOf _
* @since 4.11.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=0] The index of the element to return.
* @returns {*} Returns the nth element of `array`.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
*
* _.nth(array, 1);
* // => 'b'
*
* _.nth(array, -2);
* // => 'c';
*/
function nth(array, n) {
return array && array.length ? baseNth(array, toInteger(n)) : undefined;
}
/**
* Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
* to remove elements from an array by predicate.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pull(array, 'a', 'c');
* console.log(array);
* // => ['b', 'b']
*/
var pull = baseRest(pullAll);
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return array && array.length && values && values.length ? basePullAll(array, values) : array;
}
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return array && array.length && values && values.length ? basePullAll(array, values, getIteratee(iteratee, 2)) : array;
}
/**
* This method is like `_.pullAll` except that it accepts `comparator` which
* is invoked to compare elements of `array` to `values`. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
*
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
* console.log(array);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
*/
function pullAllWith(array, values, comparator) {
return array && array.length && values && values.length ? basePullAll(array, values, undefined, comparator) : array;
}
/**
* Removes elements from `array` corresponding to `indexes` and returns an
* array of removed elements.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
* var pulled = _.pullAt(array, [1, 3]);
*
* console.log(array);
* // => ['a', 'c']
*
* console.log(pulled);
* // => ['b', 'd']
*/
var pullAt = flatRest(function (array, indexes) {
var length = array == null ? 0 : array.length,
result = baseAt(array, indexes);
basePullAt(array, arrayMap(indexes, function (index) {
return isIndex(index, length) ? +index : index;
}).sort(compareAscending));
return result;
});
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = getIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array == null ? array : nativeReverse.call(array);
}
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
* returned.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
} else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
return baseSlice(array, start, end);
}
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
* // => 0
*/
function sortedIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
}
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 5, 5, 5, 6], 5);
* // => 4
*/
function sortedLastIndex(array, value) {
return baseSortedIndex(array, value, true);
}
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 1
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
}
/**
* This method is like `_.lastIndexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
* // => 3
*/
function sortedLastIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value, true) - 1;
if (eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return array && array.length ? baseSortedUniq(array) : [];
}
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.3]
*/
function sortedUniqBy(array, iteratee) {
return array && array.length ? baseSortedUniq(array, getIteratee(iteratee, 2)) : [];
}
/**
* Gets all but the first element of `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.tail([1, 2, 3]);
* // => [2, 3]
*/
function tail(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 1, length) : [];
}
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = guard || n === undefined ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements taken from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeRight([1, 2, 3]);
* // => [3]
*
* _.takeRight([1, 2, 3], 2);
* // => [2, 3]
*
* _.takeRight([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.takeRight([1, 2, 3], 0);
* // => []
*/
function takeRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = guard || n === undefined ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.takeRightWhile(users, function(o) { return !o.active; });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeRightWhile(users, ['active', false]);
* // => objects for ['fred', 'pebbles']
*
* // The `_.property` iteratee shorthand.
* _.takeRightWhile(users, 'active');
* // => []
*/
function takeRightWhile(array, predicate) {
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
}
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function (arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function (arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
});
/**
* This method is like `_.union` except that it accepts `comparator` which
* is invoked to compare elements of `arrays`. Result values are chosen from
* the first array in which the value occurs. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.unionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var unionWith = baseRest(function (arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each element
* is kept. The order of result values is determined by the order they occur
* in the array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return array && array.length ? baseUniq(array) : [];
}
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* uniqueness is computed. The order of result values is determined by the
* order they occur in the array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniqBy([2.1, 1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniqBy(array, iteratee) {
return array && array.length ? baseUniq(array, getIteratee(iteratee, 2)) : [];
}
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array.The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator == 'function' ? comparator : undefined;
return array && array.length ? baseUniq(array, undefined, comparator) : [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
* @memberOf _
* @since 1.2.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*
* _.unzip(zipped);
* // => [['a', 'b'], [1, 2], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var length = 0;
array = arrayFilter(array, function (group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
return baseTimes(length, function (index) {
return arrayMap(array, baseProperty(index));
});
}
/**
* This method is like `_.unzip` except that it accepts `iteratee` to specify
* how regrouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @param {Function} [iteratee=_.identity] The function to combine
* regrouped values.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
* // => [[1, 10, 100], [2, 20, 200]]
*
* _.unzipWith(zipped, _.add);
* // => [3, 30, 300]
*/
function unzipWith(array, iteratee) {
if (!(array && array.length)) {
return [];
}
var result = unzip(array);
if (iteratee == null) {
return result;
}
return arrayMap(result, function (group) {
return apply(iteratee, undefined, group);
});
}
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function (array, values) {
return isArrayLikeObject(array) ? baseDifference(array, values) : [];
});
/**
* Creates an array of unique values that is the
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function (arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
/**
* This method is like `_.xor` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which by which they're compared. The order of result values is determined
* by the order they occur in the arrays. The iteratee is invoked with one
* argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2, 3.4]
*
* // The `_.property` iteratee shorthand.
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var xorBy = baseRest(function (arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
});
/**
* This method is like `_.xor` except that it accepts `comparator` which is
* invoked to compare elements of `arrays`. The order of result values is
* determined by the order they occur in the arrays. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.xorWith(objects, others, _.isEqual);
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var xorWith = baseRest(function (arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});
/**
* Creates an array of grouped elements, the first of which contains the
* first elements of the given arrays, the second of which contains the
* second elements of the given arrays, and so on.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/**
* This method is like `_.zipObject` except that it supports property paths.
*
* @static
* @memberOf _
* @since 4.1.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
*/
function zipObjectDeep(props, values) {
return baseZipObject(props || [], values || [], baseSet);
}
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine
* grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = baseRest(function (arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` wrapper instance that wraps `value` with explicit method
* chain sequences enabled. The result of such sequences must be unwrapped
* with `_#value`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Seq
* @param {*} value The value to wrap.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _
* .chain(users)
* .sortBy('age')
* .map(function(o) {
* return o.user + ' is ' + o.age;
* })
* .head()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
}
/**
* This method invokes `interceptor` and returns `value`. The interceptor
* is invoked with one argument; (value). The purpose of this method is to
* "tap into" a method chain sequence in order to modify intermediate results.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3])
* .tap(function(array) {
* // Mutate input array.
* array.pop();
* })
* .reverse()
* .value();
* // => [2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
* The purpose of this method is to "pass thru" values replacing intermediate
* results in a method chain sequence.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
/**
* This method is the wrapper version of `_.at`.
*
* @name at
* @memberOf _
* @since 1.0.0
* @category Seq
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*/
var wrapperAt = flatRest(function (paths) {
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
interceptor = function interceptor(object) {
return baseAt(object, paths);
};
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
return this.thru(interceptor);
}
value = value.slice(start, +start + (length ? 1 : 0));
value.__actions__.push({
'func': thru,
'args': [interceptor],
'thisArg': undefined
});
return new LodashWrapper(value, this.__chain__).thru(function (array) {
if (length && !array.length) {
array.push(undefined);
}
return array;
});
});
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
/**
* Executes the chain sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @since 3.2.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return {
'done': done,
'value': value
};
}
/**
* Enables the wrapper to be iterable.
*
* @name Symbol.iterator
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the wrapper object.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped[Symbol.iterator]() === wrapped;
* // => true
*
* Array.from(wrapped);
* // => [1, 2]
*/
function wrapperToIterator() {
return this;
}
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
/**
* This method is the wrapper version of `_.reverse`.
*
* **Note:** This method mutates the wrapped array.
*
* @name reverse
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2, 3];
*
* _(array).reverse().value()
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function wrapperReverse() {
var value = this.__wrapped__;
if (value instanceof LazyWrapper) {
var wrapped = value;
if (this.__actions__.length) {
wrapped = new LazyWrapper(this);
}
wrapped = wrapped.reverse();
wrapped.__actions__.push({
'func': thru,
'args': [reverse],
'thisArg': undefined
});
return new LodashWrapper(wrapped, this.__chain__);
}
return this.thru(reverse);
}
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
/*------------------------------------------------------------------------*/
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the number of times the key was returned by `iteratee`. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.5.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* // The `_.property` iteratee shorthand.
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function (result, value, key) {
if (hasOwnProperty.call(result, key)) {
++result[key];
} else {
baseAssignValue(result, key, 1);
}
});
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @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.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* 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, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
var findLast = createFind(findLastIndex);
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDeep([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMapDeep(collection, iteratee) {
return baseFlatten(map(collection, iteratee), INFINITY);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results up to `depth` times.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDepth([1, 2], duplicate, 2);
* // => [[1, 1], [2, 2]]
*/
function flatMapDepth(collection, iteratee, depth) {
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(map(collection, iteratee), depth);
}
/**
* 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
*
* _.forEach([1, 2], 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, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @alias eachRight
* @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 _.forEach
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `2` then `1`.
*/
function forEachRight(collection, iteratee) {
var func = isArray(collection) ? arrayEachRight : baseEachRight;
return func(collection, getIteratee(iteratee, 3));
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The order of grouped values
* is determined by the order they occur in `collection`. The corresponding
* value of each key is an array of elements responsible for generating the
* key. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': [4.2], '6': [6.1, 6.3] }
*
* // The `_.property` iteratee shorthand.
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function (result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
baseAssignValue(result, key, [value]);
}
});
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
}
/**
* Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `path` is a function, it's invoked
* for, and `this` bound to, each element in `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|string} path The path of the method to invoke or
* the function invoked per iteration.
* @param {...*} [args] The arguments to invoke each method with.
* @returns {Array} Returns the array of results.
* @example
*
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = baseRest(function (collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function (value) {
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
});
return result;
});
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the last element responsible for generating the key. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function (result, value, key) {
baseAssignValue(result, key, value);
});
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, the second of which
* contains elements `predicate` returns falsey for. The predicate is
* invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 3.0.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 array of grouped elements.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* _.partition(users, function(o) { return o.active; });
* // => objects for [['fred'], ['barney', 'pebbles']]
*
* // The `_.matches` iteratee shorthand.
* _.partition(users, { 'age': 1, 'active': false });
* // => objects for [['pebbles'], ['barney', 'fred']]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.partition(users, ['active', false]);
* // => objects for [['barney', 'pebbles'], ['fred']]
*
* // The `_.property` iteratee shorthand.
* _.partition(users, 'active');
* // => objects for [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function (result, value, key) {
result[key ? 0 : 1].push(value);
}, function () {
return [[], []];
});
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
/**
* This method is like `_.reduce` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduce
* @example
*
* var array = [[0, 1], [2, 3], [4, 5]];
*
* _.reduceRight(array, function(flattened, other) {
* return flattened.concat(other);
* }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduceRight : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
}
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @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 _.filter
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true }
* ];
*
* _.reject(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.reject(users, { 'age': 40, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.reject(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.reject(users, 'active');
* // => objects for ['barney']
*/
function reject(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, negate(getIteratee(predicate, 3)));
}
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var func = isArray(collection) ? arraySample : baseSample;
return func(collection);
}
/**
* Gets `n` random elements at unique keys from `collection` up to the
* size of `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @param {number} [n=1] The number of elements to sample.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the random elements.
* @example
*
* _.sampleSize([1, 2, 3], 2);
* // => [3, 1]
*
* _.sampleSize([1, 2, 3], 4);
* // => [2, 3, 1]
*/
function sampleSize(collection, n, guard) {
if (guard ? isIterateeCall(collection, n, guard) : n === undefined) {
n = 1;
} else {
n = toInteger(n);
}
var func = isArray(collection) ? arraySampleSize : baseSampleSize;
return func(collection, n);
}
/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* _.shuffle([1, 2, 3, 4]);
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
var func = isArray(collection) ? arrayShuffle : baseShuffle;
return func(collection);
}
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @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.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*/
var sortBy = baseRest(function (collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
/*------------------------------------------------------------------------*/
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = ctxNow || function () {
return root.Date.now();
};
/*------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more times.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => Logs 'done saving!' after the two async saves have completed.
*/
function after(n, func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function () {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = func && n == null ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function () {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and `partials` prepended to the arguments it receives.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // Bound with placeholders.
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = baseRest(function (func, thisArg, partials) {
var bitmask = WRAP_BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(func, bitmask, thisArg, partials, holders);
});
/**
* Creates a function that invokes the method at `object[key]` with `partials`
* prepended to the arguments it receives.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist. See
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @since 0.10.0
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // Bound with placeholders.
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = baseRest(function (object, key, partials) {
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bindKey));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(key, bitmask, object, partials, holders);
});
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time; // Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
} // Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // => Logs 'deferred' after one millisecond.
*/
var defer = baseRest(function (func, args) {
return baseDelay(func, 1, args);
});
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
var delay = baseRest(function (func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, WRAP_FLIP_FLAG);
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @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 != null && typeof resolver != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function memoized() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache)();
return memoized;
} // Expose `MapCache`.
memoize.Cache = MapCache;
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new negated function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function () {
var args = arguments;
switch (args.length) {
case 0:
return !predicate.call(this);
case 1:
return !predicate.call(this, args[0]);
case 2:
return !predicate.call(this, args[0], args[1]);
case 3:
return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
/**
* Creates a function that invokes `func` with its arguments transformed.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Function
* @param {Function} func The function to wrap.
* @param {...(Function|Function[])} [transforms=[_.identity]]
* The argument transforms.
* @returns {Function} Returns the new function.
* @example
*
* function doubled(n) {
* return n * 2;
* }
*
* function square(n) {
* return n * n;
* }
*
* var func = _.overArgs(function(x, y) {
* return [x, y];
* }, [square, doubled]);
*
* func(9, 3);
* // => [81, 6]
*
* func(10, 5);
* // => [100, 10]
*/
var overArgs = castRest(function (func, transforms) {
transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
var funcsLength = transforms.length;
return baseRest(function (args) {
var index = -1,
length = nativeMin(args.length, funcsLength);
while (++index < length) {
args[index] = transforms[index].call(this, args[index]);
}
return apply(func, this, args);
});
});
/**
* Creates a function that invokes `func` with `partials` prepended to the
* arguments it receives. This method is like `_.bind` except it does **not**
* alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 0.2.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // Partially applied with placeholders.
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = baseRest(function (func, partials) {
var holders = replaceHolders(partials, getHolder(partial));
return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
});
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to the arguments it receives.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // Partially applied with placeholders.
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = baseRest(function (func, partials) {
var holders = replaceHolders(partials, getHolder(partialRight));
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function (func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? start : toInteger(start);
return baseRest(func, start);
}
/**
* Creates a function that invokes `func` with the `this` binding of the
* create function and an array of arguments much like
* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
*
* **Note:** This method is based on the
* [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @since 3.2.0
* @category Function
* @param {Function} func The function to spread arguments over.
* @param {number} [start=0] The start position of the spread.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start == null ? 0 : nativeMax(toInteger(start), 0);
return baseRest(function (args) {
var array = args[start],
otherArgs = castSlice(args, 0, start);
if (array) {
arrayPush(otherArgs, array);
}
return apply(func, this, otherArgs);
});
}
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
/**
* Creates a function that provides `value` to `wrapper` as its first
* argument. Any additional arguments provided to the function are appended
* to those provided to the `wrapper`. The wrapper is invoked with the `this`
* binding of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {*} value The value to wrap.
* @param {Function} [wrapper=identity] The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '<p>' + func(text) + '</p>';
* });
*
* p('fred, barney, & pebbles');
* // => '<p>fred, barney, & pebbles</p>'
*/
function wrap(value, wrapper) {
return partial(castFunction(wrapper), value);
}
/*------------------------------------------------------------------------*/
/**
* Casts `value` as an array if it's not one.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Lang
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast array.
* @example
*
* _.castArray(1);
* // => [1]
*
* _.castArray({ 'a': 1 });
* // => [{ 'a': 1 }]
*
* _.castArray('abc');
* // => ['abc']
*
* _.castArray(null);
* // => [null]
*
* _.castArray(undefined);
* // => [undefined]
*
* _.castArray();
* // => []
*
* var array = [1, 2, 3];
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
return [];
}
var value = arguments[0];
return isArray(value) ? value : [value];
}
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
* cloning is handled by the method instead. The `customizer` is invoked with
* up to four arguments; (value [, index|key, object, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the cloned value.
* @see _.cloneDeepWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(false);
* }
* }
*
* var el = _.cloneWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 0
*/
function cloneWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
}
/**
* 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, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the deep cloned value.
* @see _.cloneWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(true);
* }
* }
*
* var el = _.cloneDeepWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 20
*/
function cloneDeepWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
}
/**
* Checks if `object` conforms to `source` by invoking the predicate
* properties of `source` with the corresponding property values of `object`.
*
* **Note:** This method is equivalent to `_.conforms` when `source` is
* partially applied.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.conformsTo(object, { 'b': function(n) { return n > 1; } });
* // => true
*
* _.conformsTo(object, { 'b': function(n) { return n > 2; } });
* // => false
*/
function conformsTo(object, source) {
return source == null || baseConformsTo(object, source, keys(source));
}
/**
* 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 greater than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
* @see _.lt
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
var gt = createRelationalOperation(baseGt);
/**
* Checks if `value` is greater than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than or equal to
* `other`, else `false`.
* @see _.lte
* @example
*
* _.gte(3, 1);
* // => true
*
* _.gte(3, 3);
* // => true
*
* _.gte(1, 3);
* // => false
*/
var gte = createRelationalOperation(function (value, other) {
return value >= 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 classified as an `ArrayBuffer` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
* @example
*
* _.isArrayBuffer(new ArrayBuffer(2));
* // => true
*
* _.isArrayBuffer(new Array(2));
* // => false
*/
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
/**
* 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 boolean primitive or object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
}
/**
* 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 `Date` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*
* _.isDate('Mon April 23 2012');
* // => false
*/
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
/**
* Checks if `value` is likely a DOM element.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*
* _.isElement('<body>');
* // => false
*/
function isElement(value) {
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
}
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
/**
* 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);
}
/**
* This method is like `_.isEqual` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with up to
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
}
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag || typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value);
}
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(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) {
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 an integer.
*
* **Note:** This method is based on
* [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
/**
* 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 `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values.
*
* **Note:** This method is equivalent to `_.matches` when `source` is
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.isMatch(object, { 'b': 2 });
* // => true
*
* _.isMatch(object, { 'b': 1 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
/**
* This method is like `_.isMatch` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with five
* arguments: (objValue, srcValue, index|key, object, source).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, srcValue) {
* if (isGreeting(objValue) && isGreeting(srcValue)) {
* return true;
* }
* }
*
* var object = { 'greeting': 'hello' };
* var source = { 'greeting': 'hi' };
*
* _.isMatchWith(object, source, customizer);
* // => true
*/
function isMatchWith(object, source, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseIsMatch(object, source, getMatchData(source), customizer);
}
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is a pristine native function.
*
* **Note:** This method can't reliably detect native functions in the presence
* of the core-js package because core-js circumvents this kind of detection.
* Despite multiple requests, the core-js maintainer has made it clear: any
* attempt to fix the detection will be obstructed. As a result, we're left
* with little choice but to throw an error. Unfortunately, this also affects
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
* which rely on core-js.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (isMaskable(value)) {
throw new Error(CORE_ERROR_TEXT);
}
return baseIsNative(value);
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' || isObjectLike(value) && baseGetTag(value) == numberTag;
}
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
}
/**
* Checks if `value` is classified as a `RegExp` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
* @example
*
* _.isRegExp(/abc/);
* // => true
*
* _.isRegExp('/abc/');
* // => false
*/
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
}
/**
* 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) && baseGetTag(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;
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && baseGetTag(value) == weakSetTag;
}
/**
* Checks if `value` is less than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
* @see _.gt
* @example
*
* _.lt(1, 3);
* // => true
*
* _.lt(3, 3);
* // => false
*
* _.lt(3, 1);
* // => false
*/
var lt = createRelationalOperation(baseLt);
/**
* Checks if `value` is less than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than or equal to
* `other`, else `false`.
* @see _.gte
* @example
*
* _.lte(1, 3);
* // => true
*
* _.lte(3, 3);
* // => true
*
* _.lte(3, 1);
* // => false
*/
var lte = createRelationalOperation(function (value, other) {
return value <= other;
});
/**
* Converts `value` to an array.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Array} Returns the converted array.
* @example
*
* _.toArray({ 'a': 1, 'b': 2 });
* // => [1, 2]
*
* _.toArray('abc');
* // => ['a', 'b', 'c']
*
* _.toArray(1);
* // => []
*
* _.toArray(null);
* // => []
*/
function toArray(value) {
if (!value) {
return [];
}
if (isArrayLike(value)) {
return isString(value) ? stringToArray(value) : copyArray(value);
}
if (symIterator && value[symIterator]) {
return iteratorToArray(value[symIterator]());
}
var tag = getTag(value),
func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
return func(value);
}
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = value < 0 ? -1 : 1;
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* **Note:** This method is 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 convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toLength(3.2);
* // => 3
*
* _.toLength(Number.MIN_VALUE);
* // => 0
*
* _.toLength(Infinity);
* // => 4294967295
*
* _.toLength('3.2');
* // => 3
*/
function toLength(value) {
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
}
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? other + '' : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
/**
* Converts `value` to a safe integer. A safe integer can be compared and
* represented correctly.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3.2);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
* // => 0
*
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3.2');
* // => 3
*/
function toSafeInteger(value) {
return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
}
/**
* 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 convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/*------------------------------------------------------------------------*/
/**
* 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 (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function (object, source) {
copyObject(source, keysIn(source), object);
});
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function (object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
/**
* This method is like `_.assign` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignInWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignWith = createAssigner(function (object, source, srcIndex, customizer) {
copyObject(source, keys(source), object, customizer);
});
/**
* Creates an array of values corresponding to `paths` of `object`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Array} Returns the picked values.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _.at(object, ['a[0].b.c', 'a[1]']);
* // => [3, 4]
*/
var at = flatRest(baseAt);
/**
* Creates an object that inherits from the `prototype` object. If a
* `properties` object is given, its own enumerable string keyed properties
* are assigned to the created object.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Object
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, {
* 'constructor': Circle
* });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties == null ? result : baseAssign(result, properties);
}
/**
* Assigns own and inherited enumerable string keyed properties of source
* objects to the destination object for all destination properties that
* resolve to `undefined`. Source objects are applied from left to right.
* Once a property is set, additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaultsDeep
* @example
*
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var defaults = baseRest(function (object, sources) {
object = Object(object);
var index = -1;
var length = sources.length;
var guard = length > 2 ? sources[2] : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
length = 1;
}
while (++index < length) {
var source = sources[index];
var props = keysIn(source);
var propsIndex = -1;
var propsLength = props.length;
while (++propsIndex < propsLength) {
var key = props[propsIndex];
var value = object[key];
if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
object[key] = source[key];
}
}
}
return object;
});
/**
* This method is like `_.defaults` except that it recursively assigns
* default properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaults
* @example
*
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
* // => { 'a': { 'b': 2, 'c': 3 } }
*/
var defaultsDeep = baseRest(function (args) {
args.push(undefined, customDefaultsMerge);
return apply(mergeWith, undefined, args);
});
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
}
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
}
/**
* Iterates over own and inherited enumerable string keyed properties of an
* object and invokes `iteratee` for each property. The iteratee is invoked
* with three arguments: (value, key, object). Iteratee functions may exit
* iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forInRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forIn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
*/
function forIn(object, iteratee) {
return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn);
}
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn);
}
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, getIteratee(iteratee, 3));
}
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functionsIn
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
/**
* Creates an array of function property names from own and inherited
* enumerable properties of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functions
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functionsIn(new Foo);
* // => ['a', 'b', 'c']
*/
function functionsIn(object) {
return object == null ? [] : baseFunctions(object, keysIn(object));
}
/**
* 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 property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
/**
* 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 object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function (result, value, key) {
if (value != null && typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;
}, constant(identity));
/**
* This method is like `_.invert` except that the inverted object is generated
* from the results of running each element of `object` thru `iteratee`. The
* corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. The iteratee is invoked
* with one argument: (value).
*
* @static
* @memberOf _
* @since 4.1.0
* @category Object
* @param {Object} object The object to invert.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invertBy(object);
* // => { '1': ['a', 'c'], '2': ['b'] }
*
* _.invertBy(object, function(value) {
* return 'group' + value;
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
var invertBy = createInverter(function (result, value, key) {
if (value != null && typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}, getIteratee);
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
/**
* 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);
}
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @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;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
* with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapValues
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function (value, key, object) {
baseAssignValue(result, iteratee(value, key, object), value);
});
return result;
}
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function (value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function (object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
/**
* This method is like `_.merge` except that it accepts `customizer` which
* is invoked to produce the merged values of the destination and source
* properties. If `customizer` returns `undefined`, merging is handled by the
* method instead. The `customizer` is invoked with six arguments:
* (objValue, srcValue, key, object, source, stack).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* if (_.isArray(objValue)) {
* return objValue.concat(srcValue);
* }
* }
*
* var object = { 'a': [1], 'b': [2] };
* var other = { 'a': [3], 'b': [4] };
*
* _.mergeWith(object, other, customizer);
* // => { 'a': [1, 3], 'b': [2, 4] }
*/
var mergeWith = createAssigner(function (object, source, srcIndex, customizer) {
baseMerge(object, source, srcIndex, customizer);
});
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function (object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function (path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable string keyed properties of `object` that
* `predicate` doesn't return truthy for. The predicate is invoked with two
* arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
return pickBy(object, negate(getIteratee(predicate)));
}
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function (object, paths) {
return object == null ? {} : basePick(object, paths);
});
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with two arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1, 'c': 3 }
*/
function pickBy(object, predicate) {
if (object == null) {
return {};
}
var props = arrayMap(getAllKeysIn(object), function (prop) {
return [prop];
});
predicate = getIteratee(predicate);
return basePickBy(object, props, function (value, path) {
return predicate(value, path[0]);
});
}
/**
* This method is like `_.get` except that if the resolved value is a
* function it's invoked with the `this` binding of its parent object and
* its result is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = castPath(path, object);
var index = -1,
length = path.length; // Ensure the loop is entered when path is empty.
if (!length) {
length = 1;
object = undefined;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
if (value === undefined) {
index = length;
value = defaultValue;
}
object = isFunction(value) ? value.call(object) : value;
}
return object;
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
/**
* Creates an array of own and inherited enumerable string keyed-value pairs
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
* or set, its entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entriesIn
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
*/
var toPairsIn = createToPairs(keysIn);
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable string keyed properties thru `iteratee`, with each invocation
* potentially mutating the `accumulator` object. If `accumulator` is not
* provided, a new object with the same `[[Prototype]]` will be used. The
* iteratee is invoked with four arguments: (accumulator, value, key, object).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object),
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
iteratee = getIteratee(iteratee, 4);
if (accumulator == null) {
var Ctor = object && object.constructor;
if (isArrLike) {
accumulator = isArr ? new Ctor() : [];
} else if (isObject(object)) {
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
} else {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object, function (value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
/**
* This method is like `_.set` except that accepts `updater` to produce the
* value to set. Use `_.updateWith` to customize `path` creation. The `updater`
* is invoked with one argument: (value).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.update(object, 'a[0].b.c', function(n) { return n * n; });
* console.log(object.a[0].b.c);
* // => 9
*
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
* console.log(object.x[0].y.z);
* // => 0
*/
function update(object, path, updater) {
return object == null ? object : baseUpdate(object, path, castFunction(updater));
}
/**
* This method is like `_.update` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
/**
* Creates an array of the own and inherited enumerable string keyed property
* values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.valuesIn(new Foo);
* // => [1, 2, 3] (iteration order is not guaranteed)
*/
function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
}
/*------------------------------------------------------------------------*/
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
/**
* Checks if `n` is between `start` and up to, but not including, `end`. If
* `end` is not specified, it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @since 3.3.0
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @see _.range, _.rangeRight
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);
}
/**
* Produces a random number between the inclusive `lower` and `upper` bounds.
* If only one argument is provided a number between `0` and the given number
* is returned. If `floating` is `true`, or either `lower` or `upper` are
* floats, a floating-point number is returned instead of an integer.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Number
* @param {number} [lower=0] The lower bound.
* @param {number} [upper=1] The upper bound.
* @param {boolean} [floating] Specify returning a floating-point number.
* @returns {number} Returns the random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(lower, upper, floating) {
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
upper = floating = undefined;
}
if (floating === undefined) {
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
} else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
}
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
} else {
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toFinite(upper);
}
}
if (lower > upper) {
var temp = lower;
lower = upper;
upper = temp;
}
if (floating || lower % 1 || upper % 1) {
var rand = nativeRandom();
return nativeMin(lower + rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1))), upper);
}
return baseRandom(lower, upper);
}
/*------------------------------------------------------------------------*/
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function (result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
/**
* Deburrs `string` by converting
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
* letters to basic Latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined ? length : baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
/**
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
* corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function escape(string) {
string = toString(string);
return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
}
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string;
}
/**
* Converts `string` to
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the kebab cased string.
* @example
*
* _.kebabCase('Foo Bar');
* // => 'foo-bar'
*
* _.kebabCase('fooBar');
* // => 'foo-bar'
*
* _.kebabCase('__FOO_BAR__');
* // => 'foo-bar'
*/
var kebabCase = createCompounder(function (result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string`, as space separated words, to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('--Foo-Bar--');
* // => 'foo bar'
*
* _.lowerCase('fooBar');
* // => 'foo bar'
*
* _.lowerCase('__FOO_BAR__');
* // => 'foo bar'
*/
var lowerCase = createCompounder(function (result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Converts the first character of `string` to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.lowerFirst('Fred');
* // => 'fred'
*
* _.lowerFirst('FRED');
* // => 'fRED'
*/
var lowerFirst = createCaseFirst('toLowerCase');
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2;
return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
}
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padEnd('abc', 6);
* // => 'abc '
*
* _.padEnd('abc', 6, '_-');
* // => 'abc_-_'
*
* _.padEnd('abc', 3);
* // => 'abc'
*/
function padEnd(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
}
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
}
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a
* hexadecimal, in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
*
* @static
* @memberOf _
* @since 1.1.0
* @category String
* @param {string} string The string to convert.
* @param {number} [radix=10] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
}
/**
* Repeats the given string `n` times.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to repeat.
* @param {number} [n=1] The number of times to repeat the string.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the repeated string.
* @example
*
* _.repeat('*', 3);
* // => '***'
*
* _.repeat('abc', 2);
* // => 'abcabc'
*
* _.repeat('abc', 0);
* // => ''
*/
function repeat(string, n, guard) {
if (guard ? isIterateeCall(string, n, guard) : n === undefined) {
n = 1;
} else {
n = toInteger(n);
}
return baseRepeat(toString(string), n);
}
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function (result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on
* [`String#split`](https://mdn.io/String/split).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to split.
* @param {RegExp|string} separator The separator pattern to split by.
* @param {number} [limit] The length to truncate results to.
* @returns {Array} Returns the string segments.
* @example
*
* _.split('a-b-c', '-', 2);
* // => ['a', 'b']
*/
function split(string, separator, limit) {
if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
separator = limit = undefined;
}
limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
if (!limit) {
return [];
}
string = toString(string);
if (string && (typeof separator == 'string' || separator != null && !isRegExp(separator))) {
separator = baseToString(separator);
if (!separator && hasUnicode(string)) {
return castSlice(stringToArray(string), 0, limit);
}
}
return string.split(separator, limit);
}
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function (result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
/**
* Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting
* object is given, it takes precedence over `_.templateSettings` values.
*
* **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* for easier debugging.
*
* For more information on precompiling templates see
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
*
* For more information on Chrome extension sandboxes see
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
* @param {Object} [options={}] The options object.
* @param {RegExp} [options.escape=_.templateSettings.escape]
* The HTML "escape" delimiter.
* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
* The "evaluate" delimiter.
* @param {Object} [options.imports=_.templateSettings.imports]
* An object to import into the template as free variables.
* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
* The "interpolate" delimiter.
* @param {string} [options.sourceURL='lodash.templateSources[n]']
* The sourceURL of the compiled template.
* @param {string} [options.variable='obj']
* The data object variable name.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
* // Use the "interpolate" delimiter to create a compiled template.
* var compiled = _.template('hello <%= user %>!');
* compiled({ 'user': 'fred' });
* // => 'hello fred!'
*
* // Use the HTML "escape" delimiter to escape data property values.
* var compiled = _.template('<b><%- value %></b>');
* compiled({ 'value': '<script>' });
* // => '<b><script></b>'
*
* // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the internal `print` function in "evaluate" delimiters.
* var compiled = _.template('<% print("hello " + user); %>!');
* compiled({ 'user': 'barney' });
* // => 'hello barney!'
*
* // Use the ES template literal delimiter as an "interpolate" delimiter.
* // Disable support by replacing the "interpolate" delimiter.
* var compiled = _.template('hello ${ user }!');
* compiled({ 'user': 'pebbles' });
* // => 'hello pebbles!'
*
* // Use backslashes to treat delimiters as plain text.
* var compiled = _.template('<%= "\\<%- value %\\>" %>');
* compiled({ 'value': 'ignored' });
* // => '<%- value %>'
*
* // Use the `imports` option to import `jQuery` as `jq`.
* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the `sourceURL` option to specify a custom sourceURL for the template.
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
*
* // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* // var __t, __p = '';
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
* // return __p;
* // }
*
* // Use custom template delimiters.
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // Use the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and stack traces.
* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(string, options, guard) {
// Based on John Resig's `tmpl` implementation
// (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = lodash.templateSettings;
if (guard && isIterateeCall(string, options, guard)) {
options = undefined;
}
string = toString(string);
options = assignInWith({}, options, settings, customDefaultsAssignIn);
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
importsKeys = keys(imports),
importsValues = baseValues(imports, importsKeys);
var isEscaping,
isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '"; // Compile the regexp to match each delimiter.
var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$', 'g'); // Use a sourceURL for easier debugging.
var sourceURL = '//# sourceURL=' + ('sourceURL' in options ? options.sourceURL : 'lodash.templateSources[' + ++templateCounter + ']') + '\n';
string.replace(reDelimiters, function (match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue); // Escape characters that can't be included in string literals.
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); // Replace delimiters with snippets.
if (escapeValue) {
isEscaping = true;
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length; // The JS engine embedded in Adobe products needs `match` returned in
// order to produce the correct `offset` value.
return match;
});
source += "';\n"; // If `variable` is not specified wrap a with-statement around the generated
// code to add the data object to the top of the scope chain.
var variable = options.variable;
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
} // Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;'); // Frame code as the function body.
source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n') + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '') + (isEvaluating ? ', __j = Array.prototype.join;\n' + "function print() { __p += __j.call(arguments, '') }\n" : ';\n') + source + 'return __p\n}';
var result = attempt(function () {
return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
}); // Provide the compiled function's source by its `toString` method or
// the `source` property as a convenience for inlining compiled templates.
result.source = source;
if (isError(result)) {
throw result;
}
return result;
}
/**
* Converts `string`, as a whole, to lower case just like
* [String#toLowerCase](https://mdn.io/toLowerCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.toLower('--Foo-Bar--');
* // => '--foo-bar--'
*
* _.toLower('fooBar');
* // => 'foobar'
*
* _.toLower('__FOO_BAR__');
* // => '__foo_bar__'
*/
function toLower(value) {
return toString(value).toLowerCase();
}
/**
* Converts `string`, as a whole, to upper case just like
* [String#toUpperCase](https://mdn.io/toUpperCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.toUpper('--foo-bar--');
* // => '--FOO-BAR--'
*
* _.toUpper('fooBar');
* // => 'FOOBAR'
*
* _.toUpper('__foo_bar__');
* // => '__FOO_BAR__'
*/
function toUpper(value) {
return toString(value).toUpperCase();
}
/**
* Removes leading and trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trim(' abc ');
* // => 'abc'
*
* _.trim('-_-abc-_-', '_-');
* // => 'abc'
*
* _.map([' foo ', ' bar '], _.trim);
* // => ['foo', 'bar']
*/
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrim, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
chrSymbols = stringToArray(chars),
start = charsStartIndex(strSymbols, chrSymbols),
end = charsEndIndex(strSymbols, chrSymbols) + 1;
return castSlice(strSymbols, start, end).join('');
}
/**
* Removes trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimEnd(' abc ');
* // => ' abc'
*
* _.trimEnd('-_-abc-_-', '_-');
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimEnd, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
return castSlice(strSymbols, 0, end).join('');
}
/**
* Removes leading whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimStart(' abc ');
* // => 'abc '
*
* _.trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
*/
function trimStart(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimStart, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
start = charsStartIndex(strSymbols, stringToArray(chars));
return castSlice(strSymbols, start).join('');
}
/**
* Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to truncate.
* @param {Object} [options={}] The options object.
* @param {number} [options.length=30] The maximum string length.
* @param {string} [options.omission='...'] The string to indicate text is omitted.
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
* @returns {string} Returns the truncated string.
* @example
*
* _.truncate('hi-diddly-ho there, neighborino');
* // => 'hi-diddly-ho there, neighbo...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': ' '
* });
* // => 'hi-diddly-ho there,...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': /,? +/
* });
* // => 'hi-diddly-ho there...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'omission': ' [...]'
* });
* // => 'hi-diddly-ho there, neig [...]'
*/
function truncate(string, options) {
var length = DEFAULT_TRUNC_LENGTH,
omission = DEFAULT_TRUNC_OMISSION;
if (isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? toInteger(options.length) : length;
omission = 'omission' in options ? baseToString(options.omission) : omission;
}
string = toString(string);
var strLength = string.length;
if (hasUnicode(string)) {
var strSymbols = stringToArray(string);
strLength = strSymbols.length;
}
if (length >= strLength) {
return string;
}
var end = length - stringSize(omission);
if (end < 1) {
return omission;
}
var result = strSymbols ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end);
if (separator === undefined) {
return result + omission;
}
if (strSymbols) {
end += result.length - end;
}
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match,
substring = result;
if (!separator.global) {
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
}
separator.lastIndex = 0;
while (match = separator.exec(substring)) {
var newEnd = match.index;
}
result = result.slice(0, newEnd === undefined ? end : newEnd);
}
} else if (string.indexOf(baseToString(separator), end) != end) {
var index = result.lastIndexOf(separator);
if (index > -1) {
result = result.slice(0, index);
}
}
return result + omission;
}
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to
* their corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional
* HTML entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @since 0.6.0
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
}
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function (result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}
return string.match(pattern) || [];
}
/*------------------------------------------------------------------------*/
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Function} func The function to attempt.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object.
* @example
*
* // Avoid throwing errors for invalid selectors.
* var elements = _.attempt(function(selector) {
* return document.querySelectorAll(selector);
* }, '>_>');
*
* if (_.isError(elements)) {
* elements = [];
* }
*/
var attempt = baseRest(function (func, args) {
try {
return apply(func, undefined, args);
} catch (e) {
return isError(e) ? e : new Error(e);
}
});
/**
* Binds methods of an object to the object itself, overwriting the existing
* method.
*
* **Note:** This method doesn't set the "length" property of bound functions.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...(string|string[])} methodNames The object method names to bind.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'click': function() {
* console.log('clicked ' + this.label);
* }
* };
*
* _.bindAll(view, ['click']);
* jQuery(element).on('click', view.click);
* // => Logs 'clicked docs' when clicked.
*/
var bindAll = flatRest(function (object, methodNames) {
arrayEach(methodNames, function (key) {
key = toKey(key);
baseAssignValue(object, key, bind(object[key], object));
});
return object;
});
/**
* Creates a function that iterates over `pairs` and invokes the corresponding
* function of the first predicate to return truthy. The predicate-function
* pairs are invoked with the `this` binding and arguments of the created
* function.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Array} pairs The predicate-function pairs.
* @returns {Function} Returns the new composite function.
* @example
*
* var func = _.cond([
* [_.matches({ 'a': 1 }), _.constant('matches A')],
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
* [_.stubTrue, _.constant('no match')]
* ]);
*
* func({ 'a': 1, 'b': 2 });
* // => 'matches A'
*
* func({ 'a': 0, 'b': 1 });
* // => 'matches B'
*
* func({ 'a': '1', 'b': '2' });
* // => 'no match'
*/
function cond(pairs) {
var length = pairs == null ? 0 : pairs.length,
toIteratee = getIteratee();
pairs = !length ? [] : arrayMap(pairs, function (pair) {
if (typeof pair[1] != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return [toIteratee(pair[0]), pair[1]];
});
return baseRest(function (args) {
var index = -1;
while (++index < length) {
var pair = pairs[index];
if (apply(pair[0], this, args)) {
return apply(pair[1], this, args);
}
}
});
}
/**
* Creates a function that invokes the predicate properties of `source` with
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* **Note:** The created function is equivalent to `_.conformsTo` with
* `source` partially applied.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 2, 'b': 1 },
* { 'a': 1, 'b': 2 }
* ];
*
* _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
* // => [{ 'a': 1, 'b': 2 }]
*/
function conforms(source) {
return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
}
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function () {
return value;
};
}
/**
* Checks `value` to determine whether a default value should be returned in
* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
* or `undefined`.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Util
* @param {*} value The value to check.
* @param {*} defaultValue The default value.
* @returns {*} Returns the resolved value.
* @example
*
* _.defaultTo(1, 10);
* // => 1
*
* _.defaultTo(undefined, 10);
* // => 10
*/
function defaultTo(value, defaultValue) {
return value == null || value !== value ? defaultValue : value;
}
/**
* Creates a function that returns the result of invoking the given functions
* with the `this` binding of the created function, where each successive
* invocation is supplied the return value of the previous.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flowRight
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flow([_.add, square]);
* addSquare(1, 2);
* // => 9
*/
var flow = createFlow();
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
/**
* 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 invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
/**
* Creates a function that performs a partial deep comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`.
*
* **Note:** The created function is equivalent to `_.isMatch` with `source`
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
*/
function matches(source) {
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
}
/**
* Creates a function that performs a partial deep comparison between the
* value at `path` of a given object to `srcValue`, returning `true` if the
* object value is equivalent, else `false`.
*
* **Note:** Partial comparisons will match empty array and empty object
* `srcValue` values against any array or object value, respectively. See
* `_.isEqual` for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.find(objects, _.matchesProperty('a', 4));
* // => { 'a': 4, 'b': 5, 'c': 6 }
*/
function matchesProperty(path, srcValue) {
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
}
/**
* Creates a function that invokes the method at `path` of a given object.
* Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var objects = [
* { 'a': { 'b': _.constant(2) } },
* { 'a': { 'b': _.constant(1) } }
* ];
*
* _.map(objects, _.method('a.b'));
* // => [2, 1]
*
* _.map(objects, _.method(['a', 'b']));
* // => [2, 1]
*/
var method = baseRest(function (path, args) {
return function (object) {
return baseInvoke(object, path, args);
};
});
/**
* The opposite of `_.method`; this method creates a function that invokes
* the method at a given path of `object`. Any additional arguments are
* provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Object} object The object to query.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var array = _.times(3, _.constant),
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.methodOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.methodOf(object));
* // => [2, 0]
*/
var methodOf = baseRest(function (object, args) {
return function (path) {
return baseInvoke(object, path, args);
};
});
/**
* Adds all own enumerable string keyed function properties of a source
* object to the destination object. If `object` is a function, then methods
* are added to its prototype as well.
*
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
* avoid conflicts caused by modifying the original.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Function|Object} [object=lodash] The destination object.
* @param {Object} source The object of functions to add.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.chain=true] Specify whether mixins are chainable.
* @returns {Function|Object} Returns `object`.
* @example
*
* function vowels(string) {
* return _.filter(string, function(v) {
* return /[aeiou]/i.test(v);
* });
* }
*
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
*
* _('fred').vowels().value();
* // => ['e']
*
* _.mixin({ 'vowels': vowels }, { 'chain': false });
* _('fred').vowels();
* // => ['e']
*/
function mixin(object, source, options) {
var props = keys(source),
methodNames = baseFunctions(source, props);
if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
options = source;
source = object;
object = this;
methodNames = baseFunctions(source, keys(source));
}
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
isFunc = isFunction(object);
arrayEach(methodNames, function (methodName) {
var func = source[methodName];
object[methodName] = func;
if (isFunc) {
object.prototype[methodName] = function () {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__),
actions = result.__actions__ = copyArray(this.__actions__);
actions.push({
'func': func,
'args': arguments,
'thisArg': object
});
result.__chain__ = chainAll;
return result;
}
return func.apply(object, arrayPush([this.value()], arguments));
};
}
});
return object;
}
/**
* Reverts the `_` variable to its previous value and returns a reference to
* the `lodash` function.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @returns {Function} Returns the `lodash` function.
* @example
*
* var lodash = _.noConflict();
*/
function noConflict() {
if (root._ === this) {
root._ = oldDash;
}
return this;
}
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {} // No operation performed.
/**
* Creates a function that gets the argument at index `n`. If `n` is negative,
* the nth argument from the end is returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [n=0] The index of the argument to return.
* @returns {Function} Returns the new pass-thru function.
* @example
*
* var func = _.nthArg(1);
* func('a', 'b', 'c', 'd');
* // => 'b'
*
* var func = _.nthArg(-2);
* func('a', 'b', 'c', 'd');
* // => 'c'
*/
function nthArg(n) {
n = toInteger(n);
return baseRest(function (args) {
return baseNth(args, n);
});
}
/**
* Creates a function that invokes `iteratees` with the arguments it receives
* and returns their results.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to invoke.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.over([Math.max, Math.min]);
*
* func(1, 2, 3, 4);
* // => [4, 1]
*/
var over = createOver(arrayMap);
/**
* Creates a function that checks if **all** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overEvery([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => false
*
* func(NaN);
* // => false
*/
var overEvery = createOver(arrayEvery);
/**
* Creates a function that checks if **any** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overSome([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => true
*
* func(NaN);
* // => false
*/
var overSome = createOver(arraySome);
/**
* 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);
}
/**
* The opposite of `_.property`; this method creates a function that returns
* the value at a given path of `object`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
* @example
*
* var array = [0, 1, 2],
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.propertyOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
* // => [2, 0]
*/
function propertyOf(object) {
return function (path) {
return object == null ? undefined : baseGet(object, path);
};
}
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified,
* it's set to `start` with `start` then set to `0`.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.rangeRight
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
/**
* This method is like `_.range` except that it populates values in
* descending order.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.range
* @example
*
* _.rangeRight(4);
* // => [3, 2, 1, 0]
*
* _.rangeRight(-4);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 5);
* // => [4, 3, 2, 1]
*
* _.rangeRight(0, 20, 5);
* // => [15, 10, 5, 0]
*
* _.rangeRight(0, -4, -1);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 4, 0);
* // => [1, 1, 1]
*
* _.rangeRight(0);
* // => []
*/
var rangeRight = createRange(true);
/**
* 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;
}
/**
* This method returns a new empty object.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Object} Returns the new empty object.
* @example
*
* var objects = _.times(2, _.stubObject);
*
* console.log(objects);
* // => [{}, {}]
*
* console.log(objects[0] === objects[1]);
* // => false
*/
function stubObject() {
return {};
}
/**
* This method returns an empty string.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {string} Returns the empty string.
* @example
*
* _.times(2, _.stubString);
* // => ['', '']
*/
function stubString() {
return '';
}
/**
* This method returns `true`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `true`.
* @example
*
* _.times(2, _.stubTrue);
* // => [true, true]
*/
function stubTrue() {
return true;
}
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = getIteratee(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
/**
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {string} [prefix=''] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
/*------------------------------------------------------------------------*/
/**
* Adds two numbers.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {number} augend The first number in an addition.
* @param {number} addend The second number in an addition.
* @returns {number} Returns the total.
* @example
*
* _.add(6, 4);
* // => 10
*/
var add = createMathOperation(function (augend, addend) {
return augend + addend;
}, 0);
/**
* Computes `number` rounded up to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round up.
* @param {number} [precision=0] The precision to round up to.
* @returns {number} Returns the rounded up number.
* @example
*
* _.ceil(4.006);
* // => 5
*
* _.ceil(6.004, 2);
* // => 6.01
*
* _.ceil(6040, -2);
* // => 6100
*/
var ceil = createRound('ceil');
/**
* Divide two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} dividend The first number in a division.
* @param {number} divisor The second number in a division.
* @returns {number} Returns the quotient.
* @example
*
* _.divide(6, 4);
* // => 1.5
*/
var divide = createMathOperation(function (dividend, divisor) {
return dividend / divisor;
}, 1);
/**
* Computes `number` rounded down to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round down.
* @param {number} [precision=0] The precision to round down to.
* @returns {number} Returns the rounded down number.
* @example
*
* _.floor(4.006);
* // => 4
*
* _.floor(0.046, 2);
* // => 0.04
*
* _.floor(4060, -2);
* // => 4000
*/
var floor = createRound('floor');
/**
* Computes the maximum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the maximum value.
* @example
*
* _.max([4, 2, 8, 6]);
* // => 8
*
* _.max([]);
* // => undefined
*/
function max(array) {
return array && array.length ? baseExtremum(array, identity, baseGt) : undefined;
}
/**
* This method is like `_.max` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the maximum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* // The `_.property` iteratee shorthand.
* _.maxBy(objects, 'n');
* // => { 'n': 2 }
*/
function maxBy(array, iteratee) {
return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined;
}
/**
* Computes the mean of the values in `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the mean.
* @example
*
* _.mean([4, 2, 8, 6]);
* // => 5
*/
function mean(array) {
return baseMean(array, identity);
}
/**
* This method is like `_.mean` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be averaged.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the mean.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.meanBy(objects, function(o) { return o.n; });
* // => 5
*
* // The `_.property` iteratee shorthand.
* _.meanBy(objects, 'n');
* // => 5
*/
function meanBy(array, iteratee) {
return baseMean(array, getIteratee(iteratee, 2));
}
/**
* Computes the minimum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* _.min([]);
* // => undefined
*/
function min(array) {
return array && array.length ? baseExtremum(array, identity, baseLt) : undefined;
}
/**
* This method is like `_.min` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the minimum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.minBy(objects, function(o) { return o.n; });
* // => { 'n': 1 }
*
* // The `_.property` iteratee shorthand.
* _.minBy(objects, 'n');
* // => { 'n': 1 }
*/
function minBy(array, iteratee) {
return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined;
}
/**
* Multiply two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} multiplier The first number in a multiplication.
* @param {number} multiplicand The second number in a multiplication.
* @returns {number} Returns the product.
* @example
*
* _.multiply(6, 4);
* // => 24
*/
var multiply = createMathOperation(function (multiplier, multiplicand) {
return multiplier * multiplicand;
}, 1);
/**
* Computes `number` rounded to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round.
* @param {number} [precision=0] The precision to round to.
* @returns {number} Returns the rounded number.
* @example
*
* _.round(4.006);
* // => 4
*
* _.round(4.006, 2);
* // => 4.01
*
* _.round(4060, -2);
* // => 4100
*/
var round = createRound('round');
/**
* Subtract two numbers.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {number} minuend The first number in a subtraction.
* @param {number} subtrahend The second number in a subtraction.
* @returns {number} Returns the difference.
* @example
*
* _.subtract(6, 4);
* // => 2
*/
var subtract = createMathOperation(function (minuend, subtrahend) {
return minuend - subtrahend;
}, 0);
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return array && array.length ? baseSum(array, identity) : 0;
}
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // The `_.property` iteratee shorthand.
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return array && array.length ? baseSum(array, getIteratee(iteratee, 2)) : 0;
}
/*------------------------------------------------------------------------*/
// Add methods that return wrapped values in chain sequences.
lodash.after = after;
lodash.ary = ary;
lodash.assign = assign;
lodash.assignIn = assignIn;
lodash.assignInWith = assignInWith;
lodash.assignWith = assignWith;
lodash.at = at;
lodash.before = before;
lodash.bind = bind;
lodash.bindAll = bindAll;
lodash.bindKey = bindKey;
lodash.castArray = castArray;
lodash.chain = chain;
lodash.chunk = chunk;
lodash.compact = compact;
lodash.concat = concat;
lodash.cond = cond;
lodash.conforms = conforms;
lodash.constant = constant;
lodash.countBy = countBy;
lodash.create = create;
lodash.curry = curry;
lodash.curryRight = curryRight;
lodash.debounce = debounce;
lodash.defaults = defaults;
lodash.defaultsDeep = defaultsDeep;
lodash.defer = defer;
lodash.delay = delay;
lodash.difference = difference;
lodash.differenceBy = differenceBy;
lodash.differenceWith = differenceWith;
lodash.drop = drop;
lodash.dropRight = dropRight;
lodash.dropRightWhile = dropRightWhile;
lodash.dropWhile = dropWhile;
lodash.fill = fill;
lodash.filter = filter;
lodash.flatMap = flatMap;
lodash.flatMapDeep = flatMapDeep;
lodash.flatMapDepth = flatMapDepth;
lodash.flatten = flatten;
lodash.flattenDeep = flattenDeep;
lodash.flattenDepth = flattenDepth;
lodash.flip = flip;
lodash.flow = flow;
lodash.flowRight = flowRight;
lodash.fromPairs = fromPairs;
lodash.functions = functions;
lodash.functionsIn = functionsIn;
lodash.groupBy = groupBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.intersectionBy = intersectionBy;
lodash.intersectionWith = intersectionWith;
lodash.invert = invert;
lodash.invertBy = invertBy;
lodash.invokeMap = invokeMap;
lodash.iteratee = iteratee;
lodash.keyBy = keyBy;
lodash.keys = keys;
lodash.keysIn = keysIn;
lodash.map = map;
lodash.mapKeys = mapKeys;
lodash.mapValues = mapValues;
lodash.matches = matches;
lodash.matchesProperty = matchesProperty;
lodash.memoize = memoize;
lodash.merge = merge;
lodash.mergeWith = mergeWith;
lodash.method = method;
lodash.methodOf = methodOf;
lodash.mixin = mixin;
lodash.negate = negate;
lodash.nthArg = nthArg;
lodash.omit = omit;
lodash.omitBy = omitBy;
lodash.once = once;
lodash.orderBy = orderBy;
lodash.over = over;
lodash.overArgs = overArgs;
lodash.overEvery = overEvery;
lodash.overSome = overSome;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.partition = partition;
lodash.pick = pick;
lodash.pickBy = pickBy;
lodash.property = property;
lodash.propertyOf = propertyOf;
lodash.pull = pull;
lodash.pullAll = pullAll;
lodash.pullAllBy = pullAllBy;
lodash.pullAllWith = pullAllWith;
lodash.pullAt = pullAt;
lodash.range = range;
lodash.rangeRight = rangeRight;
lodash.rearg = rearg;
lodash.reject = reject;
lodash.remove = remove;
lodash.rest = rest;
lodash.reverse = reverse;
lodash.sampleSize = sampleSize;
lodash.set = set;
lodash.setWith = setWith;
lodash.shuffle = shuffle;
lodash.slice = slice;
lodash.sortBy = sortBy;
lodash.sortedUniq = sortedUniq;
lodash.sortedUniqBy = sortedUniqBy;
lodash.split = split;
lodash.spread = spread;
lodash.tail = tail;
lodash.take = take;
lodash.takeRight = takeRight;
lodash.takeRightWhile = takeRightWhile;
lodash.takeWhile = takeWhile;
lodash.tap = tap;
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.toPairs = toPairs;
lodash.toPairsIn = toPairsIn;
lodash.toPath = toPath;
lodash.toPlainObject = toPlainObject;
lodash.transform = transform;
lodash.unary = unary;
lodash.union = union;
lodash.unionBy = unionBy;
lodash.unionWith = unionWith;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unset = unset;
lodash.unzip = unzip;
lodash.unzipWith = unzipWith;
lodash.update = update;
lodash.updateWith = updateWith;
lodash.values = values;
lodash.valuesIn = valuesIn;
lodash.without = without;
lodash.words = words;
lodash.wrap = wrap;
lodash.xor = xor;
lodash.xorBy = xorBy;
lodash.xorWith = xorWith;
lodash.zip = zip;
lodash.zipObject = zipObject;
lodash.zipObjectDeep = zipObjectDeep;
lodash.zipWith = zipWith; // Add aliases.
lodash.entries = toPairs;
lodash.entriesIn = toPairsIn;
lodash.extend = assignIn;
lodash.extendWith = assignInWith; // Add methods to `lodash.prototype`.
mixin(lodash, lodash);
/*------------------------------------------------------------------------*/
// Add methods that return unwrapped values in chain sequences.
lodash.add = add;
lodash.attempt = attempt;
lodash.camelCase = camelCase;
lodash.capitalize = capitalize;
lodash.ceil = ceil;
lodash.clamp = clamp;
lodash.clone = clone;
lodash.cloneDeep = cloneDeep;
lodash.cloneDeepWith = cloneDeepWith;
lodash.cloneWith = cloneWith;
lodash.conformsTo = conformsTo;
lodash.deburr = deburr;
lodash.defaultTo = defaultTo;
lodash.divide = divide;
lodash.endsWith = endsWith;
lodash.eq = eq;
lodash.escape = escape;
lodash.escapeRegExp = escapeRegExp;
lodash.every = every;
lodash.find = find;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.floor = floor;
lodash.forEach = forEach;
lodash.forEachRight = forEachRight;
lodash.forIn = forIn;
lodash.forInRight = forInRight;
lodash.forOwn = forOwn;
lodash.forOwnRight = forOwnRight;
lodash.get = get;
lodash.gt = gt;
lodash.gte = gte;
lodash.has = has;
lodash.hasIn = hasIn;
lodash.head = head;
lodash.identity = identity;
lodash.includes = includes;
lodash.indexOf = indexOf;
lodash.inRange = inRange;
lodash.invoke = invoke;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isArrayBuffer = isArrayBuffer;
lodash.isArrayLike = isArrayLike;
lodash.isArrayLikeObject = isArrayLikeObject;
lodash.isBoolean = isBoolean;
lodash.isBuffer = isBuffer;
lodash.isDate = isDate;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
lodash.isEqual = isEqual;
lodash.isEqualWith = isEqualWith;
lodash.isError = isError;
lodash.isFinite = isFinite;
lodash.isFunction = isFunction;
lodash.isInteger = isInteger;
lodash.isLength = isLength;
lodash.isMap = isMap;
lodash.isMatch = isMatch;
lodash.isMatchWith = isMatchWith;
lodash.isNaN = isNaN;
lodash.isNative = isNative;
lodash.isNil = isNil;
lodash.isNull = isNull;
lodash.isNumber = isNumber;
lodash.isObject = isObject;
lodash.isObjectLike = isObjectLike;
lodash.isPlainObject = isPlainObject;
lodash.isRegExp = isRegExp;
lodash.isSafeInteger = isSafeInteger;
lodash.isSet = isSet;
lodash.isString = isString;
lodash.isSymbol = isSymbol;
lodash.isTypedArray = isTypedArray;
lodash.isUndefined = isUndefined;
lodash.isWeakMap = isWeakMap;
lodash.isWeakSet = isWeakSet;
lodash.join = join;
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lowerFirst = lowerFirst;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max;
lodash.maxBy = maxBy;
lodash.mean = mean;
lodash.meanBy = meanBy;
lodash.min = min;
lodash.minBy = minBy;
lodash.stubArray = stubArray;
lodash.stubFalse = stubFalse;
lodash.stubObject = stubObject;
lodash.stubString = stubString;
lodash.stubTrue = stubTrue;
lodash.multiply = multiply;
lodash.nth = nth;
lodash.noConflict = noConflict;
lodash.noop = noop;
lodash.now = now;
lodash.pad = pad;
lodash.padEnd = padEnd;
lodash.padStart = padStart;
lodash.parseInt = parseInt;
lodash.random = random;
lodash.reduce = reduce;
lodash.reduceRight = reduceRight;
lodash.repeat = repeat;
lodash.replace = replace;
lodash.result = result;
lodash.round = round;
lodash.runInContext = runInContext;
lodash.sample = sample;
lodash.size = size;
lodash.snakeCase = snakeCase;
lodash.some = some;
lodash.sortedIndex = sortedIndex;
lodash.sortedIndexBy = sortedIndexBy;
lodash.sortedIndexOf = sortedIndexOf;
lodash.sortedLastIndex = sortedLastIndex;
lodash.sortedLastIndexBy = sortedLastIndexBy;
lodash.sortedLastIndexOf = sortedLastIndexOf;
lodash.startCase = startCase;
lodash.startsWith = startsWith;
lodash.subtract = subtract;
lodash.sum = sum;
lodash.sumBy = sumBy;
lodash.template = template;
lodash.times = times;
lodash.toFinite = toFinite;
lodash.toInteger = toInteger;
lodash.toLength = toLength;
lodash.toLower = toLower;
lodash.toNumber = toNumber;
lodash.toSafeInteger = toSafeInteger;
lodash.toString = toString;
lodash.toUpper = toUpper;
lodash.trim = trim;
lodash.trimEnd = trimEnd;
lodash.trimStart = trimStart;
lodash.truncate = truncate;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
lodash.upperCase = upperCase;
lodash.upperFirst = upperFirst; // Add aliases.
lodash.each = forEach;
lodash.eachRight = forEachRight;
lodash.first = head;
mixin(lodash, function () {
var source = {};
baseForOwn(lodash, function (func, methodName) {
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
source[methodName] = func;
}
});
return source;
}(), {
'chain': false
});
/*------------------------------------------------------------------------*/
/**
* The semantic version number.
*
* @static
* @memberOf _
* @type {string}
*/
lodash.VERSION = VERSION; // Assign default placeholders.
arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function (methodName) {
lodash[methodName].placeholder = lodash;
}); // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
arrayEach(['drop', 'take'], function (methodName, index) {
LazyWrapper.prototype[methodName] = function (n) {
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__);
} else {
result.__views__.push({
'size': nativeMin(n, MAX_ARRAY_LENGTH),
'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
});
}
return result;
};
LazyWrapper.prototype[methodName + 'Right'] = function (n) {
return this.reverse()[methodName](n).reverse();
};
}); // Add `LazyWrapper` methods that accept an `iteratee` value.
arrayEach(['filter', 'map', 'takeWhile'], function (methodName, index) {
var type = index + 1,
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
LazyWrapper.prototype[methodName] = function (iteratee) {
var result = this.clone();
result.__iteratees__.push({
'iteratee': getIteratee(iteratee, 3),
'type': type
});
result.__filtered__ = result.__filtered__ || isFilter;
return result;
};
}); // Add `LazyWrapper` methods for `_.head` and `_.last`.
arrayEach(['head', 'last'], function (methodName, index) {
var takeName = 'take' + (index ? 'Right' : '');
LazyWrapper.prototype[methodName] = function () {
return this[takeName](1).value()[0];
};
}); // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
arrayEach(['initial', 'tail'], function (methodName, index) {
var dropName = 'drop' + (index ? '' : 'Right');
LazyWrapper.prototype[methodName] = function () {
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
};
});
LazyWrapper.prototype.compact = function () {
return this.filter(identity);
};
LazyWrapper.prototype.find = function (predicate) {
return this.filter(predicate).head();
};
LazyWrapper.prototype.findLast = function (predicate) {
return this.reverse().find(predicate);
};
LazyWrapper.prototype.invokeMap = baseRest(function (path, args) {
if (typeof path == 'function') {
return new LazyWrapper(this);
}
return this.map(function (value) {
return baseInvoke(value, path, args);
});
});
LazyWrapper.prototype.reject = function (predicate) {
return this.filter(negate(getIteratee(predicate)));
};
LazyWrapper.prototype.slice = function (start, end) {
start = toInteger(start);
var result = this;
if (result.__filtered__ && (start > 0 || end < 0)) {
return new LazyWrapper(result);
}
if (start < 0) {
result = result.takeRight(-start);
} else if (start) {
result = result.drop(start);
}
if (end !== undefined) {
end = toInteger(end);
result = end < 0 ? result.dropRight(-end) : result.take(end - start);
}
return result;
};
LazyWrapper.prototype.takeRightWhile = function (predicate) {
return this.reverse().takeWhile(predicate).reverse();
};
LazyWrapper.prototype.toArray = function () {
return this.take(MAX_ARRAY_LENGTH);
}; // Add `LazyWrapper` methods to `lodash.prototype`.
baseForOwn(LazyWrapper.prototype, function (func, methodName) {
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
isTaker = /^(?:head|last)$/.test(methodName),
lodashFunc = lodash[isTaker ? 'take' + (methodName == 'last' ? 'Right' : '') : methodName],
retUnwrapped = isTaker || /^find/.test(methodName);
if (!lodashFunc) {
return;
}
lodash.prototype[methodName] = function () {
var value = this.__wrapped__,
args = isTaker ? [1] : arguments,
isLazy = value instanceof LazyWrapper,
iteratee = args[0],
useLazy = isLazy || isArray(value);
var interceptor = function interceptor(value) {
var result = lodashFunc.apply(lodash, arrayPush([value], args));
return isTaker && chainAll ? result[0] : result;
};
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
// Avoid lazy use if the iteratee has a "length" value other than `1`.
isLazy = useLazy = false;
}
var chainAll = this.__chain__,
isHybrid = !!this.__actions__.length,
isUnwrapped = retUnwrapped && !chainAll,
onlyLazy = isLazy && !isHybrid;
if (!retUnwrapped && useLazy) {
value = onlyLazy ? value : new LazyWrapper(this);
var result = func.apply(value, args);
result.__actions__.push({
'func': thru,
'args': [interceptor],
'thisArg': undefined
});
return new LodashWrapper(result, chainAll);
}
if (isUnwrapped && onlyLazy) {
return func.apply(this, args);
}
result = this.thru(interceptor);
return isUnwrapped ? isTaker ? result.value()[0] : result.value() : result;
};
}); // Add `Array` methods to `lodash.prototype`.
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function (methodName) {
var func = arrayProto[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
lodash.prototype[methodName] = function () {
var args = arguments;
if (retUnwrapped && !this.__chain__) {
var value = this.value();
return func.apply(isArray(value) ? value : [], args);
}
return this[chainName](function (value) {
return func.apply(isArray(value) ? value : [], args);
});
};
}); // Map minified method names to their real names.
baseForOwn(LazyWrapper.prototype, function (func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
var key = lodashFunc.name + '',
names = realNames[key] || (realNames[key] = []);
names.push({
'name': methodName,
'func': lodashFunc
});
}
});
realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
'name': 'wrapper',
'func': undefined
}]; // Add methods to `LazyWrapper`.
LazyWrapper.prototype.clone = lazyClone;
LazyWrapper.prototype.reverse = lazyReverse;
LazyWrapper.prototype.value = lazyValue; // Add chain sequence methods to the `lodash` wrapper.
lodash.prototype.at = wrapperAt;
lodash.prototype.chain = wrapperChain;
lodash.prototype.commit = wrapperCommit;
lodash.prototype.next = wrapperNext;
lodash.prototype.plant = wrapperPlant;
lodash.prototype.reverse = wrapperReverse;
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; // Add lazy aliases.
lodash.prototype.first = lodash.prototype.head;
if (symIterator) {
lodash.prototype[symIterator] = wrapperToIterator;
}
return lodash;
};
/*--------------------------------------------------------------------------*/
// Export lodash.
var _ = runInContext(); // Some AMD build optimizers, like r.js, check for condition patterns like:
if (typeof define == 'function' && _typeof(define.amd) == 'object' && define.amd) {
// Expose Lodash on the global object to prevent errors when Lodash is
// loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object.
root._ = _; // Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module.
define(function () {
return _;
});
} // Check for `exports` after `define` in case a build optimizer adds it.
else if (freeModule) {
// Export for Node.js.
(freeModule.exports = _)._ = _; // Export for CommonJS support.
freeExports._ = _;
} else {
// Export to the global object.
root._ = _;
}
}).call(this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/global.js */ 87), __webpack_require__(/*! ./../webpack/buildin/module.js */ 29)(module)))
/***/ }),
/* 58 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseIndexOf.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ 90),
baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ 167),
strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ 168);
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
/***/ }),
/* 59 */
/*!********************************************!*\
!*** ./node_modules/lodash/isUndefined.js ***!
\********************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
module.exports = isUndefined;
/***/ }),
/* 60 */
/*!*******************************************************!*\
!*** ./includes/module_dependencies/hover-options.js ***!
\*******************************************************/
/*! exports provided: hoverSuffix, enabledSuffix, doesSupport, hasTabs, getFieldBaseName, isEnabled, isHoverMode, getHoverField, getHoverEnabledField, getHoverFieldOnHover, getValue, getValueOnHover, getHoverOrNormal, getHoverOrNormalOnHover, getSplitValue, getSplitValueOnHover, getCompositeValue, getCompositeValueOnHover, getCompositeFieldOnHover, getHoverFieldsDefinition, default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export hoverSuffix */
/* unused harmony export enabledSuffix */
/* unused harmony export doesSupport */
/* unused harmony export hasTabs */
/* unused harmony export getFieldBaseName */
/* unused harmony export isEnabled */
/* unused harmony export isHoverMode */
/* unused harmony export getHoverField */
/* unused harmony export getHoverEnabledField */
/* unused harmony export getHoverFieldOnHover */
/* unused harmony export getValue */
/* unused harmony export getValueOnHover */
/* unused harmony export getHoverOrNormal */
/* unused harmony export getHoverOrNormalOnHover */
/* unused harmony export getSplitValue */
/* unused harmony export getSplitValueOnHover */
/* unused harmony export getCompositeValue */
/* unused harmony export getCompositeValueOnHover */
/* unused harmony export getCompositeFieldOnHover */
/* unused harmony export getHoverFieldsDefinition */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_forEach__ = __webpack_require__(/*! lodash/forEach */ 38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_forEach___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_forEach__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_fp_prop__ = __webpack_require__(/*! lodash/fp/prop */ 194);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_fp_prop___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_fp_prop__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_fp_times__ = __webpack_require__(/*! lodash/fp/times */ 265);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_fp_times___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_fp_times__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_fp_equals__ = __webpack_require__(/*! lodash/fp/equals */ 267);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_fp_equals___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_fp_equals__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_fp_compose__ = __webpack_require__(/*! lodash/fp/compose */ 127);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_fp_compose___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_fp_compose__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__hover_options_pure__ = __webpack_require__(/*! ./hover-options-pure */ 128);
function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/var hover='__hover';var enabled='__hover_enabled';var getHoverProp=__WEBPACK_IMPORTED_MODULE_3_lodash_fp_prop___default()('hover');var toBool=function toBool(a){return!!a;};var emptyValue=function emptyValue(v){return''===v?undefined:v;};var get=function get(k,o,d){return emptyValue(__WEBPACK_IMPORTED_MODULE_0_lodash_get___default()(o,k,d))||d;};/**
* Returns the option suffix used for hover options.
*
* @returns {string}
*/var hoverSuffix=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].hoverSuffix;/**
* Returns the option enabled suffix used for hover options.
*
* @returns {string}
*/var enabledSuffix=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].enabledSuffix;/**
* Tells if the field does support hover options.
*
* @param {object} field
* @returns {boolean}
*/var doesSupport=__WEBPACK_IMPORTED_MODULE_6_lodash_fp_compose___default()(toBool,getHoverProp);/**
* Tells if the field does support hover options tabs.
*
* @param {object} field
* @returns {boolean}
*/var hasTabs=__WEBPACK_IMPORTED_MODULE_6_lodash_fp_compose___default()(__WEBPACK_IMPORTED_MODULE_5_lodash_fp_equals___default()('tabs'),getHoverProp);/**
* Gets the base name of the field without the "__hover" or "__hover_enabled" suffix.
*
* @returns String.
*/var getFieldBaseName=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].getFieldBaseName;/**
* Tells if the module option has hover options enabled.
*
* @param {string} setting
* @param {object} props
* @returns {boolean}
*/var isEnabled=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].isEnabled;/**
* Tells if the hover tabs are in hover state.
*
* @returns {boolean}
*/ // export const isHoverMode = () => !! ETBuilderStore.getHoverMode();
var isHoverMode=function isHoverMode(){return'false';};/**
* Returns field name suffixed with `__hover`.
*
* @param {string} field
* @returns {string}
*/var getHoverField=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].getHoverField;/**
* Returns field name suffixed with `__hover_enabled`.
*
* @param {string} field
* @returns {string}
*/var getHoverEnabledField=__WEBPACK_IMPORTED_MODULE_7__hover_options_pure__["a" /* default */].getHoverEnabledField;/**
* Return the field suffixed with `hover` only the the hover mode it active.
*
* @param {string} field
* @param {object} props
* @returns {string}
*/var getHoverFieldOnHover=function getHoverFieldOnHover(field,props){return isHoverMode()&&isEnabled(field,props)?getHoverField(field):getFieldBaseName(field);};/**
* Returns the field hover value.
*
* @param {string} field
* @param {object} props
* @param defaultValue
* @returns {*}
*/var getValue=function getValue(field,props,defaultValue){return 1===__WEBPACK_IMPORTED_MODULE_0_lodash_get___default()(props,'hover_enabled')&&isEnabled(field,props)?get(getHoverField(field),props,get(field,props,defaultValue)):defaultValue;};/**
* Returns the field hover value only if hover tabs are active.
*
* @param {string} setting
* @param {object} props
* @param defaultValue
* @returns {*}
*/var getValueOnHover=function getValueOnHover(setting,props,defaultValue){return isHoverMode()?getValue(setting,props,defaultValue):defaultValue;};/**
* Return the hover value or the normal values if hover values is not enabled or ie empty
* Is the equivalent of `getValue(setting, props, props[setting])`.
*
* @param {string} setting
* @param {object} props
* @returns {*}
*/var getHoverOrNormal=function getHoverOrNormal(setting,props){return getValue(setting,props,get(getFieldBaseName(setting),props));};/**
* Same as getHoverOrNormal, but checks if is hover mode state.
*
* @param setting
* @param props
* @returns {*}
*/var getHoverOrNormalOnHover=function getHoverOrNormalOnHover(setting,props){return getValueOnHover(setting,props,get(getFieldBaseName(setting),props));};/**
* Sets setting hover enabled or disabled. `true` enables setting's hover, false disables.
*
* @param {boolean} state
* @param {string} setting
* @param {object} module
*/ // export const setFieldHover = (state, setting, module) => ETBuilderActions.moduleSettingsChange(module, getHoverEnabledField(setting), state ? 'on' : '');
/**
* Same as getValue, but for values that needs to be split like margin, padding.
* The methods takes care that if n-th split value is missing from hover value, it is inherited
* from normal value.
*
* !!! Note: This method is useful only when you need the hover value to inherit from normal.
* It should not be used on saving hover value, as it will add redundancy.
*
* @param {string} setting
* @param {object} props
* @param {string} sep
* @returns {*}
*/var getSplitValue=function getSplitValue(setting,props){var sep=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'|';if(!isEnabled(setting,props)){return;}var value=String(get(setting,props,'')).split(sep);var hover=String(getValue(setting,props,'')).split(sep);// Get the longest length
var len=Math.max(value.length,hover.length);// Fill the hover value empty values with value's ones
return __WEBPACK_IMPORTED_MODULE_4_lodash_fp_times___default()(function(i){return get(i,hover,value[i]);},len).join(sep);};/**
* Works same way as getSplitValue but only when isHoverMode.
*
* @param {string} setting
* @param {object} props
* @param {string} sep
* @returns {*}
*/var getSplitValueOnHover=function getSplitValueOnHover(setting,props){var sep=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;return isHoverMode()?getSplitValue(setting,props,sep):undefined;};/**
* Return the hover value of composite option.
*
* @param {string} field Field name.
* @param {string} option Composite option name.
* @param {object} props
* @returns {*}
*/var getCompositeValue=function getCompositeValue(field,option,props){return 1===__WEBPACK_IMPORTED_MODULE_0_lodash_get___default()(props,'hover_enabled')&&isEnabled(option,props)?get(getHoverField(field),props,get(field,props)):undefined;};/**
* Similar to `getCompositeValue`, but returns the value only when is hover mode.
*
* @param {string} field Field name.
* @param {string} option Composite option name.
* @param {object} props
* @returns {*}
*/var getCompositeValueOnHover=function getCompositeValueOnHover(field,option,props){return isHoverMode()?getCompositeValue(field,option,props):undefined;};var getCompositeFieldOnHover=function getCompositeFieldOnHover(field,option,props){return isHoverMode()&&isEnabled(option,props)?getHoverField(field):getFieldBaseName(field);};/**
* Generate hover fields based on current source fields.
*
* @since 3.24
*
* @param {object} fields Source fields object.
*
* @returns {object} Generated hover fields.
*/var getHoverFieldsDefinition=function getHoverFieldsDefinition(fields){// Ensure fields exist.
if(__WEBPACK_IMPORTED_MODULE_1_lodash_isEmpty___default()(fields)){return{};}var hoverFields={};__WEBPACK_IMPORTED_MODULE_2_lodash_forEach___default()(fields,function(field){// Create hover and hover enabled field if current field support Hover.
if(doesSupport(field)){var fieldName=__WEBPACK_IMPORTED_MODULE_0_lodash_get___default()(field,'name','');var hoverField=getHoverField(fieldName);var hoverEnabledField=getHoverEnabledField(fieldName);var defaultHoverField={tab_slug:get(field,'tab_slug',''),toggle_slug:get(field,'toggle_slug',''),type:'skip'};hoverFields[hoverField]=_objectSpread2(_objectSpread2({},defaultHoverField),{name:hoverField});hoverFields[hoverEnabledField]=_objectSpread2(_objectSpread2({},defaultHoverField),{name:hoverEnabledField});}});return hoverFields;};/* harmony default export */ __webpack_exports__["a"] = ({hoverSuffix:hoverSuffix,enabledSuffix:enabledSuffix,hasTabs:hasTabs,getFieldBaseName:getFieldBaseName,isEnabled:isEnabled,doesSupport:doesSupport,isHoverMode:isHoverMode,getHoverField:getHoverField,getHoverFieldOnHover:getHoverFieldOnHover,getHoverEnabledField:getHoverEnabledField,getValue:getValue,getValueOnHover:getValueOnHover,// setFieldHover,
getSplitValue:getSplitValue,getSplitValueOnHover:getSplitValueOnHover,getHoverOrNormal:getHoverOrNormal,getHoverOrNormalOnHover:getHoverOrNormalOnHover,getCompositeValue:getCompositeValue,getCompositeValueOnHover:getCompositeValueOnHover,getCompositeFieldOnHover:getCompositeFieldOnHover,getHoverFieldsDefinition:getHoverFieldsDefinition});
/***/ }),
/* 61 */
/*!***************************************!*\
!*** ./node_modules/lodash/_isKey.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var isArray = __webpack_require__(/*! ./isArray */ 0),
isSymbol = __webpack_require__(/*! ./isSymbol */ 20);
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @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);
}
module.exports = isKey;
/***/ }),
/* 62 */
/*!******************************************!*\
!*** ./node_modules/lodash/_MapCache.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ 174),
mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ 186),
mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ 188),
mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ 189),
mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ 190);
/**
* 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]);
}
} // Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/* 63 */
/*!******************************************!*\
!*** ./node_modules/lodash/_baseEach.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 64),
createBaseEach = __webpack_require__(/*! ./_createBaseEach */ 193);
/**
* 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);
module.exports = baseEach;
/***/ }),
/* 64 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseForOwn.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(/*! ./_baseFor */ 191),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* 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);
}
module.exports = baseForOwn;
/***/ }),
/* 65 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_castFunction.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 23);
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
module.exports = castFunction;
/***/ }),
/* 66 */
/*!***************************************!*\
!*** ./node_modules/lodash/_apply.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = apply;
/***/ }),
/* 67 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_LazyWrapper.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 43),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 68);
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
} // Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
module.exports = LazyWrapper;
/***/ }),
/* 68 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseLodash.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {// No operation performed.
}
module.exports = baseLodash;
/***/ }),
/* 69 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_getData.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var metaMap = __webpack_require__(/*! ./_metaMap */ 99),
noop = __webpack_require__(/*! ./noop */ 105);
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function (func) {
return metaMap.get(func);
};
module.exports = getData;
/***/ }),
/* 70 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_LodashWrapper.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 43),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 68);
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
module.exports = LodashWrapper;
/***/ }),
/* 71 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_setToString.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ 208),
shortOut = __webpack_require__(/*! ./_shortOut */ 108);
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
/***/ }),
/* 72 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_getHolder.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = func;
return object.placeholder;
}
module.exports = getHolder;
/***/ }),
/* 73 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseAssignValue.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(/*! ./_defineProperty */ 110);
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @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 baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ }),
/* 74 */
/*!***************************************!*\
!*** ./node_modules/lodash/_Stack.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 34),
stackClear = __webpack_require__(/*! ./_stackClear */ 215),
stackDelete = __webpack_require__(/*! ./_stackDelete */ 216),
stackGet = __webpack_require__(/*! ./_stackGet */ 217),
stackHas = __webpack_require__(/*! ./_stackHas */ 218),
stackSet = __webpack_require__(/*! ./_stackSet */ 219);
/**
* 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;
} // Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ }),
/* 75 */
/*!***************************************!*\
!*** ./node_modules/lodash/keysIn.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ 92),
baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ 221),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5);
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @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;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ }),
/* 76 */
/*!********************************************!*\
!*** ./node_modules/lodash/_getSymbols.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ 225),
stubArray = __webpack_require__(/*! ./stubArray */ 113);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* 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);
});
};
module.exports = getSymbols;
/***/ }),
/* 77 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_arrayPush.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayPush;
/***/ }),
/* 78 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_getPrototype.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 85);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 79 */
/*!**************************************************!*\
!*** ./node_modules/lodash/_cloneArrayBuffer.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ 118);
/**
* 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;
}
module.exports = cloneArrayBuffer;
/***/ }),
/* 80 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseIsEqual.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ 244),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/**
* 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);
}
module.exports = baseIsEqual;
/***/ }),
/* 81 */
/*!***********************************************!*\
!*** ./includes/fields/ValueMapper/style.css ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 82 */
/*!****************************************************!*\
!*** ./includes/fields/PositionAbsolute/style.css ***!
\****************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 83 */
/*!*************************!*\
!*** external "jQuery" ***!
\*************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
module.exports = jQuery;
/***/ }),
/* 84 */
/*!***************************!*\
!*** external "ReactDOM" ***!
\***************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
module.exports = ReactDOM;
/***/ }),
/* 85 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_overArg.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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));
};
}
module.exports = overArg;
/***/ }),
/* 86 */
/*!********************************************!*\
!*** ./node_modules/lodash/_freeGlobal.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/** Detect free variable `global` from Node.js. */
var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/global.js */ 87)))
/***/ }),
/* 87 */
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var g; // This works in non-strict mode
g = function () {
return this;
}();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1, eval)("this");
} catch (e) {
// This works if the window reference is available
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
} // g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 88 */
/*!******************************************!*\
!*** ./node_modules/lodash/_toSource.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* 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 '';
}
module.exports = toSource;
/***/ }),
/* 89 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_WeakMap.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11),
root = __webpack_require__(/*! ./_root */ 1);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/* 90 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_baseFindIndex.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index-- : ++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
/***/ }),
/* 91 */
/*!*****************************************!*\
!*** ./node_modules/lodash/toFinite.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(/*! ./toNumber */ 169);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = value < 0 ? -1 : 1;
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
/***/ }),
/* 92 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_arrayLikeKeys.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ 93),
isArguments = __webpack_require__(/*! ./isArguments */ 27),
isArray = __webpack_require__(/*! ./isArray */ 0),
isBuffer = __webpack_require__(/*! ./isBuffer */ 28),
isIndex = __webpack_require__(/*! ./_isIndex */ 22),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 54);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = arrayLikeKeys;
/***/ }),
/* 93 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseTimes.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = baseTimes;
/***/ }),
/* 94 */
/*!**************************************!*\
!*** ./node_modules/lodash/isNaN.js ***!
\**************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var isNumber = __webpack_require__(/*! ./isNumber */ 172);
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
module.exports = isNaN;
/***/ }),
/* 95 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_stringToPath.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ 173);
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function (string) {
var result = [];
if (string.charCodeAt(0) === 46
/* . */
) {
result.push('');
}
string.replace(rePropName, function (match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
});
return result;
});
module.exports = stringToPath;
/***/ }),
/* 96 */
/*!****************************************!*\
!*** ./node_modules/lodash/memoize.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ 62);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @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 != null && typeof resolver != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function memoized() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache)();
return memoized;
} // Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ }),
/* 97 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseToString.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15),
arrayMap = __webpack_require__(/*! ./_arrayMap */ 21),
isArray = __webpack_require__(/*! ./isArray */ 0),
isSymbol = __webpack_require__(/*! ./isSymbol */ 20);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* 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 (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
module.exports = baseToString;
/***/ }),
/* 98 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseSetData.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 23),
metaMap = __webpack_require__(/*! ./_metaMap */ 99);
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function (func, data) {
metaMap.set(func, data);
return func;
};
module.exports = baseSetData;
/***/ }),
/* 99 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_metaMap.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var WeakMap = __webpack_require__(/*! ./_WeakMap */ 89);
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap();
module.exports = metaMap;
/***/ }),
/* 100 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_createHybrid.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var composeArgs = __webpack_require__(/*! ./_composeArgs */ 101),
composeArgsRight = __webpack_require__(/*! ./_composeArgsRight */ 102),
countHolders = __webpack_require__(/*! ./_countHolders */ 202),
createCtor = __webpack_require__(/*! ./_createCtor */ 42),
createRecurry = __webpack_require__(/*! ./_createRecurry */ 103),
getHolder = __webpack_require__(/*! ./_getHolder */ 72),
reorder = __webpack_require__(/*! ./_reorder */ 212),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 45),
root = __webpack_require__(/*! ./_root */ 1);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_ARY_FLAG = 128,
WRAP_FLIP_FLAG = 512;
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
module.exports = createHybrid;
/***/ }),
/* 101 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_composeArgs.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
module.exports = composeArgs;
/***/ }),
/* 102 */
/*!**************************************************!*\
!*** ./node_modules/lodash/_composeArgsRight.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
module.exports = composeArgsRight;
/***/ }),
/* 103 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_createRecurry.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isLaziable = __webpack_require__(/*! ./_isLaziable */ 104),
setData = __webpack_require__(/*! ./_setData */ 107),
setWrapToString = __webpack_require__(/*! ./_setWrapToString */ 109);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
module.exports = createRecurry;
/***/ }),
/* 104 */
/*!********************************************!*\
!*** ./node_modules/lodash/_isLaziable.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 67),
getData = __webpack_require__(/*! ./_getData */ 69),
getFuncName = __webpack_require__(/*! ./_getFuncName */ 106),
lodash = __webpack_require__(/*! ./wrapperLodash */ 204);
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
module.exports = isLaziable;
/***/ }),
/* 105 */
/*!*************************************!*\
!*** ./node_modules/lodash/noop.js ***!
\*************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {// No operation performed.
}
module.exports = noop;
/***/ }),
/* 106 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_getFuncName.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var realNames = __webpack_require__(/*! ./_realNames */ 203);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = func.name + '',
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
module.exports = getFuncName;
/***/ }),
/* 107 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_setData.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseSetData = __webpack_require__(/*! ./_baseSetData */ 98),
shortOut = __webpack_require__(/*! ./_shortOut */ 108);
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
module.exports = setData;
/***/ }),
/* 108 */
/*!******************************************!*\
!*** ./node_modules/lodash/_shortOut.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function () {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
/***/ }),
/* 109 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_setWrapToString.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getWrapDetails = __webpack_require__(/*! ./_getWrapDetails */ 206),
insertWrapDetails = __webpack_require__(/*! ./_insertWrapDetails */ 207),
setToString = __webpack_require__(/*! ./_setToString */ 71),
updateWrapDetails = __webpack_require__(/*! ./_updateWrapDetails */ 210);
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = reference + '';
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
module.exports = setWrapToString;
/***/ }),
/* 110 */
/*!************************************************!*\
!*** ./node_modules/lodash/_defineProperty.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11);
var defineProperty = function () {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}();
module.exports = defineProperty;
/***/ }),
/* 111 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseAssign.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 13),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
/***/ }),
/* 112 */
/*!**************************************!*\
!*** ./node_modules/lodash/clone.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ 47);
/** Used to compose bitmasks for cloning. */
var CLONE_SYMBOLS_FLAG = 4;
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
module.exports = clone;
/***/ }),
/* 113 */
/*!******************************************!*\
!*** ./node_modules/lodash/stubArray.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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 [];
}
module.exports = stubArray;
/***/ }),
/* 114 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_getSymbolsIn.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 77),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 78),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 76),
stubArray = __webpack_require__(/*! ./stubArray */ 113);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ }),
/* 115 */
/*!********************************************!*\
!*** ./node_modules/lodash/_getAllKeys.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ 116),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 76),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* 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);
}
module.exports = getAllKeys;
/***/ }),
/* 116 */
/*!************************************************!*\
!*** ./node_modules/lodash/_baseGetAllKeys.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 77),
isArray = __webpack_require__(/*! ./isArray */ 0);
/**
* 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));
}
module.exports = baseGetAllKeys;
/***/ }),
/* 117 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_getAllKeysIn.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ 116),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ 114),
keysIn = __webpack_require__(/*! ./keysIn */ 75);
/**
* Creates an array of own and inherited 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 getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
/***/ }),
/* 118 */
/*!********************************************!*\
!*** ./node_modules/lodash/_Uint8Array.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 1);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/* 119 */
/*!**********************************************!*\
!*** ./node_modules/lodash/isPlainObject.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 78),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ }),
/* 120 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_equalArrays.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ 245),
arraySome = __webpack_require__(/*! ./_arraySome */ 248),
cacheHas = __webpack_require__(/*! ./_cacheHas */ 249);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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;
}
module.exports = equalArrays;
/***/ }),
/* 121 */
/*!****************************************************!*\
!*** ./node_modules/lodash/_isStrictComparable.js ***!
\****************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 2);
/**
* 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);
}
module.exports = isStrictComparable;
/***/ }),
/* 122 */
/*!*********************************************************!*\
!*** ./node_modules/lodash/_matchesStrictComparable.js ***!
\*********************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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));
};
}
module.exports = matchesStrictComparable;
/***/ }),
/* 123 */
/*!**************************************!*\
!*** ./node_modules/lodash/hasIn.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ 256),
hasPath = __webpack_require__(/*! ./_hasPath */ 124);
/**
* 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);
}
module.exports = hasIn;
/***/ }),
/* 124 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_hasPath.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 16),
isArguments = __webpack_require__(/*! ./isArguments */ 27),
isArray = __webpack_require__(/*! ./isArray */ 0),
isIndex = __webpack_require__(/*! ./_isIndex */ 22),
isLength = __webpack_require__(/*! ./isLength */ 53),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/**
* 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 = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ }),
/* 125 */
/*!******************************************!*\
!*** ./node_modules/lodash/_overRest.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 66);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @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.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? func.length - 1 : start, 0);
return function () {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
/***/ }),
/* 126 */
/*!****************************************!*\
!*** ./node_modules/lodash/isEqual.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 80);
/**
* 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);
}
module.exports = isEqual;
/***/ }),
/* 127 */
/*!*******************************************!*\
!*** ./node_modules/lodash/fp/compose.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./flowRight */ 269);
/***/ }),
/* 128 */
/*!************************************************************!*\
!*** ./includes/module_dependencies/hover-options-pure.js ***!
\************************************************************/
/*! exports provided: hoverSuffix, enabledSuffix, getFieldBaseName, getHoverField, getHoverEnabledField, isEnabled, default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export hoverSuffix */
/* unused harmony export enabledSuffix */
/* unused harmony export getFieldBaseName */
/* unused harmony export getHoverField */
/* unused harmony export getHoverEnabledField */
/* unused harmony export isEnabled */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isString__ = __webpack_require__(/*! lodash/isString */ 31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isString__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_get__);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*/var hover='__hover';var enabled='__hover_enabled';/**
* Returns the option suffix used for hover options.
*
* @returns {string}
*/var hoverSuffix=function hoverSuffix(){return hover;};/**
* Returns the option enabled suffix used for hover options.
*
* @returns {string}
*/var enabledSuffix=function enabledSuffix(){return enabled;};/**
* Gets the base name of the field without the "__hover" or "__hover_enabled" suffix.
*
* @param name
* @returns String.
*/var getFieldBaseName=function getFieldBaseName(name){return!__WEBPACK_IMPORTED_MODULE_0_lodash_isEmpty___default()(name)&&__WEBPACK_IMPORTED_MODULE_1_lodash_isString___default()(name)?name.split(hover).shift():name;};/**
* Returns field name suffixed with `__hover`.
*
* @param {string} field
* @returns {string}
*/var getHoverField=function getHoverField(field){return"".concat(getFieldBaseName(field)).concat(hover);};/**
* Returns field name suffixed with `__hover_enabled`.
*
* @param {string} field
* @returns {string}
*/var getHoverEnabledField=function getHoverEnabledField(field){return"".concat(getFieldBaseName(field)).concat(enabled);};/**
* Tells if the module option has hover options enabled.
*
* @param {string} setting
* @param {object} props
* @returns {boolean}
*/var isEnabled=function isEnabled(setting,props){return 0===__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(props,getHoverEnabledField(setting),'').indexOf('on');};/* harmony default export */ __webpack_exports__["a"] = ({isEnabled:isEnabled,hoverSuffix:hoverSuffix,enabledSuffix:enabledSuffix,getFieldBaseName:getFieldBaseName,getHoverField:getHoverField,getHoverEnabledField:getHoverEnabledField});
/***/ }),
/* 129 */
/*!*****************************************************************!*\
!*** ./includes/module_dependencies/responsive-options-pure.js ***!
\*****************************************************************/
/*! exports provided: responsiveDevices, isResponsiveEnabled, isValueAcceptable, isOrHasValue, hasMobileOptions, getResponsiveStatus, getDevicesList, getFieldName, getLastEditedFieldName, getFieldNames, getFieldBaseName, getDefaultValue, getDefaultDefinedValue, getValue, getAnyValue, getAnyDefinedValue, getNonEmpty, getPreviousDevice, default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export responsiveDevices */
/* unused harmony export isResponsiveEnabled */
/* unused harmony export isValueAcceptable */
/* unused harmony export isOrHasValue */
/* unused harmony export hasMobileOptions */
/* unused harmony export getResponsiveStatus */
/* unused harmony export getDevicesList */
/* unused harmony export getFieldName */
/* unused harmony export getLastEditedFieldName */
/* unused harmony export getFieldNames */
/* unused harmony export getFieldBaseName */
/* unused harmony export getDefaultValue */
/* unused harmony export getDefaultDefinedValue */
/* unused harmony export getValue */
/* unused harmony export getAnyValue */
/* unused harmony export getAnyDefinedValue */
/* unused harmony export getNonEmpty */
/* unused harmony export getPreviousDevice */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(/*! lodash */ 57);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pure__ = __webpack_require__(/*! ./pure */ 130);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ // External dependencies
// Internal dependencies
/**
* The list of supported devices for responsive.
*
* @since 3.26.7
*
* @type {string[]}
*/var _devices=['desktop','tablet','phone'];/**
* List of responsive devices exist.
*
* @since 3.26.7
*
* @returns {Array}
*/var responsiveDevices=function responsiveDevices(){return _devices;};/**
* Check if responsive settings is enabled or not on the option.
*
* @since 3.26.7
*
* @param {object} attrs All module attributes.
* @param {string} name Option name.
*
* @returns {boolean} Responsive settings status.
*/var isResponsiveEnabled=function isResponsiveEnabled(){var attrs=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var name=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var lastEdited=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,"".concat(name,"_last_edited"),'');return getResponsiveStatus(lastEdited);};/**
* Check if current value is acceptable or not. Why we don't use simple if (value) to check
* acceptability? Because we may save 0 value for the option, and even empty string or false.
*
* @since 3.26.7
*
* @param {string} value Check if current.
* @returns {boolean} Value acceptability status.
*/var isValueAcceptable=__WEBPACK_IMPORTED_MODULE_1__pure__["g" /* hasValue */];/**
* Check if a field's selected value is OR has a value
* If responsive is active, field returns array of desktop, tablet and phone values.
*
* @since 4.6.0
*
* @param {string|object} fieldValue The field's value; if string, responsive mode isn't active.
* @param {string} value Value to be compared / contained.
*
* @returns {bool}
*/var isOrHasValue=function isOrHasValue(fieldValue,value){var isResponsive=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isObject"])(fieldValue);return isResponsive?Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(fieldValue,value):value===fieldValue;};/**
* Check if current option has mobile_options and it's not false.
*
* @since 3.26.7
*
* @param {object} props Option props.
* @returns {boolean} Mobile options prop status.
*/var hasMobileOptions=function hasMobileOptions(props){return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(props,'mobile_options',false);};/**
* Check responsive value existence of responsive inputs (text/range/text margin) by passing its
* *_last_edited value.
*
* Copy of Utils.getResponsiveStatus(). Moved here to organize the code.
*
* @since 3.26.7
*
* @param {string} _last_edited Saved *_last_edited attribute.
*
* @returns {boolean}
*/var getResponsiveStatus=function getResponsiveStatus(_last_edited){var lastEdited=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(_last_edited)?_last_edited.split('|'):['off','desktop'];return!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isUndefined"])(lastEdited[0])?'on'===lastEdited[0]:false;};/**
* Get list of all or selected devices.
*
* Default devices are desktop, tablet, and phone. Just in case we want to extend it, we have to
* edit variable defaultDevices.
*
* @since 3.26.7
*
* @param {Array | string} ignoredDevices Ignored devices. Can be string or array to pass multiple devices.
*
* @returns {Array} Selected devices.
*/var getDevicesList=function getDevicesList(){var ignoredDevices=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var defaultDevices=_devices.concat();// Remove specific ignored devices if needed.
if(!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(ignoredDevices)){if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(ignoredDevices)){ignoredDevices=[ignoredDevices];}Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["remove"])(defaultDevices,function(device){return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(ignoredDevices,device);});}return defaultDevices;};/**
* Returns the field responsive name by adding the `_tablet` or `_phone` suffix if it exists.
*
* @since 3.26.7
*
* @param {string} name Setting name.
* @param {string} device Device name.
*
* @returns {string} Responsive setting name.
*/var getFieldName=function getFieldName(name){var device=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'desktop';// Field name should be string and not empty.
if(!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)){return name;}// Ensure device is not empty.
device=''===device?'desktop':device;// Get device name.
return'desktop'!==device?"".concat(name,"_").concat(device):name;};/**
* Return last edited field name. It contains the field name with last_edited suffix.
*
* @since 4.0
*
* @param {string} name Field name.
* @returns {string} Last edited field name.
*/var getLastEditedFieldName=function getLastEditedFieldName(name){return"".concat(name,"_last_edited");};/**
* Return all fields name with responsive suffix.
*
* @since 4.0
*
* @param {string} name
* @param {boolean} needBaseName
* @param {boolean} needLastEdited
* @returns {Array}
*/var getFieldNames=function getFieldNames(name){var needBaseName=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var needLastEdited=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var fields=[name,getFieldName(name,'tablet'),getFieldName(name,'phone'),getLastEditedFieldName(name)];// Remove the base name if needed.
if(!needBaseName){fields.shift();}// Remove the last edited name if needed.
if(!needLastEdited){fields.pop();}return fields;};/**
* Returns the field original name by removing the `_tablet` or `_phone` suffix if it exists.
*
* Only remove desktop/tablet/phone string of the last setting name. Doesn't work for other format.
*
* @since 3.26.7
*
* @param {string} name Setting name.
*
* @returns {string} Base setting name.
*/var getFieldBaseName=function getFieldBaseName(name){// Field name should be string and not empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return name;}// Ensure namePieces length is enough. If only one, just return current setting name.
var namePieces=name.split('_');if(namePieces.length<=1){return name;}var initialPieces=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["initial"])(namePieces);var lastName=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["last"])(namePieces);var isSuffixExist=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(getDevicesList(),lastName);// Ensure suffix added previously.
if(!isSuffixExist){return name;}// Get device name.
return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["join"])(initialPieces,'_');};/**
* Get previous device value based on responsive mode. It will be useful to compare current device
* value with the previous one or default one. Mechanism:
* - Desktop : Default
* - Tablet : Desktop -> Default
* - Phone : Tablet -> Desktop -> Default.
*
* @since 3.23
*
* @param {object} attrs All module attributes.
* @param {string} name Field option name.
* @param {string} desktopDefault Desktop default value.
*
* @returns {string} Previous device value.
*/var getDefaultValue=function getDefaultValue(attrs,name){var desktopDefault=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';// Module attributes and field name should not be empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(attrs)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return'';}// Get device name.
var namePieces=name.split('_');var device=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(getDevicesList(),Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["last"])(namePieces))?Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["last"])(namePieces):'desktop';var baseName='desktop'!==device?name.replace("_".concat(device),''):name;// Get desktop default and return it if needed.
if('desktop'===device){return desktopDefault;}// Get tablet default and return it if needed.
var tabletDefault=getNonEmpty(attrs,baseName,desktopDefault);if('tablet'===device){return tabletDefault;}// Get phone default and return it if needed.
var phoneDefault=getNonEmpty(attrs,"".concat(baseName,"_tablet"),tabletDefault);if('phone'===device){return phoneDefault;}return desktopDefault;};/**
* Get previous device value based on responsive mode. Little bit different with getDefaultValue()
* because this function will return previous attribute exist on attrs list even it's empty string.
*
* @since 3.24.1
*
* @param {object} attrs All module attributes.
* @param {string} name Field option name.
* @param {string} desktopDefault Desktop default value.
*
* @returns {string} Previous device value.
*/var getDefaultDefinedValue=function getDefaultDefinedValue(attrs,name){var desktopDefault=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';// Module attributes and field name should not be empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(attrs)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return'';}// Get device name.
var namePieces=name.split('_');var device=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(getDevicesList(),Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["last"])(namePieces))?Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["last"])(namePieces):'desktop';var baseName='desktop'!==device?name.replace("_".concat(device),''):name;// Get desktop default and return it if needed.
if('desktop'===device){return desktopDefault;}// Get tablet default and return it if needed.
var tabletDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,baseName,desktopDefault);if('tablet'===device){return tabletDefault;}// Get phone default and return it if needed.
var phoneDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,"".concat(baseName,"_tablet"),tabletDefault);if('phone'===device){return phoneDefault;}return desktopDefault;};/**
* Get responsive value based on field base name and device.
*
* NOTE: Function getValue() is different with getAnyValue(). It will return only current
* field value without checking the previous device value.
*
* For example: We have Title Text Font Size -> desktop 30px, tablet 20px, phone 10px. When
* we fetch the value for phone, it will return pure 10px or default value given
* without compare it with tablet or even desktop values.
*
* To get tablet or phone value:
* 1. You can pass only field base name and device name as the 4th argument. The parameters
* structure it's made like that to make it similar with other get* method we already have.
* For example: getValue(attrs, 'title_text_font_size', '', 'tablet').
*
* 2. Or you can pass the actual field name with device. If the field name is already contains
* _tablet and _phone, don't pass device parameter because it will be added as suffix.
* For example: getValue(attrs, 'title_text_font_size_tablet', '').
*
* @since 3.23
*
* @param {object} attrs All module attributes.
* @param {string} name Field option name.
* @param {string} defaultVal Default value.
* @param {string} device Current active device.
*
* @returns {string} Current device value.
*/var getValue=function getValue(attrs,name){var defaultVal=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var device=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'desktop';// Ensure device is not empty.
device=''===device?'desktop':device;// Module attributes and field name should not be empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(attrs)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return defaultVal;}// Ensure always use device as suffix if device is not desktop/empty.
if('desktop'!==device){name="".concat(getFieldBaseName(name),"_").concat(device);}// Get current value.
return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name,defaultVal);};/**
* Get current active device value from attributes.
*
* NOTE: Function getAnyValue() is different with getValue(). It also compare the value with the
* previous device value to avoid duplication. Or you can also force to return either
* current or previous default value if needed.
*
* For example: We have Title Text Font Size -> desktop 30px, tablet 30px, phone 10px. When
* we fetch the value for tablet, it will return pure empty as default because
* tablet value is equal with desktop value.
*
* We have Title Text Font Size -> desktop 30px, tablet '', phone ''. When
* we fetch the value for phone and force it to return any value, it will
* return 30px because phone and tablet value is empty and the function will
* look up to tablet or even desktop value.
*
* To get tablet or phone value:
* 1. You can pass only field base name and device name as the 5th argument. The parameters
* structure it's made like that to make it similar with other get* method we already have.
* For example: getAnyValue(attrs, 'title_text_font_size', '', false, 'tablet').
*
* 2. Or you can pass the actual field name with device. If the field name is already contains
* _tablet and _phone, don't pass device parameter because it will be added as suffix.
* For example: getAnyValue( attrs, 'title_text_font_size_tablet', '' ).
*
* 3. You can also force to return any value by passing true on the 5th argument. In some cases
* we need this to fill missing tablet/phone value with desktop value.
*
* @since 3.23
*
* @param {object} attrs All module attributes.
* @param {string} name Field option name.
* @param {string} desktopDefault Desktop default value.
* @param {boolean} forceReturn Return current or default value.
* @param {string} device Device name.
*
* @returns {string} Current device value.
*/var getAnyValue=function getAnyValue(attrs,name){var desktopDefault=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var forceReturn=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var device=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'desktop';// Ensure device is not empty.
device=''===device?'desktop':device;// Module attributes and field name should not be empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(attrs)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return'';}// Ensure always use device as suffix if device is not desktop/empty.
if('desktop'!==device){name="".concat(getFieldBaseName(name),"_").concat(device);}// Get current value.
var value=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name,'');// Get previous value to be compared.
var prevValue=getDefaultValue(attrs,name,desktopDefault);// Force to return current or default value if needed.
if(forceReturn){return isValueAcceptable(value)&&''!==value?value:prevValue;}// Ensure current value is different with the previous device or default value.
if(value===prevValue){return'';}return value;};/**
* Get current active device value from attributes.
*
* NOTE: Function getAnyDefinedValue() is little bit different with getAnyValue(). It has similar
* basic function except will return any value exist in attrs even it's empty.
*
* @since 3.24.1
*
* @param {object} attrs All module attributes.
* @param {string} name Field option name.
* @param {string} desktopDefault Desktop default value.
* @param {boolean} forceReturn Return current or default value.
* @param {string} device Device name.
*
* @returns {string} Current device value.
*/var getAnyDefinedValue=function getAnyDefinedValue(attrs,name){var desktopDefault=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var forceReturn=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var device=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'desktop';// Ensure device is not empty.
device=''===device?'desktop':device;// Module attributes and field name should not be empty.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(attrs)||Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(name)||!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isString"])(name)){return'';}// Ensure always use device as suffix if device is not desktop/empty.
if('desktop'!==device){name="".concat(getFieldBaseName(name),"_").concat(device);}// Get current value.
var value=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name);// Return previous value as backup.
var prevValue=getDefaultDefinedValue(attrs,name,desktopDefault);// Force to return current or default value if needed.
if(forceReturn){return!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isUndefined"])(value)?value:prevValue;}// Ensure current value is different with the previous device or default value.
if(value===prevValue){return'';}return value;};/**
* Get non empty value.
*
* Basically, Lodash get() only return default value if it doesn't exist. However, in some cases
* we need to return the default value when the current value is empty. This function still return
* empty value if default value is empty. But at least, it can avoid to return empty value from
* the original attribute value.
*
* @since 3.23
*
* @param {object} attrs Attributes list.
* @param {string} name Attribute name.
* @param {string} defaultValue Default value to return.
*
* @returns {string} Non empty value.
*/var getNonEmpty=function getNonEmpty(attrs,name){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var value=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name,defaultValue);return!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(value)?value:defaultValue;};/**
* Returns the previous device name for the given device.
* The function returns `undefined` for the unknown device names.
*
* NOTE: The previous device name for the `Desktop` is empty string.
*
* For example: `Phone` -> `Tablet`
* `Tablet` -> `Desktop`
* `Desktop` -> ``.
*
* @since 3.26
*
* @param {string} device - The device name.
*
* @returns {string | undefined} - The device name which is previous for the given device.
*/var getPreviousDevice=function getPreviousDevice(device){var normalizedName=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["lowerCase"])(device);if(!Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["includes"])(_devices,normalizedName)){return undefined;}if('desktop'===normalizedName){return'';}var index=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["indexOf"])(_devices,normalizedName);return _devices[index-1];};/* harmony default export */ __webpack_exports__["a"] = ({responsiveDevices:responsiveDevices,isResponsiveEnabled:isResponsiveEnabled,isValueAcceptable:isValueAcceptable,isOrHasValue:isOrHasValue,hasMobileOptions:hasMobileOptions,getResponsiveStatus:getResponsiveStatus,getDevicesList:getDevicesList,getFieldName:getFieldName,getFieldNames:getFieldNames,getLastEditedFieldName:getLastEditedFieldName,getFieldBaseName:getFieldBaseName,getValue:getValue,getAnyValue:getAnyValue,getAnyDefinedValue:getAnyDefinedValue,getDefaultDefinedValue:getDefaultDefinedValue,getNonEmpty:getNonEmpty,getDefaultValue:getDefaultValue,getPreviousDevice:getPreviousDevice});
/***/ }),
/* 130 */
/*!**********************************************!*\
!*** ./includes/module_dependencies/pure.js ***!
\**********************************************/
/*! exports provided: hasValue, get, isJson, isValidHtml, isOn, isOff, isOnOff, toOnOff, isYes, isNo, isDefault, isFileExtension, generatePlaceholderCss, replaceCodeContentEntities, hasNumericValue, removeFancyQuotes, getCorners, getCorner, getSpacing, toString, prop, set, isRealMobileDevice, getPercentage */
/*! exports used: generatePlaceholderCss, get, getCorner, getCorners, getSpacing, hasNumericValue, hasValue, isDefault, isFileExtension, isJson, isNo, isOff, isOn, isOnOff, isValidHtml, isYes, removeFancyQuotes, replaceCodeContentEntities */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return hasValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return get; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return isJson; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isValidHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isOn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isOff; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isOnOff; });
/* unused harmony export toOnOff */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isYes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isNo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isDefault; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return isFileExtension; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generatePlaceholderCss; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return replaceCodeContentEntities; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return hasNumericValue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return removeFancyQuotes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getCorners; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getCorner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getSpacing; });
/* unused harmony export toString */
/* unused harmony export prop */
/* unused harmony export set */
/* unused harmony export isRealMobileDevice */
/* unused harmony export getPercentage */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject__ = __webpack_require__(/*! lodash/isObject */ 2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_isObject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_head__ = __webpack_require__(/*! lodash/head */ 131);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_head___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_head__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_last__ = __webpack_require__(/*! lodash/last */ 49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_last__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_forEach__ = __webpack_require__(/*! lodash/forEach */ 38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_forEach___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_forEach__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isArray__ = __webpack_require__(/*! lodash/isArray */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isArray__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_toString__ = __webpack_require__(/*! lodash/toString */ 17);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_toString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_toString__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isNaN__ = __webpack_require__(/*! lodash/isNaN */ 94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_isNaN__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_findIndex__ = __webpack_require__(/*! lodash/findIndex */ 132);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_findIndex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_findIndex__);
function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ /* =========================================================================================================== */ /* This module contains only pure utility functions. */ /* By this any functions that read or update some global state are forbidden. */ /* =========================================================================================================== */ // External dependencies
/**
* Check whether given value can be printed or not (string). Originally a simpler way to check
* against empty string, but later several checks were added as well to avoid unnecessary repetition.
*
* A value considered empty if:
* - is an empty string
* - is undefined
* - is false.
*
* @since 4.3
*
* @param {*} value
* @returns {boolean}
*/var hasValue=function hasValue(value){return''!==value&&undefined!==value&&value!==false&&!__WEBPACK_IMPORTED_MODULE_7_lodash_isNaN___default()(value);};/**
* Return given value or its default if current value returns false against hasValue()
* Mainly used to return default if given value is empty string.
*
* @since 4.3
*
* @param {*} value
* @param {*} defaultValue Value that will be return if value fails hasValue().
*
* @returns {*} Value|default.
*/var get=function get(value,defaultValue){return hasValue(value)?value:defaultValue;};/**
* Test if provided string is a valid JSON.
*
* @since 4.3
*
* @param {string} string
* @returns {boolean}
*/var isJson=function isJson(string){try{return __WEBPACK_IMPORTED_MODULE_0_lodash_isObject___default()(JSON.parse(string));}catch(e){return false;}};/**
* Test if provided string is a valid HTML string.
*
* @since 4.3
*
* @param {string} html
* @returns {boolean}
*/var isValidHtml=function isValidHtml(html){var selfClosingTags=['area','base','br','col','embed','hr','img','input','link','menuitem','meta','param','source','track','wbr','!--'].join('|');var selfClosingRegex=new RegExp("<(".concat(selfClosingTags,").*?>"),'gi');// Remove all self closing tags
var cleanedHtml=html.replace(selfClosingRegex,'');// Get remaining opening tags
var openingTags=cleanedHtml.match(/<[^\/].*?>/g)||[];// Get remaining closing tags
var closingTags=cleanedHtml.match(/<\/.+?>/g)||[];return openingTags.length===closingTags.length;};/**
* Check if parameter value equals to `on`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isOn=function isOn(value){return'on'===value;};/**
* Check if parameter value equals to `off`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isOff=function isOff(value){return'off'===value;};/**
* Check if parameter value equals to `on` or `off`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isOnOff=function isOnOff(value){return'on'===value||'off'===value;};/**
* Converts the given value to "on/off" notation.
*
* @param {boolean} value
*
* @returns {string}
*/var toOnOff=function toOnOff(value){return value?'on':'off';};/**
* Check if parameter value equals to `yes`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isYes=function isYes(value){return'yes'===value;};/**
* Check if parameter value equals to `no`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isNo=function isNo(value){return'no'===value;};/**
* Check if parameter value equals to `default`.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var isDefault=function isDefault(value){return'default'===value;};/**
* Check if provided url or path point to a file with specific extension.
*
* @since 4.3
*
* @param {string} url
* @param {string} extension
* @returns {boolean}
*/var isFileExtension=function isFileExtension(url,extension){return extension===__WEBPACK_IMPORTED_MODULE_1_lodash_head___default()(__WEBPACK_IMPORTED_MODULE_2_lodash_last___default()(url.split('.')).split('?'));};/**
* Generates CSS input placeholders styles for provided selectors.
*
* @since 4.3
*
* @param {Array} selectors
* @param {string} declaration
* @returns {Array}
*/var generatePlaceholderCss=function generatePlaceholderCss(selectors,declaration){var suffixes=['::-webkit-input-placeholder',':-moz-placeholder','::-moz-placeholder',':-ms-input-placeholder'];var processedCSS=[];if(!__WEBPACK_IMPORTED_MODULE_5_lodash_isEmpty___default()(selectors)&&__WEBPACK_IMPORTED_MODULE_4_lodash_isArray___default()(selectors)){__WEBPACK_IMPORTED_MODULE_3_lodash_forEach___default()(selectors,function(selector){__WEBPACK_IMPORTED_MODULE_3_lodash_forEach___default()(suffixes,function(suffix){processedCSS.push({selector:selector+suffix,declaration:declaration});});});}return processedCSS;};/**
* Replace string entities to their character representation.
*
* @since 4.3
*
* @param {string} content
* @returns {string}
*/var replaceCodeContentEntities=function replaceCodeContentEntities(content){content=__WEBPACK_IMPORTED_MODULE_6_lodash_toString___default()(content);if('string'===typeof content){content=content.replace(/'/g,'\'');content=content.replace(/[/g,'[');content=content.replace(/]/g,']');content=content.replace(/×/g,'x');}return content;};/**
* Check if the string is a numeric value
* Numeric values are strings that contain a numeric value or starts with a numeric value.
*
* @since 4.3
*
* @param {string} value
* @returns {boolean}
*/var hasNumericValue=function hasNumericValue(value){return''!==value&&undefined!==value&&!__WEBPACK_IMPORTED_MODULE_7_lodash_isNaN___default()(parseInt(value));};/**
* Replace `”`&`″` characters HTML entities that is similar to the actual builder output's counterpart.
*
* @since 4.3
*
* @param {string} string
* @returns {string}
*/var removeFancyQuotes=function removeFancyQuotes(string){string=__WEBPACK_IMPORTED_MODULE_6_lodash_toString___default()(string);if('string'===typeof string){string=string.replace(/”/g,'').replace(/″/g,'');}return string;};/**
* Returns allowed corners names list.
*
* @since 4.3
*
* @returns {string[]}
*/var getCorners=function getCorners(){return['top','right','bottom','left'];};/**
* Return specific corner name by index.
*
* @since 4.3
*
* @param {number} index
* @returns {string}
*/var getCorner=function getCorner(index){return getCorners()[index];};/**
* Returns spacing value by provided corner.
*
* @since 4.3
*
* @param {string} spacing
* @param {string} corner
* @param {*} defaultValue
* @returns {string|*}
*/var getSpacing=function getSpacing(spacing,corner){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'0px';if(!hasValue(spacing)){return defaultValue;}var corners=getCorners();var cornerIndex=__WEBPACK_IMPORTED_MODULE_8_lodash_findIndex___default()(corners,function(corner_item){return corner_item===corner;});var spacingArray=__WEBPACK_IMPORTED_MODULE_6_lodash_toString___default()(spacing).split('|');return hasValue(spacingArray[cornerIndex])?spacingArray[cornerIndex]:defaultValue;};/**
* Converts a value to string by checking if the value is a valid value using `hasValue`
* If value doesn't pass the check, return empty string.
*
* @since 4.3
*
* @param value
* @returns {string}
*/var toString=function toString(value){return hasValue(value)?__WEBPACK_IMPORTED_MODULE_6_lodash_toString___default()(value):'';};/**
* Return the object property value, in case the value does not satisfy empty validation,
* return the defaultValue.
*
* @since 4.3
*
* @param {*} defaultValue
* @param {string} prop
* @param {object} object
* @returns {*}
*/var prop=function prop(defaultValue,_prop,object){return object&&get(object[_prop],defaultValue)||defaultValue;};/**
* Sets object property with provided value.
*
* @since 4.3
*
* @param {string} prop
* @param {*} value
* @param {object} object
* @returns {object}
*/var set=function set(prop,value,object){return _objectSpread2(_objectSpread2({},object||{}),{},_defineProperty({},prop,value));};function isRealMobileDevice(){return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);}/**
* Get percentage of given value.
*
* @since 4.6.0
*
* @param {number} value
* @param {number|string} percentage
*
* @returns {number}
*/var getPercentage=function getPercentage(value,percentage){return value/100*parseFloat(percentage);};
/***/ }),
/* 131 */
/*!*************************************!*\
!*** ./node_modules/lodash/head.js ***!
\*************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return array && array.length ? array[0] : undefined;
}
module.exports = head;
/***/ }),
/* 132 */
/*!******************************************!*\
!*** ./node_modules/lodash/findIndex.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ 90),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18),
toInteger = __webpack_require__(/*! ./toInteger */ 7);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ }),
/* 133 */
/*!************************************************!*\
!*** ./node_modules/lodash/_createAssigner.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ 134),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 135);
/**
* 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;
});
}
module.exports = createAssigner;
/***/ }),
/* 134 */
/*!******************************************!*\
!*** ./node_modules/lodash/_baseRest.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 23),
overRest = __webpack_require__(/*! ./_overRest */ 125),
setToString = __webpack_require__(/*! ./_setToString */ 71);
/**
* 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) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
/***/ }),
/* 135 */
/*!************************************************!*\
!*** ./node_modules/lodash/_isIterateeCall.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var eq = __webpack_require__(/*! ./eq */ 36),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5),
isIndex = __webpack_require__(/*! ./_isIndex */ 22),
isObject = __webpack_require__(/*! ./isObject */ 2);
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = _typeof(index);
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ }),
/* 136 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseSlice.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : length + start;
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : end - start >>> 0;
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
module.exports = baseSlice;
/***/ }),
/* 137 */
/*!************************************************************!*\
!*** ./includes/module_dependencies/et-builder-offsets.js ***!
\************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_assignIn__ = __webpack_require__(/*! lodash/assignIn */ 313);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_assignIn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_assignIn__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(/*! ./utils */ 25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__et_builder_offsets_const__ = __webpack_require__(/*! ./et-builder-offsets-const */ 314);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*/// Internal dependencies.
var isBFB=__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].condition('is_bfb');var isTB=__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].isTB();var adminBarHeight=__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].getAdminBarHeight();var ETBuilderOffsets=__WEBPACK_IMPORTED_MODULE_0_lodash_assignIn___default()(__WEBPACK_IMPORTED_MODULE_2__et_builder_offsets_const__["a" /* default */],{topbar:{desktop:adminBarHeight,mobile:isTB?0:46},tooltipModal:{top:isBFB?5:isTB?44:adminBarHeight+30,bottom:isBFB?117:100}});/* harmony default export */ __webpack_exports__["a"] = (ETBuilderOffsets);
/***/ }),
/* 138 */,
/* 139 */
/*!********************************************************!*\
!*** multi ./config/polyfills.js ./includes/loader.js ***!
\********************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! /Users/annamini/Local Sites/photographylicensetest/app/public/wp-content/plugins/projects/testify/config/polyfills.js */140);
module.exports = __webpack_require__(/*! /Users/annamini/Local Sites/photographylicensetest/app/public/wp-content/plugins/projects/testify/includes/loader.js */141);
/***/ }),
/* 140 */
/*!*****************************!*\
!*** ./config/polyfills.js ***!
\*****************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*if (typeof Promise === 'undefined') {
// Rejection tracking prevents a common issue where React gets into an
// inconsistent state due to an error, but it gets swallowed by a Promise,
// and the user has no idea what causes React's erratic future behavior.
require('promise/lib/rejection-tracking').enable();
window.Promise = require('promise/lib/es6-extensions.js');
}*/
// fetch() polyfill for making API calls.
// require('whatwg-fetch');
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
// Object.assign = require('object-assign');
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if (false) {
require('raf').polyfill(global);
}
/***/ }),
/* 141 */
/*!****************************!*\
!*** ./includes/loader.js ***!
\****************************/
/*! no exports provided */
/*! all exports used */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(/*! jquery */ 83);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__modules__ = __webpack_require__(/*! ./modules */ 142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__fields__ = __webpack_require__(/*! ./fields */ 316);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*/ // External Dependencies
// Internal Dependencies
__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).on('et_builder_api_ready',function(event,API){// woocommerce-carousel-for-divi\includes\modules\WoocommerceCarousel\WoocommerceCarousel.jsx
if(window.ETBuilderBackend&&window.ETBuilderBackend.defaults&&window.TestifyCarouselBackend&&window.TestifyCarouselBackend.defaultContent){window.ETBuilderBackend.defaults.testify_carousel={content:window.TestifyCarouselBackend.defaultContent};}API.registerModules(__WEBPACK_IMPORTED_MODULE_1__modules__["a" /* default */]);API.registerModalFields(__WEBPACK_IMPORTED_MODULE_2__fields__["a" /* default */]);});
/***/ }),
/* 142 */
/*!***********************************!*\
!*** ./includes/modules/index.js ***!
\***********************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Testify_Testify__ = __webpack_require__(/*! ./Testify/Testify */ 143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__TestifyCarouselParent_TestifyCarouselParent__ = __webpack_require__(/*! ./TestifyCarouselParent/TestifyCarouselParent */ 144);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__TestifyCarouselChild_TestifyCarouselChild__ = __webpack_require__(/*! ./TestifyCarouselChild/TestifyCarouselChild */ 315);
/* harmony default export */ __webpack_exports__["a"] = ([__WEBPACK_IMPORTED_MODULE_0__Testify_Testify__["a" /* default */],__WEBPACK_IMPORTED_MODULE_1__TestifyCarouselParent_TestifyCarouselParent__["a" /* default */],__WEBPACK_IMPORTED_MODULE_2__TestifyCarouselChild_TestifyCarouselChild__["a" /* default */]]);
/***/ }),
/* 143 */
/*!**********************************************!*\
!*** ./includes/modules/Testify/Testify.jsx ***!
\**********************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom__ = __webpack_require__(/*! react-dom */ 84);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_dom__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__style_css__ = __webpack_require__(/*! ./style.css */ 50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__style_css__);
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}// External Dependencies
// Internal Dependencies
var _loadModuleHtml=function _loadModuleHtml(passedState,passedProps){return new Promise(function(resolve,reject){//console.log('async Promise function called');
var currentProps=passedState.moduleProps;var propsObj={};for(var key in currentProps){var value=currentProps[key];if(key!=='__display'&&_typeof(value)!=='object'&&typeof value!=='function'){propsObj[key]=value;}}var propsObjJson=JSON.stringify(propsObj);var body=new FormData();body.append('action','testify_refresh_vb');body.append('post_id',window.ETBuilderBackend.postId);body.append('props',propsObjJson);fetch(window.et_fb_options.ajaxurl,{body:body,method:'POST'}).then(function(res){return res.json();}).then(function(result){resolve(result);},function(error){reject(error);});});};var TestifyComponent=/*#__PURE__*/function(_Component){_inherits(TestifyComponent,_Component);function TestifyComponent(){var _ref;var _temp,_this;_classCallCheck(this,TestifyComponent);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _possibleConstructorReturn(_this,(_temp=_this=_possibleConstructorReturn(this,(_ref=TestifyComponent.__proto__||Object.getPrototypeOf(TestifyComponent)).call.apply(_ref,[this].concat(args))),Object.defineProperty(_assertThisInitialized(_this),"state",{configurable:true,enumerable:true,writable:true,value:{error:null,updatedDisplay:null,moduleProps:null,loadingInProgress:null,needNewAjax:null,commitPending:null}}),_temp));}_createClass(TestifyComponent,[{key:"shouldComponentUpdate",value:function shouldComponentUpdate(nextProps,nextState){// console.log('shouldComponentUpdate called and heres nextState:');
// console.log(nextState);
if(nextState.commitPending===true||nextState.needNewAjax===true){return true;}else{return false;}}},{key:"render",value:function render(){// console.log('Render and here is the state:');
// console.log(this.state);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.updatedDisplay}});}},{key:"componentDidMount",value:function componentDidMount(prevProps,prevState,snapshot){// console.log('ComponentDidMount called');
this.startAsync();}// Called after the module has been re-rendered after an update
},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(this.state.needNewAjax===true){this.startAsync();}// Re-initialize the slider
var node=Object(__WEBPACK_IMPORTED_MODULE_1_react_dom__["findDOMNode"])(this);if(node.childNodes[0]!==undefined&&node.childNodes[0]!==null){var childNode=node;var testifyId=childNode.childNodes[1].getAttribute('data-testify-id');var testifyNavtype=childNode.childNodes[1].getAttribute('data-testify-navtype');var testifyResponsiveCss=JSON.parse(childNode.childNodes[1].getAttribute('data-testify-responsive-css'));var testifyAtts=JSON.parse(childNode.childNodes[1].getAttribute('data-testify-atts'));var testifyOptionsDefaults=JSON.parse(childNode.childNodes[1].getAttribute('data-testify-options-defaults'));var testifyCss=JSON.parse(childNode.childNodes[1].getAttribute('data-testify-css'));window.testifyInitializeSlider(testifyId,testifyNavtype,testifyResponsiveCss,testifyAtts,testifyOptionsDefaults,testifyCss);}this.setState({commitPending:false});}},{key:"startAsync",value:function startAsync(){var _this2=this;// console.log('startAsync called');
this.setState({loadingInProgress:true,needNewAjax:false});_loadModuleHtml(this.state,this.props).then(function(result){// console.log('Async finished');
_this2.setState({loadingInProgress:false,updatedDisplay:result,commitPending:true});});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){if(prevState.moduleProps==null){// This is the first run, so no state comparisons are required
return{moduleProps:nextProps};}else{// Comparing previous and next prop values and returning True if old and new props are not equal, meaning an update is needed
var prevPropsValues=prevState.moduleProps;var nextPropsValues=nextProps;var rerenderRequired=false;for(var i in nextPropsValues){if(prevPropsValues[i]!==nextPropsValues[i]&&(_typeof(prevPropsValues[i])!=='object'||i=='include_categories'||i=='include_tags')&&i!='_builder_version'&&i!='content'&&i.substr(0,5)!='body_'&&i.substr(0,5)!='name_'&&(i.substr(0,9)!='readmore_'||i=='readmore_limit'||i=='readmore_morelink'||i=='readmore_lesslink'||i=='readmore_use_icon'||i=='readmore_icon_et'||i=='readmore_icon_color'||i=='readmore_icon_placement'||i=='readmore_less_icon_et'||i=='readmore_less_icon_color'||i=='readmore_less_icon_placement')){rerenderRequired=true;}}if(!rerenderRequired){// No state update necessary
return{needNewAjax:false};}else{// Return updated state with the new props
return{moduleProps:nextProps,needNewAjax:true};}}}}]);return TestifyComponent;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);Object.defineProperty(TestifyComponent,"slug",{configurable:true,enumerable:true,writable:true,value:'et_pb_testify'});/* harmony default export */ __webpack_exports__["a"] = (TestifyComponent);
/***/ }),
/* 144 */
/*!**************************************************************************!*\
!*** ./includes/modules/TestifyCarouselParent/TestifyCarouselParent.jsx ***!
\**************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_id_swiper__ = __webpack_require__(/*! react-id-swiper */ 145);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_id_swiper___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_id_swiper__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_ajax__ = __webpack_require__(/*! ./components/ajax */ 165);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__module_dependencies_background__ = __webpack_require__(/*! ../../module_dependencies/background */ 166);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__ = __webpack_require__(/*! ../../module_dependencies/styles */ 272);
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _get(object,property,receiver){if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null){return undefined;}else{return _get(parent,property,receiver);}}else if("value"in desc){return desc.value;}else{var getter=desc.get;if(getter===undefined){return undefined;}return getter.call(receiver);}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to files in the scripts/ directory, the license.txt file is located at ../license.txt.
*/ // External dependencies
// returns CSS based on alignment value
function alignment_css_declaration(alignment){switch(alignment){case'left':return'margin-left:0;margin-right: auto';case'right':return'margin-right:0;margin-left: auto';case'center':default:return'margin-left:auto;margin-right:auto';}};// returns array with CSS declaration arrays for absolute position settings
function process_absolute_position_css(props,prefix,selector){var location=props["".concat(prefix,"_position_type")],vertical_prop=props["".concat(prefix,"_vertical_offset")],horizontal_prop=props["".concat(prefix,"_horizontal_offset")],position=location.split('_');var css=new Array(),generatedStyles=new Array(),transform='',cssDeclaration='';if(position[1]==="center"){// horizontal position
cssDeclaration+="left:50%;";transform+="translateX(-50%) ";}if(position[0]==="center"){// vertical position
cssDeclaration+="top:50%;";transform+="translateY(-50%) ";}if(Boolean(vertical_prop)&&"0px"!==vertical_prop&&"center"!==position[0]){generatedStyles=Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:"".concat(prefix,"_vertical_offset"),selector:selector,cssProperty:position[0],hover:false,sticky:false,responsive:false});generatedStyles.forEach(function(generatedStyle){css.push(generatedStyle);});}else if("center"!==position[0]){cssDeclaration+="".concat(position[0],":0px;");}if(Boolean(horizontal_prop)&&"0px"!==horizontal_prop&&"center"!==position[1]){generatedStyles=Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:"".concat(prefix,"_horizontal_offset"),selector:selector,cssProperty:position[1],hover:false,sticky:false,responsive:false});generatedStyles.forEach(function(generatedStyle){css.push(generatedStyle);});}else if("center"!==position[1]){cssDeclaration+="".concat(position[1],":0px;");}if(transform){cssDeclaration+="transform: ".concat(transform,";");}css.push({selector:selector,declaration:cssDeclaration});return css;}function apply_responsive(props,key,selector){var css_prop_key=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'padding';var additionalCss=[];if(!props[key]){return;}var desktop=props[key];var isLastEdit=props["".concat(key+"_last_edited")];var statusActive=isLastEdit&&isLastEdit.startsWith("on");switch(css_prop_key){case'padding':case'margin':desktop=!["padding","margin"].includes(css_prop_key)?props[key]:props[key].split("|");additionalCss.push([{selector:selector,declaration:!["padding","margin"].includes(css_prop_key)?"".concat(css_prop_key,": ").concat(desktop,";"):"".concat(css_prop_key,"-top: ").concat(desktop[0],"; ").concat(css_prop_key,"-right: ").concat(desktop[1],"; ").concat(css_prop_key,"-bottom: ").concat(desktop[2],"; ").concat(css_prop_key,"-left: ").concat(desktop[3],";")}]);if(props["".concat(key+"_tablet")]&&statusActive){var tablet=!["padding","margin"].includes(css_prop_key)?props[key]:props["".concat(key+"_tablet")].split("|");additionalCss.push([{selector:selector,declaration:!["padding","margin"].includes(css_prop_key)?"".concat(css_prop_key,": ").concat(tablet,";"):"".concat(css_prop_key,"-top: ").concat(tablet[0],"; ").concat(css_prop_key,"-right: ").concat(tablet[1],"; ").concat(css_prop_key,"-bottom: ").concat(tablet[2],"; ").concat(css_prop_key,"-left: ").concat(tablet[3],";"),'device':'tablet'}]);}if(props["".concat(key+"_phone")]&&statusActive){var phone=!["padding","margin"].includes(css_prop_key)?props[key]:props["".concat(key+"_phone")].split("|");additionalCss.push([{selector:selector,declaration:!["padding","margin"].includes(css_prop_key)?"".concat(css_prop_key,": ").concat(phone,";"):"".concat(css_prop_key,"-top: ").concat(phone[0],"; ").concat(css_prop_key,"-right: ").concat(phone[1],"; ").concat(css_prop_key,"-bottom: ").concat(phone[2],"; ").concat(css_prop_key,"-left: ").concat(phone[3],";"),'device':'phone'}]);}return additionalCss;case'alignment':additionalCss.push([{selector:selector,declaration:alignment_css_declaration(props[key])}]);if(props["".concat(key+"_tablet")]&&statusActive){additionalCss.push([{selector:selector,declaration:alignment_css_declaration(props[key+"_tablet"]),device:'tablet'}]);}if(props["".concat(key+"_phone")]&&statusActive){additionalCss.push([{selector:selector,declaration:alignment_css_declaration(props[key+"_phone"]),device:'phone'}]);}return additionalCss;default:additionalCss.push([{selector:selector,declaration:css_prop_key+':'+props[key]}]);if(props["".concat(key+"_tablet")]&&statusActive){additionalCss.push([{selector:selector,declaration:css_prop_key+':'+props[key+"_tablet"],device:'tablet'}]);}if(props["".concat(key+"_phone")]&&statusActive){additionalCss.push([{selector:selector,declaration:css_prop_key+':'+props[key+"_phone"],device:'phone'}]);}return additionalCss;}};var TestifyCarouselParent=/*#__PURE__*/function(_TestifyCarouselAjaxC){_inherits(TestifyCarouselParent,_TestifyCarouselAjaxC);_createClass(TestifyCarouselParent,null,[{key:"css",value:function css(props){var additionalCss=[];// star rating
var utils=window.ET_Builder.API.Utils;// Responsive CSS
var additionalCss_=additionalCss;if(props.slider_container_bg_enable==='on'){var backgroundStyles=Object(__WEBPACK_IMPORTED_MODULE_4__module_dependencies_background__["a" /* getBackgroundStyle */])({attrs:props,defaults:'',name:'slider_container_bg',selector:'%%order_class%% .dstc-testify-swiper-inner',basePropName:'slider_container_bg',renderSlug:'testify_carousel',has_background_color_toggle:true,hover:true});if(!__WEBPACK_IMPORTED_MODULE_2_lodash_isEmpty___default()(backgroundStyles)){additionalCss.push(backgroundStyles);}}var starIcon=utils.processFontIcon(props.rating_icon);starIcon=starIcon?'\\'+starIcon.charCodeAt().toString(16):'\\e033';if(props.rating_custom_icon==='on'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-rating .star-rating::before, %%order_class%% .dstc-testify-rating .star-rating span::before',declaration:"content: \"".concat(starIcon).concat(starIcon).concat(starIcon).concat(starIcon).concat(starIcon,"\";")}]);var ratingFont=props.rating_icon.split("|");if(ratingFont[2]==='fa'){additionalCss.push([{selector:'%%order_class%% .star-rating',declaration:"font-family: FontAwesome!important;"}]);}}// CSS
additionalCss.push([{selector:'%%order_class%%.testify_carousel .swiper-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active',declaration:"background-color: ".concat(props.pagination_bg_color_active,";")},{selector:'%%order_class%% .dstc-testify-rating .star-rating span::before',declaration:"color: ".concat(props.rating_color_active,";")},{selector:'%%order_class%% .dstc-testify-rating .star-rating::before',declaration:"color: ".concat(props.rating_color)},{selector:'%%order_class%% .dstc-testify-quote-wrapper span',declaration:"color: ".concat(props.quote_color,";")}]);if(props.image_cover==='on'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-image-wrapper img',declaration:'object-fit: cover;'}]);}// Text Shadow overwrites Link Text shadow fix
if(props.content_text_text_shadow_style!=='none'&&props.content_links_text_shadow_style==='none'){// CSS
additionalCss.push([{selector:'%%order_class%% .et_pb_module_inner p a',declaration:'text-shadow: none;'}]);}if(props.pagination_show_controls==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'pagination_bg_color',selector:'%%order_class%% .swiper-pagination .swiper-pagination-bullet',cssProperty:'background-color'}));}if(props.position_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'position_bg',selector:'%%order_class%% .dstc-testify-position-wrapper',cssProperty:'background-color'}));}if(props.content_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'content_bg',selector:'%%order_class%% .dstc-testify-content',cssProperty:'background-color'}));}if(props.title_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'title_bg',selector:'%%order_class%% .dstc-testify-title',cssProperty:'background-color'}));}if(props.author_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'author_bg',selector:'%%order_class%% .dstc-testify-author-wrapper',cssProperty:'background-color'}));}if(props.image_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'image_bg',selector:'%%order_class%% .dstc-testify-image-wrapper img',cssProperty:'background-color'}));}if(props.quote_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'quote_bg',selector:'%%order_class%% .dstc-testify-quote-wrapper',cssProperty:'background-color'}));}if(props.rating_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'rating_bg',selector:'%%order_class%% .dstc-testify-rating',cssProperty:'background-color'}));}if(props.divider_bg_enable==='on'){additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'divider_bg',selector:'%%order_class%% .dstc-testify-divider-wrapper',cssProperty:'background-color'}));}additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'arrows_icon_bg_color',selector:'%%order_class%% .prev_icon, %%order_class%% .next_icon',cssProperty:'background-color'}));additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'arrows_icon_color',selector:'%%order_class%% .prev_icon, %%order_class%% .next_icon',cssProperty:'color'}));// Container Arrow
if(props.container_arrow_enable==='on'){var containerArrowSelector='%%order_class%% .dstc-testify-swiper-inner:after';additionalCss.push(Object(__WEBPACK_IMPORTED_MODULE_5__module_dependencies_styles__["a" /* generateStyles */])({attrs:props,name:'container_arrow_color',selector:containerArrowSelector,cssProperty:'border-top-color'}));additionalCss.push([{selector:containerArrowSelector,declaration:"position: absolute; content: \"\"; width: 0; height: 0; border-left: ".concat(props.container_arrow_size," solid transparent; border-right: ").concat(props.container_arrow_size," solid transparent; border-top-style: solid; border-top-width: ").concat(props.container_arrow_size,";")}]);var positionCss=process_absolute_position_css(props,'container_arrow',containerArrowSelector);additionalCss.push(positionCss);additionalCss_=additionalCss_.concat(apply_responsive(props,'container_arrow_z_index',containerArrowSelector,'z-index'));}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.image_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-image-wrapper img',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.arrows_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .prev_icon,%%order_class%% .next_icon',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.title_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-title',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.quote_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-quote-wrapper',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.author_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-author-wrapper',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.rating_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-rating',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.position_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .dstc-testify-position-wrapper',declaration:'border: none;border-radius: unset;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.pagination_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .swiper-pagination-bullet',declaration:'border: none;'}]);}// Temporary fix for 'depends_show_if' not working correctly in VB
if(props.container_border_enable==='off'){additionalCss.push([{selector:'%%order_class%% .et_pb_module_inner .dstc-testify-swiper-inner',declaration:'border: none;border-radius: unset;'}]);}// - Paddings and Margins
for(var elementId in TestifyCarouselParent.marginPaddingElements){additionalCss_=additionalCss_.concat(apply_responsive(props,elementId+'_padding',TestifyCarouselParent.marginPaddingElements[elementId]));additionalCss_=additionalCss_.concat(apply_responsive(props,elementId+'_margin',TestifyCarouselParent.marginPaddingElements[elementId],'margin'));}additionalCss_=additionalCss_.concat(apply_responsive(props,'container_wrapper_padding','%%order_class%% .dstc-testify-item-wrapper','padding'));// - Pagination
additionalCss_=additionalCss_.concat(apply_responsive(props,'pagination_space_between','%%order_class%% .swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet','margin-right'));additionalCss_=additionalCss_.concat(apply_responsive(props,'pagination_space_between','%%order_class%% .swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet','margin-left'));additionalCss_=additionalCss_.concat(apply_responsive(props,'pagination_size_width','%%order_class%% .swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet','width'));additionalCss_=additionalCss_.concat(apply_responsive(props,'pagination_size_height','%%order_class%% .swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet','height'));additionalCss_=additionalCss_.concat(apply_responsive(props,'pagination_align','%%order_class%% .swiper-pagination','text-align'));// - Arrows
additionalCss_=additionalCss_.concat(apply_responsive(props,'arrows_icon_size','%%order_class%% .prev_icon,%%order_class%% .next_icon','font-size'));additionalCss_=additionalCss_.concat(apply_responsive(props,'arrows_hor_pos','%%order_class%% span.prev_icon','left'));additionalCss_=additionalCss_.concat(apply_responsive(props,'arrows_hor_pos','%%order_class%% span.next_icon','right'));// - Rating
additionalCss_=additionalCss_.concat(apply_responsive(props,'rating_size','%%order_class%% .dstc-testify-rating','font-size'));additionalCss_=additionalCss_.concat(apply_responsive(props,'rating_spacing','%%order_class%% .star-rating::before, %%order_class%% .dstc-testify-rating span::before','letter-spacing'));additionalCss_=additionalCss_.concat(apply_responsive(props,'rating_align','%%order_class%% .dstc-testify-rating','text-align'));// - Image
additionalCss_=additionalCss_.concat(apply_responsive(props,'image_max_height','%%order_class%% .dstc-testify-image-wrapper img','max-height'));additionalCss_=additionalCss_.concat(apply_responsive(props,'image_height','%%order_class%% .dstc-testify-image-wrapper img','height'));additionalCss_=additionalCss_.concat(apply_responsive(props,'image_max_width','%%order_class%% .dstc-testify-image-wrapper img','max-width'));additionalCss_=additionalCss_.concat(apply_responsive(props,'image_width','%%order_class%% .dstc-testify-image-wrapper img','width'));additionalCss_=additionalCss_.concat(apply_responsive(props,'image_align','%%order_class%% .dstc-testify-image-wrapper img','alignment'));// - Quote
additionalCss_=additionalCss_.concat(apply_responsive(props,'quote_align','%%order_class%% .dstc-testify-quote-wrapper','text-align'));additionalCss_=additionalCss_.concat(apply_responsive(props,'quote_size','%%order_class%% .dstc-testify-quote-wrapper span','font-size'));// - Container
additionalCss_=additionalCss_.concat(apply_responsive(props,'container_height','%%order_class%% .dstc-testify-swiper-inner','height'));if(props.container_height==='100%'){additionalCss_=additionalCss_.concat(apply_responsive(props,'container_align','%%order_class%% .dstc-testify-swiper-inner','justify-content'));}if(props.container_height==='fit-content'){additionalCss_=additionalCss_.concat(apply_responsive(props,'container_wrapper_align','%%order_class%% .swiper-wrapper','align-items'));}// Divider
additionalCss_=additionalCss_.concat(apply_responsive(props,'divider_max_width','%%order_class%% .dstc-testify-divider','max-width'));additionalCss_=additionalCss_.concat(apply_responsive(props,'divider_border_color','%%order_class%% .dstc-testify-divider:before','border-top-color'));additionalCss_=additionalCss_.concat(apply_responsive(props,'divider_border_height','%%order_class%% .dstc-testify-divider:before','border-top-width'));additionalCss_=additionalCss_.concat(apply_responsive(props,'divider_border_style','%%order_class%% .dstc-testify-divider:before','border-top-style'));return additionalCss_;}}]);function TestifyCarouselParent(props){var _this;_classCallCheck(this,TestifyCarouselParent);_this=_possibleConstructorReturn(this,(TestifyCarouselParent.__proto__||Object.getPrototypeOf(TestifyCarouselParent)).apply(this,arguments));Object.defineProperty(_assertThisInitialized(_this),"ajaxProps",{configurable:true,enumerable:true,writable:true,value:['testimonial_view_type','testimonials_count','testimonials_category','sort_by','sort_dir']});Object.defineProperty(_assertThisInitialized(_this),"swiperProps",{configurable:true,enumerable:true,writable:true,value:['column_layout','column_layout_tablet','column_layout_phone','slide_by','slide_by_tablet','slide_by_phone','slide_center','container_space_between','container_space_between_tablet','container_space_between_phone','auto_height','loop','autoplay','auto_speed','pause_slider','arrows_show','pagination_show_controls','width','max_width','min_height','height','max_height','custom_padding','custom_margin','container']});_this.goNext=_this.goNext.bind(_assertThisInitialized(_this));_this.goPrev=_this.goPrev.bind(_assertThisInitialized(_this));_this.swiper=null;_this.props=props;return _this;}_createClass(TestifyCarouselParent,[{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){_get(TestifyCarouselParent.prototype.__proto__||Object.getPrototypeOf(TestifyCarouselParent.prototype),"componentDidUpdate",this).call(this,prevProps);}},{key:"goNext",value:function goNext(){if(this.swiper)this.swiper.slideNext();}},{key:"goPrev",value:function goPrev(){if(this.swiper)this.swiper.slidePrev();}},{key:"_shouldReload",value:function _shouldReload(oldProps,newProps){for(var i=0;i<this.ajaxProps.length;++i){if(!window.ET_Builder.API.Utils._.isEqual(oldProps[this.ajaxProps[i]],newProps[this.ajaxProps[i]])){return'ajax';}}for(var j=0;j<this.swiperProps.length;++j){if(!window.ET_Builder.API.Utils._.isEqual(oldProps[this.swiperProps[j]],newProps[this.swiperProps[j]])){return'rerender';}}return false;}},{key:"_reloadData",value:function _reloadData(props){var requestData={action:"testify_carousel_testimonials_list",nonce:window.testify_carousel.nonce};for(var i=0;i<this.ajaxProps.length;++i){requestData[this.ajaxProps[i]]=props[this.ajaxProps[i]];}return requestData;}},{key:"render",value:function render(){return _get(TestifyCarouselParent.prototype.__proto__||Object.getPrototypeOf(TestifyCarouselParent.prototype),"render",this).call(this);}},{key:"doRender",value:function doRender(key,src){var data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Fragment,null);var props=this.props;if(key.props&&key.props.attrs&&key.props.attrs.item){var allowedtags=['h1','h2','h3','h4','h5','h6','p','strong'];switch(key.props.attrs.item){case'not_found':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p",{className:"dstc_no_record",key:'not_found'+props.moduleInfo.order+100123},src);break;case'title':if(allowedtags.indexOf(props.title_tag)>-1){var CustomTag=props.title_tag;data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CustomTag,{key:'title_'+props.moduleInfo.order+10001,className:"dstc-testify-title"},src.title);}break;case'content':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'content_'+props.moduleInfo.order+10001,className:"dstc-testify-content"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p",{dangerouslySetInnerHTML:{__html:src.content}}));break;case'position':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'position_'+props.moduleInfo.order+10001,className:"dstc-testify-position-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p",{className:"dstc-testify-position"},src.position));break;case'divider':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'divider_'+props.moduleInfo.order+10001,className:"dstc-testify-divider-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span",{className:"dstc-testify-divider"}));break;case'image':if(src.image_html){data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'image_'+props.moduleInfo.order+10001,className:"dstc-testify-image-wrapper",dangerouslySetInnerHTML:{__html:src.image_html}});}break;case'quote':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'quote_'+props.moduleInfo.order+10001,className:"dstc-testify-quote-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span",{className:'testify-quote '+props.quote_icon}));break;case'testimonialrating':data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'testimonial_rating_'+props.moduleInfo.order+10001,className:"dstc-testify-rating",dangerouslySetInnerHTML:{__html:src.testimonial_rating_html}});break;case'testimonialauthor':var showlinks=src.testimonial_author_link&&props.author_link_show!=="off";if(showlinks){data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'testimonial_author_'+props.moduleInfo.order+10001,className:"dstc-testify-author-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p",{className:"dstc-testify-author"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a",{className:"dstc-testify-link",href:"#"},src.testimonial_author)));}else{data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:'testimonial_author_'+props.moduleInfo.order+10001,className:"dstc-testify-author-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("p",{className:"dstc-testify-author"},src.testimonial_author));}break;default:data=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Fragment,null);}}return data;}},{key:"_render",value:function _render(){var _this2=this;var props=this.props;var utils=window.ET_Builder.API.Utils;//const orderClass = `${props.moduleInfo.type}_${props.moduleInfo.order}`;
var params={//slidesPerView: props.column_layout,
//spaceBetween: parseInt(props.container_space_between),
centeredSlides:props.slide_center==='on',autoHeight:false,breakpointsInverse:true,loop:props.loop==='on',grabCursor:true,mousewheel:props.mousewheel==='on',allowTouchMove:props.touchmove==='on',rtl:props.is_rtl>0,breakpoints:{980:{slidesPerView:props.column_layout,slidesPerGroup:props.slide_by},768:{slidesPerView:props.column_layout_tablet||props.column_layout,slidesPerGroup:props.slide_by_tablet||props.slide_by},0:{slidesPerView:props.column_layout_phone||props.column_layout,slidesPerGroup:props.slide_by_phone||props.slide_by}}};if(props.arrows_show==="on"){params.navigation={nextEl:'.next_icon',prevEl:'.prev_icon'};}if(props.pagination_show_controls==="on"){params.pagination={el:'.swiper-pagination',clickable:true};}if(props.autoplay==="on"){params.autoplay={delay:props.auto_speed||5000// disableOnInteraction: props.stop_slider_touch === 'on',
};}var testify_carousel_item=props.content?Object.values(_objectSpread2({},props.content)):[];var output=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",null,this.state.result&&this.state.result.testimonials&&this.state.result.testimonials.length>0?__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"testify_carousel_inner"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_react_id_swiper___default.a,Object.assign({containerClass:"testify-swiper-container swiper-container"},params,{ref:function ref(node){if(node){_this2.swiper=node.swiper;if(_this2.swiper.$el&&'on'===props.autoplay&&'on'===props.pause_slider){window.jQuery(_this2.swiper.$el).mouseover(function(){this.swiper.autoplay.stop();});window.jQuery(_this2.swiper.$el).mouseout(function(){this.swiper.autoplay.start();});}}}}),this.state.result.testimonials.map(function(src,index){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"dstc-testify-item-wrapper",key:index,"data-alt":"".concat(props.className,"-").concat(index)},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"dstc-testify-swiper-inner"},testify_carousel_item.map(function(v,k){return _this2.doRender(v,src);})));})),props.arrows_show==='on'&&__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"dstc-testify-arrows dstc-testify-arrows-alignment "+props.arrows_pos},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span",{className:"prev_icon",onClick:this.goPrev},utils.processFontIcon(props.arrows_prev_icon)),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("span",{className:"next_icon",onClick:this.goNext},utils.processFontIcon(props.arrows_next_icon)))):this.doRender('not_found',"No results to display"));return output;}}]);return TestifyCarouselParent;}(__WEBPACK_IMPORTED_MODULE_3__components_ajax__["a" /* default */]);Object.defineProperty(TestifyCarouselParent,"slug",{configurable:true,enumerable:true,writable:true,value:'testify_carousel'});Object.defineProperty(TestifyCarouselParent,"marginPaddingElements",{configurable:true,enumerable:true,writable:true,value:{title:'%%order_class%% .dstc-testify-title',content:'%%order_class%% .dstc-testify-content',author:'%%order_class%% .dstc-testify-author-wrapper',position:'%%order_class%% .dstc-testify-position-wrapper',image:'%%order_class%% .dstc-testify-image-wrapper img','testify-quote':'%%order_class%% .dstc-testify-quote-wrapper',rating:'%%order_class%% .dstc-testify-rating',container:'%%order_class%% .dstc-testify-swiper-inner',arrows:'%%order_class%% .prev_icon, %%order_class%% .next_icon',pagination:'%%order_class%% .swiper-pagination',divider:'%%order_class%% .dstc-testify-divider-wrapper'}});/* harmony default export */ __webpack_exports__["a"] = (TestifyCarouselParent);
/***/ }),
/* 145 */
/*!***************************************************!*\
!*** ./node_modules/react-id-swiper/lib/index.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireWildcard(__webpack_require__(/*! react */ 9));
var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ 84));
var _swiper = _interopRequireDefault(__webpack_require__(/*! swiper/dist/js/swiper */ 146));
var _objectAssign = _interopRequireDefault(__webpack_require__(/*! object-assign */ 147));
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 148));
var _utils = __webpack_require__(/*! ./utils */ 151);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _typeof(obj) {
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
_typeof = function _typeof(obj) {
return _typeof2(obj);
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
};
}
return _typeof(obj);
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var ReactIdSwiper =
/*#__PURE__*/
function (_Component) {
_inherits(ReactIdSwiper, _Component); // Default props
// Proptypes
function ReactIdSwiper(props) {
var _this;
_classCallCheck(this, ReactIdSwiper);
_this = _possibleConstructorReturn(this, _getPrototypeOf(ReactIdSwiper).call(this, props));
_this.renderContent = _this.renderContent.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(ReactIdSwiper, [{
key: "componentDidMount",
value: function componentDidMount() {
this.buildSwiper();
var slideToIndex = this.getActiveSlideIndexFromProps();
if (slideToIndex !== null) {
this.swiper.slideTo(slideToIndex);
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (typeof this.swiper !== 'undefined') {
var _this$props = this.props,
rebuildOnUpdate = _this$props.rebuildOnUpdate,
shouldSwiperUpdate = _this$props.shouldSwiperUpdate;
if (rebuildOnUpdate) {
this.rebuildSwiper();
} else if (shouldSwiperUpdate) {
this.updateSwiper();
var numSlides = this.swiper.slides.length;
if (numSlides <= this.swiper.activeIndex) {
var index = Math.max(numSlides - 1, 0);
this.swiper.slideTo(index);
}
}
var slideToIndex = this.getActiveSlideIndexFromProps();
if (slideToIndex !== null) {
this.swiper.slideTo(slideToIndex);
}
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (typeof this.swiper !== 'undefined') this.swiper.destroy(true, true);
delete this.swiper;
}
}, {
key: "getActiveSlideIndexFromProps",
value: function getActiveSlideIndexFromProps() {
var activeSlideKey = this.props.activeSlideKey;
if (!activeSlideKey) {
return null;
}
var activeSlideId = null;
var id = 0;
_react.default.Children.forEach(this.props.children, function (child) {
if (child) {
if (child.key === activeSlideKey) {
activeSlideId = id;
}
id += 1;
}
});
return activeSlideId;
}
}, {
key: "buildSwiper",
value: function buildSwiper() {
this.swiper = new _swiper.default(_reactDom.default.findDOMNode(this), (0, _objectAssign.default)({}, this.props));
}
}, {
key: "rebuildSwiper",
value: function rebuildSwiper() {
this.swiper.destroy(true, true);
this.buildSwiper();
}
}, {
key: "updateSwiper",
value: function updateSwiper() {
if (typeof this.swiper !== 'undefined') this.swiper.update();
}
}, {
key: "renderContent",
value: function renderContent(e) {
if (!e) return false;
var _this$props2 = this.props,
slideClass = _this$props2.slideClass,
noSwiping = _this$props2.noSwiping;
var slideClassNames = [slideClass, e.props.className];
if (noSwiping) slideClassNames.push('swiper-no-swiping');
return _react.default.cloneElement(e, _objectSpread({}, e.props, {
className: slideClassNames.join(' ').trim()
}));
}
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
ContainerEl = _this$props3.ContainerEl,
WrapperEl = _this$props3.WrapperEl,
containerClass = _this$props3.containerClass,
wrapperClass = _this$props3.wrapperClass,
children = _this$props3.children,
rtl = _this$props3.rtl,
scrollbar = _this$props3.scrollbar,
renderScrollbar = _this$props3.renderScrollbar,
pagination = _this$props3.pagination,
renderPagination = _this$props3.renderPagination,
navigation = _this$props3.navigation,
renderPrevButton = _this$props3.renderPrevButton,
renderNextButton = _this$props3.renderNextButton,
parallax = _this$props3.parallax,
parallaxEl = _this$props3.parallaxEl,
renderParallax = _this$props3.renderParallax;
return _react.default.createElement(ContainerEl, {
className: containerClass,
dir: rtl && 'rtl'
}, parallax && parallaxEl && renderParallax(this.props), _react.default.createElement(WrapperEl, {
className: wrapperClass
}, _react.default.Children.map(children, this.renderContent)), pagination && pagination.el && renderPagination(this.props), scrollbar && scrollbar.el && renderScrollbar(this.props), navigation && navigation.nextEl && renderNextButton(this.props), navigation && navigation.prevEl && renderPrevButton(this.props));
}
}]);
return ReactIdSwiper;
}(_react.Component);
exports.default = ReactIdSwiper;
_defineProperty(ReactIdSwiper, "defaultProps", {
containerClass: 'swiper-container',
wrapperClass: 'swiper-wrapper',
slideClass: 'swiper-slide',
ContainerEl: 'div',
WrapperEl: 'div',
renderScrollbar: function renderScrollbar(_ref) {
var scrollbar = _ref.scrollbar;
return _react.default.createElement("div", {
className: (0, _utils.cn)(scrollbar.el)
});
},
renderPagination: function renderPagination(_ref2) {
var pagination = _ref2.pagination;
return _react.default.createElement("div", {
className: (0, _utils.cn)(pagination.el)
});
},
renderPrevButton: function renderPrevButton(_ref3) {
var navigation = _ref3.navigation;
return _react.default.createElement("div", {
className: (0, _utils.cn)(navigation.prevEl)
});
},
renderNextButton: function renderNextButton(_ref4) {
var navigation = _ref4.navigation;
return _react.default.createElement("div", {
className: (0, _utils.cn)(navigation.nextEl)
});
},
renderParallax: function renderParallax(_ref5) {
var parallaxEl = _ref5.parallaxEl;
return _react.default.createElement("div", {
className: (0, _utils.cn)(parallaxEl.el),
"data-swiper-parallax": parallaxEl.value
});
}
});
_defineProperty(ReactIdSwiper, "propTypes", {
// react-id-swiper original parameters
ContainerEl: _propTypes.default.string,
WrapperEl: _propTypes.default.string,
containerClass: _propTypes.default.string,
wrapperClass: _propTypes.default.string,
children: _propTypes.default.any,
rebuildOnUpdate: _propTypes.default.bool,
shouldSwiperUpdate: _propTypes.default.bool,
activeSlideKey: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
renderScrollbar: _propTypes.default.func,
renderPagination: _propTypes.default.func,
renderPrevButton: _propTypes.default.func,
renderNextButton: _propTypes.default.func,
renderParallax: _propTypes.default.func,
// parallax
parallax: _propTypes.default.bool,
parallaxEl: _propTypes.default.shape({
el: _propTypes.default.string,
value: _propTypes.default.string
}),
// swiper parameter
init: _propTypes.default.bool,
initialSlide: _propTypes.default.number,
direction: _propTypes.default.string,
rtl: _propTypes.default.bool,
speed: _propTypes.default.number,
setWrapperSize: _propTypes.default.bool,
virtualTranslate: _propTypes.default.bool,
width: _propTypes.default.number,
height: _propTypes.default.number,
autoHeight: _propTypes.default.bool,
roundLengths: _propTypes.default.bool,
nested: _propTypes.default.bool,
uniqueNavElements: _propTypes.default.bool,
effect: _propTypes.default.string,
runCallbacksOnInit: _propTypes.default.bool,
// slides grid
spaceBetween: _propTypes.default.number,
slidesPerView: _propTypes.default.any,
slidesPerColumn: _propTypes.default.number,
slidesPerColumnFill: _propTypes.default.string,
slidesPerGroup: _propTypes.default.number,
centeredSlides: _propTypes.default.bool,
slidesOffsetBefore: _propTypes.default.number,
slidesOffsetAfter: _propTypes.default.number,
normalizeSlideIndex: _propTypes.default.bool,
// grab cursor
grabCursor: _propTypes.default.bool,
// touches
touchEventsTarget: _propTypes.default.string,
touchRatio: _propTypes.default.number,
touchAngle: _propTypes.default.number,
simulateTouch: _propTypes.default.bool,
shortSwipes: _propTypes.default.bool,
longSwipes: _propTypes.default.bool,
longSwipesRatio: _propTypes.default.number,
longSwipesMs: _propTypes.default.number,
followFinger: _propTypes.default.bool,
allowTouchMove: _propTypes.default.bool,
threshold: _propTypes.default.number,
touchMoveStopPropagation: _propTypes.default.bool,
iOSEdgeSwipeDetection: _propTypes.default.bool,
iOSEdgeSwipeThreshold: _propTypes.default.number,
touchReleaseOnEdges: _propTypes.default.bool,
passiveListeners: _propTypes.default.bool,
// touch resistance
resistance: _propTypes.default.bool,
resistanceRatio: _propTypes.default.number,
// swiping / no swiping
allowSlidePrev: _propTypes.default.bool,
allowSlideNext: _propTypes.default.bool,
noSwiping: _propTypes.default.bool,
noSwipingClass: _propTypes.default.string,
swipeHandler: _propTypes.default.any,
// clicks
preventClicks: _propTypes.default.bool,
preventClicksPropagation: _propTypes.default.bool,
slideToClickedSlide: _propTypes.default.bool,
// freemode
freeMode: _propTypes.default.bool,
freeModeMomentum: _propTypes.default.bool,
freeModeMomentumRatio: _propTypes.default.number,
freeModeMomentumVelocityRatio: _propTypes.default.number,
freeModeMomentumBounce: _propTypes.default.bool,
freeModeMomentumBounceRatio: _propTypes.default.number,
freeModeMinimumVelocity: _propTypes.default.number,
freeModeSticky: _propTypes.default.bool,
// progress
watchSlidesProgress: _propTypes.default.bool,
watchSlidesVisibility: _propTypes.default.bool,
// images
preloadImages: _propTypes.default.bool,
updateOnImagesReady: _propTypes.default.bool,
// loop
loop: _propTypes.default.bool,
loopAdditionalSlides: _propTypes.default.number,
loopedSlides: _propTypes.default.number,
loopFillGroupWithBlank: _propTypes.default.bool,
// breakpoints
breakpoints: _propTypes.default.object,
// observer
observer: _propTypes.default.bool,
observeParents: _propTypes.default.bool,
// namespace
containerModifierClass: _propTypes.default.string,
slideClass: _propTypes.default.string,
slideActiveClass: _propTypes.default.string,
slideDuplicatedActiveClass: _propTypes.default.string,
slideVisibleClass: _propTypes.default.string,
slideDuplicateClass: _propTypes.default.string,
slideNextClass: _propTypes.default.string,
slideDuplicatedNextClass: _propTypes.default.string,
slidePrevClass: _propTypes.default.string,
slideDuplicatedPrevClass: _propTypes.default.string,
// autoplay
autoplay: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
delay: _propTypes.default.number,
stopOnLast: _propTypes.default.bool,
disableOnInteraction: _propTypes.default.bool
})]),
// pagination
pagination: _propTypes.default.shape({
el: _propTypes.default.string,
type: _propTypes.default.string,
bulletElement: _propTypes.default.string,
dynamicBullets: _propTypes.default.bool,
hideOnClick: _propTypes.default.bool,
clickable: _propTypes.default.bool,
renderBullet: _propTypes.default.func,
renderFraction: _propTypes.default.func,
renderProgressbar: _propTypes.default.func,
renderCustom: _propTypes.default.func,
bulletClass: _propTypes.default.string,
bulletActiveClass: _propTypes.default.string,
modifierClass: _propTypes.default.string,
currentClass: _propTypes.default.string,
totalClass: _propTypes.default.string,
hiddenClass: _propTypes.default.string,
progressbarFillClass: _propTypes.default.string,
clickableClass: _propTypes.default.string
}),
// scrollbar
scrollbar: _propTypes.default.shape({
el: _propTypes.default.any,
hide: _propTypes.default.bool,
draggable: _propTypes.default.bool,
snapOnRelease: _propTypes.default.bool,
dragSize: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
}),
// navigation
navigation: _propTypes.default.shape({
nextEl: _propTypes.default.string,
prevEl: _propTypes.default.string,
hideOnClick: _propTypes.default.bool,
disabledClass: _propTypes.default.string,
hiddenClass: _propTypes.default.string
}),
// a11y
a11y: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
prevSlideMessage: _propTypes.default.string,
nextSlideMessage: _propTypes.default.string,
firstSlideMessage: _propTypes.default.string,
lastSlideMessage: _propTypes.default.string,
paginationBulletMessage: _propTypes.default.string,
notificationClass: _propTypes.default.string
})]),
// zoom
zoom: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
maxRatio: _propTypes.default.number,
minRatio: _propTypes.default.number,
toggle: _propTypes.default.bool,
containerClass: _propTypes.default.string,
zoomedSlideClass: _propTypes.default.string
})]),
// keyboard
keyboard: _propTypes.default.bool,
// mousewheel
mousewheel: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
forceToAxis: _propTypes.default.bool,
releaseOnEdges: _propTypes.default.bool,
invert: _propTypes.default.bool,
sensitivity: _propTypes.default.number,
eventsTarged: _propTypes.default.string
})]),
// hashNavigation
hashNavigation: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
watchState: _propTypes.default.bool,
replaceState: _propTypes.default.bool
})]),
// history
history: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
key: _propTypes.default.string,
replaceState: _propTypes.default.bool
})]),
// lazy
lazy: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
loadPrevNext: _propTypes.default.bool,
loadPrevNextAmount: _propTypes.default.number,
loadOnTransitionStart: _propTypes.default.bool,
elementClass: _propTypes.default.string,
loadingClass: _propTypes.default.string,
loadedClass: _propTypes.default.string,
preloaderClass: _propTypes.default.string
})]),
// fadeEffect
fadeEffect: _propTypes.default.shape({
crossFade: _propTypes.default.bool
}),
// coverflowEffect
coverflowEffect: _propTypes.default.shape({
slideShadows: _propTypes.default.bool,
rotate: _propTypes.default.number,
stretch: _propTypes.default.number,
depth: _propTypes.default.number,
modifier: _propTypes.default.number
}),
// flipEffect
flipEffect: _propTypes.default.shape({
slideShadows: _propTypes.default.bool,
limitRotation: _propTypes.default.bool
}),
// cubeEffect
cubeEffect: _propTypes.default.shape({
slideShadows: _propTypes.default.bool,
shadow: _propTypes.default.bool,
shadowOffset: _propTypes.default.number,
shadowScale: _propTypes.default.number
}),
// controller
controller: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
control: _propTypes.default.any,
inverse: _propTypes.default.bool,
by: _propTypes.default.string
})]),
// events
on: _propTypes.default.shape({
init: _propTypes.default.func,
beforeDestroy: _propTypes.default.func,
slideChange: _propTypes.default.func,
slideChangeTransitionStart: _propTypes.default.func,
slideChangeTransitionEnd: _propTypes.default.func,
slideNextTransitionStart: _propTypes.default.func,
slideNextTransitionEnd: _propTypes.default.func,
slidePrevTransitionStart: _propTypes.default.func,
slidePrevTransitionEnd: _propTypes.default.func,
transitionStart: _propTypes.default.func,
onTransitionEnd: _propTypes.default.func,
touchStart: _propTypes.default.func,
touchMove: _propTypes.default.func,
touchMoveOpposite: _propTypes.default.func,
sliderMove: _propTypes.default.func,
touchEnd: _propTypes.default.func,
click: _propTypes.default.func,
tap: _propTypes.default.func,
doubleTap: _propTypes.default.func,
imagesReady: _propTypes.default.func,
progress: _propTypes.default.func,
reachBeginning: _propTypes.default.func,
reachEnd: _propTypes.default.func,
fromEdge: _propTypes.default.func,
setTranslate: _propTypes.default.func,
setTransition: _propTypes.default.func,
resize: _propTypes.default.func
})
});
/***/ }),
/* 146 */
/*!***********************************************!*\
!*** ./node_modules/swiper/dist/js/swiper.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* Swiper 4.5.1
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2019 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: September 13, 2019
*/
(function (global, factory) {
( false ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.Swiper = factory());
})(this, function () {
'use strict';
/**
* SSR Window 1.0.1
* Better handling for window object in SSR environment
* https://github.com/nolimits4web/ssr-window
*
* Copyright 2018, Vladimir Kharlampidi
*
* Licensed under MIT
*
* Released on: July 18, 2018
*/
var doc = typeof document === 'undefined' ? {
body: {},
addEventListener: function addEventListener() {},
removeEventListener: function removeEventListener() {},
activeElement: {
blur: function blur() {},
nodeName: ''
},
querySelector: function querySelector() {
return null;
},
querySelectorAll: function querySelectorAll() {
return [];
},
getElementById: function getElementById() {
return null;
},
createEvent: function createEvent() {
return {
initEvent: function initEvent() {}
};
},
createElement: function createElement() {
return {
children: [],
childNodes: [],
style: {},
setAttribute: function setAttribute() {},
getElementsByTagName: function getElementsByTagName() {
return [];
}
};
},
location: {
hash: ''
}
} : document; // eslint-disable-line
var win = typeof window === 'undefined' ? {
document: doc,
navigator: {
userAgent: ''
},
location: {},
history: {},
CustomEvent: function CustomEvent() {
return this;
},
addEventListener: function addEventListener() {},
removeEventListener: function removeEventListener() {},
getComputedStyle: function getComputedStyle() {
return {
getPropertyValue: function getPropertyValue() {
return '';
}
};
},
Image: function Image() {},
Date: function Date() {},
screen: {},
setTimeout: function setTimeout() {},
clearTimeout: function clearTimeout() {}
} : window; // eslint-disable-line
/**
* Dom7 2.1.3
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API
* http://framework7.io/docs/dom.html
*
* Copyright 2019, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us/
*
* Licensed under MIT
*
* Released on: February 11, 2019
*/
var Dom7 = function Dom7(arr) {
var self = this; // Create array-like object
for (var i = 0; i < arr.length; i += 1) {
self[i] = arr[i];
}
self.length = arr.length; // Return collection with methods
return this;
};
function $(selector, context) {
var arr = [];
var i = 0;
if (selector && !context) {
if (selector instanceof Dom7) {
return selector;
}
}
if (selector) {
// String
if (typeof selector === 'string') {
var els;
var tempParent;
var html = selector.trim();
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
var toCreate = 'div';
if (html.indexOf('<li') === 0) {
toCreate = 'ul';
}
if (html.indexOf('<tr') === 0) {
toCreate = 'tbody';
}
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) {
toCreate = 'tr';
}
if (html.indexOf('<tbody') === 0) {
toCreate = 'table';
}
if (html.indexOf('<option') === 0) {
toCreate = 'select';
}
tempParent = doc.createElement(toCreate);
tempParent.innerHTML = html;
for (i = 0; i < tempParent.childNodes.length; i += 1) {
arr.push(tempParent.childNodes[i]);
}
} else {
if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {
// Pure ID selector
els = [doc.getElementById(selector.trim().split('#')[1])];
} else {
// Other selectors
els = (context || doc).querySelectorAll(selector.trim());
}
for (i = 0; i < els.length; i += 1) {
if (els[i]) {
arr.push(els[i]);
}
}
}
} else if (selector.nodeType || selector === win || selector === doc) {
// Node/element
arr.push(selector);
} else if (selector.length > 0 && selector[0].nodeType) {
// Array of elements or instance of Dom
for (i = 0; i < selector.length; i += 1) {
arr.push(selector[i]);
}
}
}
return new Dom7(arr);
}
$.fn = Dom7.prototype;
$.Class = Dom7;
$.Dom7 = Dom7;
function unique(arr) {
var uniqueArray = [];
for (var i = 0; i < arr.length; i += 1) {
if (uniqueArray.indexOf(arr[i]) === -1) {
uniqueArray.push(arr[i]);
}
}
return uniqueArray;
} // Classes and attributes
function addClass(className) {
if (typeof className === 'undefined') {
return this;
}
var classes = className.split(' ');
for (var i = 0; i < classes.length; i += 1) {
for (var j = 0; j < this.length; j += 1) {
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') {
this[j].classList.add(classes[i]);
}
}
}
return this;
}
function removeClass(className) {
var classes = className.split(' ');
for (var i = 0; i < classes.length; i += 1) {
for (var j = 0; j < this.length; j += 1) {
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') {
this[j].classList.remove(classes[i]);
}
}
}
return this;
}
function hasClass(className) {
if (!this[0]) {
return false;
}
return this[0].classList.contains(className);
}
function toggleClass(className) {
var classes = className.split(' ');
for (var i = 0; i < classes.length; i += 1) {
for (var j = 0; j < this.length; j += 1) {
if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') {
this[j].classList.toggle(classes[i]);
}
}
}
return this;
}
function attr(attrs, value) {
var arguments$1 = arguments;
if (arguments.length === 1 && typeof attrs === 'string') {
// Get attr
if (this[0]) {
return this[0].getAttribute(attrs);
}
return undefined;
} // Set attrs
for (var i = 0; i < this.length; i += 1) {
if (arguments$1.length === 2) {
// String
this[i].setAttribute(attrs, value);
} else {
// Object
// eslint-disable-next-line
for (var attrName in attrs) {
this[i][attrName] = attrs[attrName];
this[i].setAttribute(attrName, attrs[attrName]);
}
}
}
return this;
} // eslint-disable-next-line
function removeAttr(attr) {
for (var i = 0; i < this.length; i += 1) {
this[i].removeAttribute(attr);
}
return this;
}
function data(key, value) {
var el;
if (typeof value === 'undefined') {
el = this[0]; // Get value
if (el) {
if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {
return el.dom7ElementDataStorage[key];
}
var dataKey = el.getAttribute("data-" + key);
if (dataKey) {
return dataKey;
}
return undefined;
}
return undefined;
} // Set value
for (var i = 0; i < this.length; i += 1) {
el = this[i];
if (!el.dom7ElementDataStorage) {
el.dom7ElementDataStorage = {};
}
el.dom7ElementDataStorage[key] = value;
}
return this;
} // Transforms
// eslint-disable-next-line
function transform(transform) {
for (var i = 0; i < this.length; i += 1) {
var elStyle = this[i].style;
elStyle.webkitTransform = transform;
elStyle.transform = transform;
}
return this;
}
function transition(duration) {
if (typeof duration !== 'string') {
duration = duration + "ms"; // eslint-disable-line
}
for (var i = 0; i < this.length; i += 1) {
var elStyle = this[i].style;
elStyle.webkitTransitionDuration = duration;
elStyle.transitionDuration = duration;
}
return this;
} // Events
function on() {
var assign;
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var eventType = args[0];
var targetSelector = args[1];
var listener = args[2];
var capture = args[3];
if (typeof args[1] === 'function') {
assign = args, eventType = assign[0], listener = assign[1], capture = assign[2];
targetSelector = undefined;
}
if (!capture) {
capture = false;
}
function handleLiveEvent(e) {
var target = e.target;
if (!target) {
return;
}
var eventData = e.target.dom7EventData || [];
if (eventData.indexOf(e) < 0) {
eventData.unshift(e);
}
if ($(target).is(targetSelector)) {
listener.apply(target, eventData);
} else {
var parents = $(target).parents(); // eslint-disable-line
for (var k = 0; k < parents.length; k += 1) {
if ($(parents[k]).is(targetSelector)) {
listener.apply(parents[k], eventData);
}
}
}
}
function handleEvent(e) {
var eventData = e && e.target ? e.target.dom7EventData || [] : [];
if (eventData.indexOf(e) < 0) {
eventData.unshift(e);
}
listener.apply(this, eventData);
}
var events = eventType.split(' ');
var j;
for (var i = 0; i < this.length; i += 1) {
var el = this[i];
if (!targetSelector) {
for (j = 0; j < events.length; j += 1) {
var event = events[j];
if (!el.dom7Listeners) {
el.dom7Listeners = {};
}
if (!el.dom7Listeners[event]) {
el.dom7Listeners[event] = [];
}
el.dom7Listeners[event].push({
listener: listener,
proxyListener: handleEvent
});
el.addEventListener(event, handleEvent, capture);
}
} else {
// Live events
for (j = 0; j < events.length; j += 1) {
var event$1 = events[j];
if (!el.dom7LiveListeners) {
el.dom7LiveListeners = {};
}
if (!el.dom7LiveListeners[event$1]) {
el.dom7LiveListeners[event$1] = [];
}
el.dom7LiveListeners[event$1].push({
listener: listener,
proxyListener: handleLiveEvent
});
el.addEventListener(event$1, handleLiveEvent, capture);
}
}
}
return this;
}
function off() {
var assign;
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var eventType = args[0];
var targetSelector = args[1];
var listener = args[2];
var capture = args[3];
if (typeof args[1] === 'function') {
assign = args, eventType = assign[0], listener = assign[1], capture = assign[2];
targetSelector = undefined;
}
if (!capture) {
capture = false;
}
var events = eventType.split(' ');
for (var i = 0; i < events.length; i += 1) {
var event = events[i];
for (var j = 0; j < this.length; j += 1) {
var el = this[j];
var handlers = void 0;
if (!targetSelector && el.dom7Listeners) {
handlers = el.dom7Listeners[event];
} else if (targetSelector && el.dom7LiveListeners) {
handlers = el.dom7LiveListeners[event];
}
if (handlers && handlers.length) {
for (var k = handlers.length - 1; k >= 0; k -= 1) {
var handler = handlers[k];
if (listener && handler.listener === listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
} else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
} else if (!listener) {
el.removeEventListener(event, handler.proxyListener, capture);
handlers.splice(k, 1);
}
}
}
}
}
return this;
}
function trigger() {
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var events = args[0].split(' ');
var eventData = args[1];
for (var i = 0; i < events.length; i += 1) {
var event = events[i];
for (var j = 0; j < this.length; j += 1) {
var el = this[j];
var evt = void 0;
try {
evt = new win.CustomEvent(event, {
detail: eventData,
bubbles: true,
cancelable: true
});
} catch (e) {
evt = doc.createEvent('Event');
evt.initEvent(event, true, true);
evt.detail = eventData;
} // eslint-disable-next-line
el.dom7EventData = args.filter(function (data, dataIndex) {
return dataIndex > 0;
});
el.dispatchEvent(evt);
el.dom7EventData = [];
delete el.dom7EventData;
}
}
return this;
}
function transitionEnd(callback) {
var events = ['webkitTransitionEnd', 'transitionend'];
var dom = this;
var i;
function fireCallBack(e) {
/* jshint validthis:true */
if (e.target !== this) {
return;
}
callback.call(this, e);
for (i = 0; i < events.length; i += 1) {
dom.off(events[i], fireCallBack);
}
}
if (callback) {
for (i = 0; i < events.length; i += 1) {
dom.on(events[i], fireCallBack);
}
}
return this;
}
function outerWidth(includeMargins) {
if (this.length > 0) {
if (includeMargins) {
// eslint-disable-next-line
var styles = this.styles();
return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left'));
}
return this[0].offsetWidth;
}
return null;
}
function outerHeight(includeMargins) {
if (this.length > 0) {
if (includeMargins) {
// eslint-disable-next-line
var styles = this.styles();
return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom'));
}
return this[0].offsetHeight;
}
return null;
}
function offset() {
if (this.length > 0) {
var el = this[0];
var box = el.getBoundingClientRect();
var body = doc.body;
var clientTop = el.clientTop || body.clientTop || 0;
var clientLeft = el.clientLeft || body.clientLeft || 0;
var scrollTop = el === win ? win.scrollY : el.scrollTop;
var scrollLeft = el === win ? win.scrollX : el.scrollLeft;
return {
top: box.top + scrollTop - clientTop,
left: box.left + scrollLeft - clientLeft
};
}
return null;
}
function styles() {
if (this[0]) {
return win.getComputedStyle(this[0], null);
}
return {};
}
function css(props, value) {
var i;
if (arguments.length === 1) {
if (typeof props === 'string') {
if (this[0]) {
return win.getComputedStyle(this[0], null).getPropertyValue(props);
}
} else {
for (i = 0; i < this.length; i += 1) {
// eslint-disable-next-line
for (var prop in props) {
this[i].style[prop] = props[prop];
}
}
return this;
}
}
if (arguments.length === 2 && typeof props === 'string') {
for (i = 0; i < this.length; i += 1) {
this[i].style[props] = value;
}
return this;
}
return this;
} // Iterate over the collection passing elements to `callback`
function each(callback) {
// Don't bother continuing without a callback
if (!callback) {
return this;
} // Iterate over the current collection
for (var i = 0; i < this.length; i += 1) {
// If the callback returns false
if (callback.call(this[i], i, this[i]) === false) {
// End the loop early
return this;
}
} // Return `this` to allow chained DOM operations
return this;
} // eslint-disable-next-line
function html(html) {
if (typeof html === 'undefined') {
return this[0] ? this[0].innerHTML : undefined;
}
for (var i = 0; i < this.length; i += 1) {
this[i].innerHTML = html;
}
return this;
} // eslint-disable-next-line
function text(text) {
if (typeof text === 'undefined') {
if (this[0]) {
return this[0].textContent.trim();
}
return null;
}
for (var i = 0; i < this.length; i += 1) {
this[i].textContent = text;
}
return this;
}
function is(selector) {
var el = this[0];
var compareWith;
var i;
if (!el || typeof selector === 'undefined') {
return false;
}
if (typeof selector === 'string') {
if (el.matches) {
return el.matches(selector);
} else if (el.webkitMatchesSelector) {
return el.webkitMatchesSelector(selector);
} else if (el.msMatchesSelector) {
return el.msMatchesSelector(selector);
}
compareWith = $(selector);
for (i = 0; i < compareWith.length; i += 1) {
if (compareWith[i] === el) {
return true;
}
}
return false;
} else if (selector === doc) {
return el === doc;
} else if (selector === win) {
return el === win;
}
if (selector.nodeType || selector instanceof Dom7) {
compareWith = selector.nodeType ? [selector] : selector;
for (i = 0; i < compareWith.length; i += 1) {
if (compareWith[i] === el) {
return true;
}
}
return false;
}
return false;
}
function index() {
var child = this[0];
var i;
if (child) {
i = 0; // eslint-disable-next-line
while ((child = child.previousSibling) !== null) {
if (child.nodeType === 1) {
i += 1;
}
}
return i;
}
return undefined;
} // eslint-disable-next-line
function eq(index) {
if (typeof index === 'undefined') {
return this;
}
var length = this.length;
var returnIndex;
if (index > length - 1) {
return new Dom7([]);
}
if (index < 0) {
returnIndex = length + index;
if (returnIndex < 0) {
return new Dom7([]);
}
return new Dom7([this[returnIndex]]);
}
return new Dom7([this[index]]);
}
function append() {
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var newChild;
for (var k = 0; k < args.length; k += 1) {
newChild = args[k];
for (var i = 0; i < this.length; i += 1) {
if (typeof newChild === 'string') {
var tempDiv = doc.createElement('div');
tempDiv.innerHTML = newChild;
while (tempDiv.firstChild) {
this[i].appendChild(tempDiv.firstChild);
}
} else if (newChild instanceof Dom7) {
for (var j = 0; j < newChild.length; j += 1) {
this[i].appendChild(newChild[j]);
}
} else {
this[i].appendChild(newChild);
}
}
}
return this;
}
function prepend(newChild) {
var i;
var j;
for (i = 0; i < this.length; i += 1) {
if (typeof newChild === 'string') {
var tempDiv = doc.createElement('div');
tempDiv.innerHTML = newChild;
for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
}
} else if (newChild instanceof Dom7) {
for (j = 0; j < newChild.length; j += 1) {
this[i].insertBefore(newChild[j], this[i].childNodes[0]);
}
} else {
this[i].insertBefore(newChild, this[i].childNodes[0]);
}
}
return this;
}
function next(selector) {
if (this.length > 0) {
if (selector) {
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
return new Dom7([this[0].nextElementSibling]);
}
return new Dom7([]);
}
if (this[0].nextElementSibling) {
return new Dom7([this[0].nextElementSibling]);
}
return new Dom7([]);
}
return new Dom7([]);
}
function nextAll(selector) {
var nextEls = [];
var el = this[0];
if (!el) {
return new Dom7([]);
}
while (el.nextElementSibling) {
var next = el.nextElementSibling; // eslint-disable-line
if (selector) {
if ($(next).is(selector)) {
nextEls.push(next);
}
} else {
nextEls.push(next);
}
el = next;
}
return new Dom7(nextEls);
}
function prev(selector) {
if (this.length > 0) {
var el = this[0];
if (selector) {
if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
return new Dom7([el.previousElementSibling]);
}
return new Dom7([]);
}
if (el.previousElementSibling) {
return new Dom7([el.previousElementSibling]);
}
return new Dom7([]);
}
return new Dom7([]);
}
function prevAll(selector) {
var prevEls = [];
var el = this[0];
if (!el) {
return new Dom7([]);
}
while (el.previousElementSibling) {
var prev = el.previousElementSibling; // eslint-disable-line
if (selector) {
if ($(prev).is(selector)) {
prevEls.push(prev);
}
} else {
prevEls.push(prev);
}
el = prev;
}
return new Dom7(prevEls);
}
function parent(selector) {
var parents = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
if (this[i].parentNode !== null) {
if (selector) {
if ($(this[i].parentNode).is(selector)) {
parents.push(this[i].parentNode);
}
} else {
parents.push(this[i].parentNode);
}
}
}
return $(unique(parents));
}
function parents(selector) {
var parents = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
var parent = this[i].parentNode; // eslint-disable-line
while (parent) {
if (selector) {
if ($(parent).is(selector)) {
parents.push(parent);
}
} else {
parents.push(parent);
}
parent = parent.parentNode;
}
}
return $(unique(parents));
}
function closest(selector) {
var closest = this; // eslint-disable-line
if (typeof selector === 'undefined') {
return new Dom7([]);
}
if (!closest.is(selector)) {
closest = closest.parents(selector).eq(0);
}
return closest;
}
function find(selector) {
var foundElements = [];
for (var i = 0; i < this.length; i += 1) {
var found = this[i].querySelectorAll(selector);
for (var j = 0; j < found.length; j += 1) {
foundElements.push(found[j]);
}
}
return new Dom7(foundElements);
}
function children(selector) {
var children = []; // eslint-disable-line
for (var i = 0; i < this.length; i += 1) {
var childNodes = this[i].childNodes;
for (var j = 0; j < childNodes.length; j += 1) {
if (!selector) {
if (childNodes[j].nodeType === 1) {
children.push(childNodes[j]);
}
} else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) {
children.push(childNodes[j]);
}
}
}
return new Dom7(unique(children));
}
function remove() {
for (var i = 0; i < this.length; i += 1) {
if (this[i].parentNode) {
this[i].parentNode.removeChild(this[i]);
}
}
return this;
}
function add() {
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var dom = this;
var i;
var j;
for (i = 0; i < args.length; i += 1) {
var toAdd = $(args[i]);
for (j = 0; j < toAdd.length; j += 1) {
dom[dom.length] = toAdd[j];
dom.length += 1;
}
}
return dom;
}
var Methods = {
addClass: addClass,
removeClass: removeClass,
hasClass: hasClass,
toggleClass: toggleClass,
attr: attr,
removeAttr: removeAttr,
data: data,
transform: transform,
transition: transition,
on: on,
off: off,
trigger: trigger,
transitionEnd: transitionEnd,
outerWidth: outerWidth,
outerHeight: outerHeight,
offset: offset,
css: css,
each: each,
html: html,
text: text,
is: is,
index: index,
eq: eq,
append: append,
prepend: prepend,
next: next,
nextAll: nextAll,
prev: prev,
prevAll: prevAll,
parent: parent,
parents: parents,
closest: closest,
find: find,
children: children,
remove: remove,
add: add,
styles: styles
};
Object.keys(Methods).forEach(function (methodName) {
$.fn[methodName] = $.fn[methodName] || Methods[methodName];
});
var Utils = {
deleteProps: function deleteProps(obj) {
var object = obj;
Object.keys(object).forEach(function (key) {
try {
object[key] = null;
} catch (e) {// no getter for object
}
try {
delete object[key];
} catch (e) {// something got wrong
}
});
},
nextTick: function nextTick(callback, delay) {
if (delay === void 0) delay = 0;
return setTimeout(callback, delay);
},
now: function now() {
return Date.now();
},
getTranslate: function getTranslate(el, axis) {
if (axis === void 0) axis = 'x';
var matrix;
var curTransform;
var transformMatrix;
var curStyle = win.getComputedStyle(el, null);
if (win.WebKitCSSMatrix) {
curTransform = curStyle.transform || curStyle.webkitTransform;
if (curTransform.split(',').length > 6) {
curTransform = curTransform.split(', ').map(function (a) {
return a.replace(',', '.');
}).join(', ');
} // Some old versions of Webkit choke when 'none' is passed; pass
// empty string instead in this case
transformMatrix = new win.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
} else {
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
matrix = transformMatrix.toString().split(',');
}
if (axis === 'x') {
// Latest Chrome and webkits Fix
if (win.WebKitCSSMatrix) {
curTransform = transformMatrix.m41;
} // Crazy IE10 Matrix
else if (matrix.length === 16) {
curTransform = parseFloat(matrix[12]);
} // Normal Browsers
else {
curTransform = parseFloat(matrix[4]);
}
}
if (axis === 'y') {
// Latest Chrome and webkits Fix
if (win.WebKitCSSMatrix) {
curTransform = transformMatrix.m42;
} // Crazy IE10 Matrix
else if (matrix.length === 16) {
curTransform = parseFloat(matrix[13]);
} // Normal Browsers
else {
curTransform = parseFloat(matrix[5]);
}
}
return curTransform || 0;
},
parseUrlQuery: function parseUrlQuery(url) {
var query = {};
var urlToParse = url || win.location.href;
var i;
var params;
var param;
var length;
if (typeof urlToParse === 'string' && urlToParse.length) {
urlToParse = urlToParse.indexOf('?') > -1 ? urlToParse.replace(/\S*\?/, '') : '';
params = urlToParse.split('&').filter(function (paramsPart) {
return paramsPart !== '';
});
length = params.length;
for (i = 0; i < length; i += 1) {
param = params[i].replace(/#\S+/g, '').split('=');
query[decodeURIComponent(param[0])] = typeof param[1] === 'undefined' ? undefined : decodeURIComponent(param[1]) || '';
}
}
return query;
},
isObject: function isObject(o) {
return _typeof(o) === 'object' && o !== null && o.constructor && o.constructor === Object;
},
extend: function extend() {
var args = [],
len$1 = arguments.length;
while (len$1--) {
args[len$1] = arguments[len$1];
}
var to = Object(args[0]);
for (var i = 1; i < args.length; i += 1) {
var nextSource = args[i];
if (nextSource !== undefined && nextSource !== null) {
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) {
if (Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
Utils.extend(to[nextKey], nextSource[nextKey]);
} else if (!Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
to[nextKey] = {};
Utils.extend(to[nextKey], nextSource[nextKey]);
} else {
to[nextKey] = nextSource[nextKey];
}
}
}
}
}
return to;
}
};
var Support = function Support() {
var testDiv = doc.createElement('div');
return {
touch: win.Modernizr && win.Modernizr.touch === true || function checkTouch() {
return !!(win.navigator.maxTouchPoints > 0 || 'ontouchstart' in win || win.DocumentTouch && doc instanceof win.DocumentTouch);
}(),
pointerEvents: !!(win.navigator.pointerEnabled || win.PointerEvent || 'maxTouchPoints' in win.navigator && win.navigator.maxTouchPoints > 0),
prefixedPointerEvents: !!win.navigator.msPointerEnabled,
transition: function checkTransition() {
var style = testDiv.style;
return 'transition' in style || 'webkitTransition' in style || 'MozTransition' in style;
}(),
transforms3d: win.Modernizr && win.Modernizr.csstransforms3d === true || function checkTransforms3d() {
var style = testDiv.style;
return 'webkitPerspective' in style || 'MozPerspective' in style || 'OPerspective' in style || 'MsPerspective' in style || 'perspective' in style;
}(),
flexbox: function checkFlexbox() {
var style = testDiv.style;
var styles = 'alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient'.split(' ');
for (var i = 0; i < styles.length; i += 1) {
if (styles[i] in style) {
return true;
}
}
return false;
}(),
observer: function checkObserver() {
return 'MutationObserver' in win || 'WebkitMutationObserver' in win;
}(),
passiveListener: function checkPassiveListener() {
var supportsPassive = false;
try {
var opts = Object.defineProperty({}, 'passive', {
// eslint-disable-next-line
get: function get() {
supportsPassive = true;
}
});
win.addEventListener('testPassiveListener', null, opts);
} catch (e) {// No support
}
return supportsPassive;
}(),
gestures: function checkGestures() {
return 'ongesturestart' in win;
}()
};
}();
var Browser = function Browser() {
function isSafari() {
var ua = win.navigator.userAgent.toLowerCase();
return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
}
return {
isIE: !!win.navigator.userAgent.match(/Trident/g) || !!win.navigator.userAgent.match(/MSIE/g),
isEdge: !!win.navigator.userAgent.match(/Edge/g),
isSafari: isSafari(),
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(win.navigator.userAgent)
};
}();
var SwiperClass = function SwiperClass(params) {
if (params === void 0) params = {};
var self = this;
self.params = params; // Events
self.eventsListeners = {};
if (self.params && self.params.on) {
Object.keys(self.params.on).forEach(function (eventName) {
self.on(eventName, self.params.on[eventName]);
});
}
};
var staticAccessors = {
components: {
configurable: true
}
};
SwiperClass.prototype.on = function on(events, handler, priority) {
var self = this;
if (typeof handler !== 'function') {
return self;
}
var method = priority ? 'unshift' : 'push';
events.split(' ').forEach(function (event) {
if (!self.eventsListeners[event]) {
self.eventsListeners[event] = [];
}
self.eventsListeners[event][method](handler);
});
return self;
};
SwiperClass.prototype.once = function once(events, handler, priority) {
var self = this;
if (typeof handler !== 'function') {
return self;
}
function onceHandler() {
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
handler.apply(self, args);
self.off(events, onceHandler);
if (onceHandler.f7proxy) {
delete onceHandler.f7proxy;
}
}
onceHandler.f7proxy = handler;
return self.on(events, onceHandler, priority);
};
SwiperClass.prototype.off = function off(events, handler) {
var self = this;
if (!self.eventsListeners) {
return self;
}
events.split(' ').forEach(function (event) {
if (typeof handler === 'undefined') {
self.eventsListeners[event] = [];
} else if (self.eventsListeners[event] && self.eventsListeners[event].length) {
self.eventsListeners[event].forEach(function (eventHandler, index) {
if (eventHandler === handler || eventHandler.f7proxy && eventHandler.f7proxy === handler) {
self.eventsListeners[event].splice(index, 1);
}
});
}
});
return self;
};
SwiperClass.prototype.emit = function emit() {
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var self = this;
if (!self.eventsListeners) {
return self;
}
var events;
var data;
var context;
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
events = args[0];
data = args.slice(1, args.length);
context = self;
} else {
events = args[0].events;
data = args[0].data;
context = args[0].context || self;
}
var eventsArray = Array.isArray(events) ? events : events.split(' ');
eventsArray.forEach(function (event) {
if (self.eventsListeners && self.eventsListeners[event]) {
var handlers = [];
self.eventsListeners[event].forEach(function (eventHandler) {
handlers.push(eventHandler);
});
handlers.forEach(function (eventHandler) {
eventHandler.apply(context, data);
});
}
});
return self;
};
SwiperClass.prototype.useModulesParams = function useModulesParams(instanceParams) {
var instance = this;
if (!instance.modules) {
return;
}
Object.keys(instance.modules).forEach(function (moduleName) {
var module = instance.modules[moduleName]; // Extend params
if (module.params) {
Utils.extend(instanceParams, module.params);
}
});
};
SwiperClass.prototype.useModules = function useModules(modulesParams) {
if (modulesParams === void 0) modulesParams = {};
var instance = this;
if (!instance.modules) {
return;
}
Object.keys(instance.modules).forEach(function (moduleName) {
var module = instance.modules[moduleName];
var moduleParams = modulesParams[moduleName] || {}; // Extend instance methods and props
if (module.instance) {
Object.keys(module.instance).forEach(function (modulePropName) {
var moduleProp = module.instance[modulePropName];
if (typeof moduleProp === 'function') {
instance[modulePropName] = moduleProp.bind(instance);
} else {
instance[modulePropName] = moduleProp;
}
});
} // Add event listeners
if (module.on && instance.on) {
Object.keys(module.on).forEach(function (moduleEventName) {
instance.on(moduleEventName, module.on[moduleEventName]);
});
} // Module create callback
if (module.create) {
module.create.bind(instance)(moduleParams);
}
});
};
staticAccessors.components.set = function (components) {
var Class = this;
if (!Class.use) {
return;
}
Class.use(components);
};
SwiperClass.installModule = function installModule(module) {
var params = [],
len = arguments.length - 1;
while (len-- > 0) {
params[len] = arguments[len + 1];
}
var Class = this;
if (!Class.prototype.modules) {
Class.prototype.modules = {};
}
var name = module.name || Object.keys(Class.prototype.modules).length + "_" + Utils.now();
Class.prototype.modules[name] = module; // Prototype
if (module.proto) {
Object.keys(module.proto).forEach(function (key) {
Class.prototype[key] = module.proto[key];
});
} // Class
if (module.static) {
Object.keys(module.static).forEach(function (key) {
Class[key] = module.static[key];
});
} // Callback
if (module.install) {
module.install.apply(Class, params);
}
return Class;
};
SwiperClass.use = function use(module) {
var params = [],
len = arguments.length - 1;
while (len-- > 0) {
params[len] = arguments[len + 1];
}
var Class = this;
if (Array.isArray(module)) {
module.forEach(function (m) {
return Class.installModule(m);
});
return Class;
}
return Class.installModule.apply(Class, [module].concat(params));
};
Object.defineProperties(SwiperClass, staticAccessors);
function updateSize() {
var swiper = this;
var width;
var height;
var $el = swiper.$el;
if (typeof swiper.params.width !== 'undefined') {
width = swiper.params.width;
} else {
width = $el[0].clientWidth;
}
if (typeof swiper.params.height !== 'undefined') {
height = swiper.params.height;
} else {
height = $el[0].clientHeight;
}
if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {
return;
} // Subtract paddings
width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);
height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);
Utils.extend(swiper, {
width: width,
height: height,
size: swiper.isHorizontal() ? width : height
});
}
function updateSlides() {
var swiper = this;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var swiperSize = swiper.size;
var rtl = swiper.rtlTranslate;
var wrongRTL = swiper.wrongRTL;
var isVirtual = swiper.virtual && params.virtual.enabled;
var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
var slides = $wrapperEl.children("." + swiper.params.slideClass);
var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
var snapGrid = [];
var slidesGrid = [];
var slidesSizesGrid = [];
var offsetBefore = params.slidesOffsetBefore;
if (typeof offsetBefore === 'function') {
offsetBefore = params.slidesOffsetBefore.call(swiper);
}
var offsetAfter = params.slidesOffsetAfter;
if (typeof offsetAfter === 'function') {
offsetAfter = params.slidesOffsetAfter.call(swiper);
}
var previousSnapGridLength = swiper.snapGrid.length;
var previousSlidesGridLength = swiper.snapGrid.length;
var spaceBetween = params.spaceBetween;
var slidePosition = -offsetBefore;
var prevSlideSize = 0;
var index = 0;
if (typeof swiperSize === 'undefined') {
return;
}
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;
}
swiper.virtualSize = -spaceBetween; // reset margins
if (rtl) {
slides.css({
marginLeft: '',
marginTop: ''
});
} else {
slides.css({
marginRight: '',
marginBottom: ''
});
}
var slidesNumberEvenToRows;
if (params.slidesPerColumn > 1) {
if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {
slidesNumberEvenToRows = slidesLength;
} else {
slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;
}
if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {
slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);
}
} // Calc slides
var slideSize;
var slidesPerColumn = params.slidesPerColumn;
var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
var numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);
for (var i = 0; i < slidesLength; i += 1) {
slideSize = 0;
var slide = slides.eq(i);
if (params.slidesPerColumn > 1) {
// Set slides order
var newSlideOrderIndex = void 0;
var column = void 0;
var row = void 0;
if (params.slidesPerColumnFill === 'column' || params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {
if (params.slidesPerColumnFill === 'column') {
column = Math.floor(i / slidesPerColumn);
row = i - column * slidesPerColumn;
if (column > numFullColumns || column === numFullColumns && row === slidesPerColumn - 1) {
row += 1;
if (row >= slidesPerColumn) {
row = 0;
column += 1;
}
}
} else {
var groupIndex = Math.floor(i / params.slidesPerGroup);
row = Math.floor(i / params.slidesPerView) - groupIndex * params.slidesPerColumn;
column = i - row * params.slidesPerView - groupIndex * params.slidesPerView;
}
newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
slide.css({
'-webkit-box-ordinal-group': newSlideOrderIndex,
'-moz-box-ordinal-group': newSlideOrderIndex,
'-ms-flex-order': newSlideOrderIndex,
'-webkit-order': newSlideOrderIndex,
order: newSlideOrderIndex
});
} else {
row = Math.floor(i / slidesPerRow);
column = i - row * slidesPerRow;
}
slide.css("margin-" + (swiper.isHorizontal() ? 'top' : 'left'), row !== 0 && params.spaceBetween && params.spaceBetween + "px").attr('data-swiper-column', column).attr('data-swiper-row', row);
}
if (slide.css('display') === 'none') {
continue;
} // eslint-disable-line
if (params.slidesPerView === 'auto') {
var slideStyles = win.getComputedStyle(slide[0], null);
var currentTransform = slide[0].style.transform;
var currentWebKitTransform = slide[0].style.webkitTransform;
if (currentTransform) {
slide[0].style.transform = 'none';
}
if (currentWebKitTransform) {
slide[0].style.webkitTransform = 'none';
}
if (params.roundLengths) {
slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
} else {
// eslint-disable-next-line
if (swiper.isHorizontal()) {
var width = parseFloat(slideStyles.getPropertyValue('width'));
var paddingLeft = parseFloat(slideStyles.getPropertyValue('padding-left'));
var paddingRight = parseFloat(slideStyles.getPropertyValue('padding-right'));
var marginLeft = parseFloat(slideStyles.getPropertyValue('margin-left'));
var marginRight = parseFloat(slideStyles.getPropertyValue('margin-right'));
var boxSizing = slideStyles.getPropertyValue('box-sizing');
if (boxSizing && boxSizing === 'border-box' && !Browser.isIE) {
slideSize = width + marginLeft + marginRight;
} else {
slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight;
}
} else {
var height = parseFloat(slideStyles.getPropertyValue('height'));
var paddingTop = parseFloat(slideStyles.getPropertyValue('padding-top'));
var paddingBottom = parseFloat(slideStyles.getPropertyValue('padding-bottom'));
var marginTop = parseFloat(slideStyles.getPropertyValue('margin-top'));
var marginBottom = parseFloat(slideStyles.getPropertyValue('margin-bottom'));
var boxSizing$1 = slideStyles.getPropertyValue('box-sizing');
if (boxSizing$1 && boxSizing$1 === 'border-box' && !Browser.isIE) {
slideSize = height + marginTop + marginBottom;
} else {
slideSize = height + paddingTop + paddingBottom + marginTop + marginBottom;
}
}
}
if (currentTransform) {
slide[0].style.transform = currentTransform;
}
if (currentWebKitTransform) {
slide[0].style.webkitTransform = currentWebKitTransform;
}
if (params.roundLengths) {
slideSize = Math.floor(slideSize);
}
} else {
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
if (params.roundLengths) {
slideSize = Math.floor(slideSize);
}
if (slides[i]) {
if (swiper.isHorizontal()) {
slides[i].style.width = slideSize + "px";
} else {
slides[i].style.height = slideSize + "px";
}
}
}
if (slides[i]) {
slides[i].swiperSlideSize = slideSize;
}
slidesSizesGrid.push(slideSize);
if (params.centeredSlides) {
slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
if (prevSlideSize === 0 && i !== 0) {
slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
}
if (i === 0) {
slidePosition = slidePosition - swiperSize / 2 - spaceBetween;
}
if (Math.abs(slidePosition) < 1 / 1000) {
slidePosition = 0;
}
if (params.roundLengths) {
slidePosition = Math.floor(slidePosition);
}
if (index % params.slidesPerGroup === 0) {
snapGrid.push(slidePosition);
}
slidesGrid.push(slidePosition);
} else {
if (params.roundLengths) {
slidePosition = Math.floor(slidePosition);
}
if (index % params.slidesPerGroup === 0) {
snapGrid.push(slidePosition);
}
slidesGrid.push(slidePosition);
slidePosition = slidePosition + slideSize + spaceBetween;
}
swiper.virtualSize += slideSize + spaceBetween;
prevSlideSize = slideSize;
index += 1;
}
swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
var newSlidesGrid;
if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
$wrapperEl.css({
width: swiper.virtualSize + params.spaceBetween + "px"
});
}
if (!Support.flexbox || params.setWrapperSize) {
if (swiper.isHorizontal()) {
$wrapperEl.css({
width: swiper.virtualSize + params.spaceBetween + "px"
});
} else {
$wrapperEl.css({
height: swiper.virtualSize + params.spaceBetween + "px"
});
}
}
if (params.slidesPerColumn > 1) {
swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;
swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;
if (swiper.isHorizontal()) {
$wrapperEl.css({
width: swiper.virtualSize + params.spaceBetween + "px"
});
} else {
$wrapperEl.css({
height: swiper.virtualSize + params.spaceBetween + "px"
});
}
if (params.centeredSlides) {
newSlidesGrid = [];
for (var i$1 = 0; i$1 < snapGrid.length; i$1 += 1) {
var slidesGridItem = snapGrid[i$1];
if (params.roundLengths) {
slidesGridItem = Math.floor(slidesGridItem);
}
if (snapGrid[i$1] < swiper.virtualSize + snapGrid[0]) {
newSlidesGrid.push(slidesGridItem);
}
}
snapGrid = newSlidesGrid;
}
} // Remove last grid elements depending on width
if (!params.centeredSlides) {
newSlidesGrid = [];
for (var i$2 = 0; i$2 < snapGrid.length; i$2 += 1) {
var slidesGridItem$1 = snapGrid[i$2];
if (params.roundLengths) {
slidesGridItem$1 = Math.floor(slidesGridItem$1);
}
if (snapGrid[i$2] <= swiper.virtualSize - swiperSize) {
newSlidesGrid.push(slidesGridItem$1);
}
}
snapGrid = newSlidesGrid;
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
snapGrid.push(swiper.virtualSize - swiperSize);
}
}
if (snapGrid.length === 0) {
snapGrid = [0];
}
if (params.spaceBetween !== 0) {
if (swiper.isHorizontal()) {
if (rtl) {
slides.css({
marginLeft: spaceBetween + "px"
});
} else {
slides.css({
marginRight: spaceBetween + "px"
});
}
} else {
slides.css({
marginBottom: spaceBetween + "px"
});
}
}
if (params.centerInsufficientSlides) {
var allSlidesSize = 0;
slidesSizesGrid.forEach(function (slideSizeValue) {
allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
});
allSlidesSize -= params.spaceBetween;
if (allSlidesSize < swiperSize) {
var allSlidesOffset = (swiperSize - allSlidesSize) / 2;
snapGrid.forEach(function (snap, snapIndex) {
snapGrid[snapIndex] = snap - allSlidesOffset;
});
slidesGrid.forEach(function (snap, snapIndex) {
slidesGrid[snapIndex] = snap + allSlidesOffset;
});
}
}
Utils.extend(swiper, {
slides: slides,
snapGrid: snapGrid,
slidesGrid: slidesGrid,
slidesSizesGrid: slidesSizesGrid
});
if (slidesLength !== previousSlidesLength) {
swiper.emit('slidesLengthChange');
}
if (snapGrid.length !== previousSnapGridLength) {
if (swiper.params.watchOverflow) {
swiper.checkOverflow();
}
swiper.emit('snapGridLengthChange');
}
if (slidesGrid.length !== previousSlidesGridLength) {
swiper.emit('slidesGridLengthChange');
}
if (params.watchSlidesProgress || params.watchSlidesVisibility) {
swiper.updateSlidesOffset();
}
}
function updateAutoHeight(speed) {
var swiper = this;
var activeSlides = [];
var newHeight = 0;
var i;
if (typeof speed === 'number') {
swiper.setTransition(speed);
} else if (speed === true) {
swiper.setTransition(swiper.params.speed);
} // Find slides currently in view
if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
var index = swiper.activeIndex + i;
if (index > swiper.slides.length) {
break;
}
activeSlides.push(swiper.slides.eq(index)[0]);
}
} else {
activeSlides.push(swiper.slides.eq(swiper.activeIndex)[0]);
} // Find new height from highest slide in view
for (i = 0; i < activeSlides.length; i += 1) {
if (typeof activeSlides[i] !== 'undefined') {
var height = activeSlides[i].offsetHeight;
newHeight = height > newHeight ? height : newHeight;
}
} // Update Height
if (newHeight) {
swiper.$wrapperEl.css('height', newHeight + "px");
}
}
function updateSlidesOffset() {
var swiper = this;
var slides = swiper.slides;
for (var i = 0; i < slides.length; i += 1) {
slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
}
}
function updateSlidesProgress(translate) {
if (translate === void 0) translate = this && this.translate || 0;
var swiper = this;
var params = swiper.params;
var slides = swiper.slides;
var rtl = swiper.rtlTranslate;
if (slides.length === 0) {
return;
}
if (typeof slides[0].swiperSlideOffset === 'undefined') {
swiper.updateSlidesOffset();
}
var offsetCenter = -translate;
if (rtl) {
offsetCenter = translate;
} // Visible Slides
slides.removeClass(params.slideVisibleClass);
swiper.visibleSlidesIndexes = [];
swiper.visibleSlides = [];
for (var i = 0; i < slides.length; i += 1) {
var slide = slides[i];
var slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + params.spaceBetween);
if (params.watchSlidesVisibility) {
var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
var slideAfter = slideBefore + swiper.slidesSizesGrid[i];
var isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
if (isVisible) {
swiper.visibleSlides.push(slide);
swiper.visibleSlidesIndexes.push(i);
slides.eq(i).addClass(params.slideVisibleClass);
}
}
slide.progress = rtl ? -slideProgress : slideProgress;
}
swiper.visibleSlides = $(swiper.visibleSlides);
}
function updateProgress(translate) {
if (translate === void 0) translate = this && this.translate || 0;
var swiper = this;
var params = swiper.params;
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
var progress = swiper.progress;
var isBeginning = swiper.isBeginning;
var isEnd = swiper.isEnd;
var wasBeginning = isBeginning;
var wasEnd = isEnd;
if (translatesDiff === 0) {
progress = 0;
isBeginning = true;
isEnd = true;
} else {
progress = (translate - swiper.minTranslate()) / translatesDiff;
isBeginning = progress <= 0;
isEnd = progress >= 1;
}
Utils.extend(swiper, {
progress: progress,
isBeginning: isBeginning,
isEnd: isEnd
});
if (params.watchSlidesProgress || params.watchSlidesVisibility) {
swiper.updateSlidesProgress(translate);
}
if (isBeginning && !wasBeginning) {
swiper.emit('reachBeginning toEdge');
}
if (isEnd && !wasEnd) {
swiper.emit('reachEnd toEdge');
}
if (wasBeginning && !isBeginning || wasEnd && !isEnd) {
swiper.emit('fromEdge');
}
swiper.emit('progress', progress);
}
function updateSlidesClasses() {
var swiper = this;
var slides = swiper.slides;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var activeIndex = swiper.activeIndex;
var realIndex = swiper.realIndex;
var isVirtual = swiper.virtual && params.virtual.enabled;
slides.removeClass(params.slideActiveClass + " " + params.slideNextClass + " " + params.slidePrevClass + " " + params.slideDuplicateActiveClass + " " + params.slideDuplicateNextClass + " " + params.slideDuplicatePrevClass);
var activeSlide;
if (isVirtual) {
activeSlide = swiper.$wrapperEl.find("." + params.slideClass + "[data-swiper-slide-index=\"" + activeIndex + "\"]");
} else {
activeSlide = slides.eq(activeIndex);
} // Active classes
activeSlide.addClass(params.slideActiveClass);
if (params.loop) {
// Duplicate to all looped slides
if (activeSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + realIndex + "\"]").addClass(params.slideDuplicateActiveClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + realIndex + "\"]").addClass(params.slideDuplicateActiveClass);
}
} // Next Slide
var nextSlide = activeSlide.nextAll("." + params.slideClass).eq(0).addClass(params.slideNextClass);
if (params.loop && nextSlide.length === 0) {
nextSlide = slides.eq(0);
nextSlide.addClass(params.slideNextClass);
} // Prev Slide
var prevSlide = activeSlide.prevAll("." + params.slideClass).eq(0).addClass(params.slidePrevClass);
if (params.loop && prevSlide.length === 0) {
prevSlide = slides.eq(-1);
prevSlide.addClass(params.slidePrevClass);
}
if (params.loop) {
// Duplicate to all looped slides
if (nextSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + nextSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicateNextClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + nextSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicateNextClass);
}
if (prevSlide.hasClass(params.slideDuplicateClass)) {
$wrapperEl.children("." + params.slideClass + ":not(." + params.slideDuplicateClass + ")[data-swiper-slide-index=\"" + prevSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicatePrevClass);
} else {
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + "[data-swiper-slide-index=\"" + prevSlide.attr('data-swiper-slide-index') + "\"]").addClass(params.slideDuplicatePrevClass);
}
}
}
function updateActiveIndex(newActiveIndex) {
var swiper = this;
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
var slidesGrid = swiper.slidesGrid;
var snapGrid = swiper.snapGrid;
var params = swiper.params;
var previousIndex = swiper.activeIndex;
var previousRealIndex = swiper.realIndex;
var previousSnapIndex = swiper.snapIndex;
var activeIndex = newActiveIndex;
var snapIndex;
if (typeof activeIndex === 'undefined') {
for (var i = 0; i < slidesGrid.length; i += 1) {
if (typeof slidesGrid[i + 1] !== 'undefined') {
if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
activeIndex = i;
} else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
activeIndex = i + 1;
}
} else if (translate >= slidesGrid[i]) {
activeIndex = i;
}
} // Normalize slideIndex
if (params.normalizeSlideIndex) {
if (activeIndex < 0 || typeof activeIndex === 'undefined') {
activeIndex = 0;
}
}
}
if (snapGrid.indexOf(translate) >= 0) {
snapIndex = snapGrid.indexOf(translate);
} else {
snapIndex = Math.floor(activeIndex / params.slidesPerGroup);
}
if (snapIndex >= snapGrid.length) {
snapIndex = snapGrid.length - 1;
}
if (activeIndex === previousIndex) {
if (snapIndex !== previousSnapIndex) {
swiper.snapIndex = snapIndex;
swiper.emit('snapIndexChange');
}
return;
} // Get real index
var realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
Utils.extend(swiper, {
snapIndex: snapIndex,
realIndex: realIndex,
previousIndex: previousIndex,
activeIndex: activeIndex
});
swiper.emit('activeIndexChange');
swiper.emit('snapIndexChange');
if (previousRealIndex !== realIndex) {
swiper.emit('realIndexChange');
}
if (swiper.initialized || swiper.runCallbacksOnInit) {
swiper.emit('slideChange');
}
}
function updateClickedSlide(e) {
var swiper = this;
var params = swiper.params;
var slide = $(e.target).closest("." + params.slideClass)[0];
var slideFound = false;
if (slide) {
for (var i = 0; i < swiper.slides.length; i += 1) {
if (swiper.slides[i] === slide) {
slideFound = true;
}
}
}
if (slide && slideFound) {
swiper.clickedSlide = slide;
if (swiper.virtual && swiper.params.virtual.enabled) {
swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);
} else {
swiper.clickedIndex = $(slide).index();
}
} else {
swiper.clickedSlide = undefined;
swiper.clickedIndex = undefined;
return;
}
if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
swiper.slideToClickedSlide();
}
}
var update = {
updateSize: updateSize,
updateSlides: updateSlides,
updateAutoHeight: updateAutoHeight,
updateSlidesOffset: updateSlidesOffset,
updateSlidesProgress: updateSlidesProgress,
updateProgress: updateProgress,
updateSlidesClasses: updateSlidesClasses,
updateActiveIndex: updateActiveIndex,
updateClickedSlide: updateClickedSlide
};
function getTranslate(axis) {
if (axis === void 0) axis = this.isHorizontal() ? 'x' : 'y';
var swiper = this;
var params = swiper.params;
var rtl = swiper.rtlTranslate;
var translate = swiper.translate;
var $wrapperEl = swiper.$wrapperEl;
if (params.virtualTranslate) {
return rtl ? -translate : translate;
}
var currentTranslate = Utils.getTranslate($wrapperEl[0], axis);
if (rtl) {
currentTranslate = -currentTranslate;
}
return currentTranslate || 0;
}
function setTranslate(translate, byController) {
var swiper = this;
var rtl = swiper.rtlTranslate;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var progress = swiper.progress;
var x = 0;
var y = 0;
var z = 0;
if (swiper.isHorizontal()) {
x = rtl ? -translate : translate;
} else {
y = translate;
}
if (params.roundLengths) {
x = Math.floor(x);
y = Math.floor(y);
}
if (!params.virtualTranslate) {
if (Support.transforms3d) {
$wrapperEl.transform("translate3d(" + x + "px, " + y + "px, " + z + "px)");
} else {
$wrapperEl.transform("translate(" + x + "px, " + y + "px)");
}
}
swiper.previousTranslate = swiper.translate;
swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress
var newProgress;
var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
if (translatesDiff === 0) {
newProgress = 0;
} else {
newProgress = (translate - swiper.minTranslate()) / translatesDiff;
}
if (newProgress !== progress) {
swiper.updateProgress(translate);
}
swiper.emit('setTranslate', swiper.translate, byController);
}
function minTranslate() {
return -this.snapGrid[0];
}
function maxTranslate() {
return -this.snapGrid[this.snapGrid.length - 1];
}
var translate = {
getTranslate: getTranslate,
setTranslate: setTranslate,
minTranslate: minTranslate,
maxTranslate: maxTranslate
};
function setTransition(duration, byController) {
var swiper = this;
swiper.$wrapperEl.transition(duration);
swiper.emit('setTransition', duration, byController);
}
function transitionStart(runCallbacks, direction) {
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var activeIndex = swiper.activeIndex;
var params = swiper.params;
var previousIndex = swiper.previousIndex;
if (params.autoHeight) {
swiper.updateAutoHeight();
}
var dir = direction;
if (!dir) {
if (activeIndex > previousIndex) {
dir = 'next';
} else if (activeIndex < previousIndex) {
dir = 'prev';
} else {
dir = 'reset';
}
}
swiper.emit('transitionStart');
if (runCallbacks && activeIndex !== previousIndex) {
if (dir === 'reset') {
swiper.emit('slideResetTransitionStart');
return;
}
swiper.emit('slideChangeTransitionStart');
if (dir === 'next') {
swiper.emit('slideNextTransitionStart');
} else {
swiper.emit('slidePrevTransitionStart');
}
}
}
function transitionEnd$1(runCallbacks, direction) {
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var activeIndex = swiper.activeIndex;
var previousIndex = swiper.previousIndex;
swiper.animating = false;
swiper.setTransition(0);
var dir = direction;
if (!dir) {
if (activeIndex > previousIndex) {
dir = 'next';
} else if (activeIndex < previousIndex) {
dir = 'prev';
} else {
dir = 'reset';
}
}
swiper.emit('transitionEnd');
if (runCallbacks && activeIndex !== previousIndex) {
if (dir === 'reset') {
swiper.emit('slideResetTransitionEnd');
return;
}
swiper.emit('slideChangeTransitionEnd');
if (dir === 'next') {
swiper.emit('slideNextTransitionEnd');
} else {
swiper.emit('slidePrevTransitionEnd');
}
}
}
var transition$1 = {
setTransition: setTransition,
transitionStart: transitionStart,
transitionEnd: transitionEnd$1
};
function slideTo(index, speed, runCallbacks, internal) {
if (index === void 0) index = 0;
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var slideIndex = index;
if (slideIndex < 0) {
slideIndex = 0;
}
var params = swiper.params;
var snapGrid = swiper.snapGrid;
var slidesGrid = swiper.slidesGrid;
var previousIndex = swiper.previousIndex;
var activeIndex = swiper.activeIndex;
var rtl = swiper.rtlTranslate;
if (swiper.animating && params.preventInteractionOnTransition) {
return false;
}
var snapIndex = Math.floor(slideIndex / params.slidesPerGroup);
if (snapIndex >= snapGrid.length) {
snapIndex = snapGrid.length - 1;
}
if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {
swiper.emit('beforeSlideChangeStart');
}
var translate = -snapGrid[snapIndex]; // Update progress
swiper.updateProgress(translate); // Normalize slideIndex
if (params.normalizeSlideIndex) {
for (var i = 0; i < slidesGrid.length; i += 1) {
if (-Math.floor(translate * 100) >= Math.floor(slidesGrid[i] * 100)) {
slideIndex = i;
}
}
} // Directions locks
if (swiper.initialized && slideIndex !== activeIndex) {
if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
return false;
}
if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
if ((activeIndex || 0) !== slideIndex) {
return false;
}
}
}
var direction;
if (slideIndex > activeIndex) {
direction = 'next';
} else if (slideIndex < activeIndex) {
direction = 'prev';
} else {
direction = 'reset';
} // Update Index
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
swiper.updateActiveIndex(slideIndex); // Update Height
if (params.autoHeight) {
swiper.updateAutoHeight();
}
swiper.updateSlidesClasses();
if (params.effect !== 'slide') {
swiper.setTranslate(translate);
}
if (direction !== 'reset') {
swiper.transitionStart(runCallbacks, direction);
swiper.transitionEnd(runCallbacks, direction);
}
return false;
}
if (speed === 0 || !Support.transition) {
swiper.setTransition(0);
swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks, direction);
swiper.transitionEnd(runCallbacks, direction);
} else {
swiper.setTransition(speed);
swiper.setTranslate(translate);
swiper.updateActiveIndex(slideIndex);
swiper.updateSlidesClasses();
swiper.emit('beforeTransitionStart', speed, internal);
swiper.transitionStart(runCallbacks, direction);
if (!swiper.animating) {
swiper.animating = true;
if (!swiper.onSlideToWrapperTransitionEnd) {
swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
if (!swiper || swiper.destroyed) {
return;
}
if (e.target !== this) {
return;
}
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
swiper.onSlideToWrapperTransitionEnd = null;
delete swiper.onSlideToWrapperTransitionEnd;
swiper.transitionEnd(runCallbacks, direction);
};
}
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
}
}
return true;
}
function slideToLoop(index, speed, runCallbacks, internal) {
if (index === void 0) index = 0;
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var newIndex = index;
if (swiper.params.loop) {
newIndex += swiper.loopedSlides;
}
return swiper.slideTo(newIndex, speed, runCallbacks, internal);
}
/* eslint no-unused-vars: "off" */
function slideNext(speed, runCallbacks, internal) {
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var params = swiper.params;
var animating = swiper.animating;
if (params.loop) {
if (animating) {
return false;
}
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
return swiper.slideTo(swiper.activeIndex + params.slidesPerGroup, speed, runCallbacks, internal);
}
return swiper.slideTo(swiper.activeIndex + params.slidesPerGroup, speed, runCallbacks, internal);
}
/* eslint no-unused-vars: "off" */
function slidePrev(speed, runCallbacks, internal) {
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var params = swiper.params;
var animating = swiper.animating;
var snapGrid = swiper.snapGrid;
var slidesGrid = swiper.slidesGrid;
var rtlTranslate = swiper.rtlTranslate;
if (params.loop) {
if (animating) {
return false;
}
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
var translate = rtlTranslate ? swiper.translate : -swiper.translate;
function normalize(val) {
if (val < 0) {
return -Math.floor(Math.abs(val));
}
return Math.floor(val);
}
var normalizedTranslate = normalize(translate);
var normalizedSnapGrid = snapGrid.map(function (val) {
return normalize(val);
});
var normalizedSlidesGrid = slidesGrid.map(function (val) {
return normalize(val);
});
var currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
var prevIndex;
if (typeof prevSnap !== 'undefined') {
prevIndex = slidesGrid.indexOf(prevSnap);
if (prevIndex < 0) {
prevIndex = swiper.activeIndex - 1;
}
}
return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
}
/* eslint no-unused-vars: "off" */
function slideReset(speed, runCallbacks, internal) {
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
}
/* eslint no-unused-vars: "off" */
function slideToClosest(speed, runCallbacks, internal) {
if (speed === void 0) speed = this.params.speed;
if (runCallbacks === void 0) runCallbacks = true;
var swiper = this;
var index = swiper.activeIndex;
var snapIndex = Math.floor(index / swiper.params.slidesPerGroup);
if (snapIndex < swiper.snapGrid.length - 1) {
var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
var currentSnap = swiper.snapGrid[snapIndex];
var nextSnap = swiper.snapGrid[snapIndex + 1];
if (translate - currentSnap > (nextSnap - currentSnap) / 2) {
index = swiper.params.slidesPerGroup;
}
}
return swiper.slideTo(index, speed, runCallbacks, internal);
}
function slideToClickedSlide() {
var swiper = this;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
var slideToIndex = swiper.clickedIndex;
var realIndex;
if (params.loop) {
if (swiper.animating) {
return;
}
realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
if (params.centeredSlides) {
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
swiper.loopFix();
slideToIndex = $wrapperEl.children("." + params.slideClass + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + params.slideDuplicateClass + ")").eq(0).index();
Utils.nextTick(function () {
swiper.slideTo(slideToIndex);
});
} else {
swiper.slideTo(slideToIndex);
}
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
swiper.loopFix();
slideToIndex = $wrapperEl.children("." + params.slideClass + "[data-swiper-slide-index=\"" + realIndex + "\"]:not(." + params.slideDuplicateClass + ")").eq(0).index();
Utils.nextTick(function () {
swiper.slideTo(slideToIndex);
});
} else {
swiper.slideTo(slideToIndex);
}
} else {
swiper.slideTo(slideToIndex);
}
}
var slide = {
slideTo: slideTo,
slideToLoop: slideToLoop,
slideNext: slideNext,
slidePrev: slidePrev,
slideReset: slideReset,
slideToClosest: slideToClosest,
slideToClickedSlide: slideToClickedSlide
};
function loopCreate() {
var swiper = this;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl; // Remove duplicated slides
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass).remove();
var slides = $wrapperEl.children("." + params.slideClass);
if (params.loopFillGroupWithBlank) {
var blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;
if (blankSlidesNum !== params.slidesPerGroup) {
for (var i = 0; i < blankSlidesNum; i += 1) {
var blankNode = $(doc.createElement('div')).addClass(params.slideClass + " " + params.slideBlankClass);
$wrapperEl.append(blankNode);
}
slides = $wrapperEl.children("." + params.slideClass);
}
}
if (params.slidesPerView === 'auto' && !params.loopedSlides) {
params.loopedSlides = slides.length;
}
swiper.loopedSlides = parseInt(params.loopedSlides || params.slidesPerView, 10);
swiper.loopedSlides += params.loopAdditionalSlides;
if (swiper.loopedSlides > slides.length) {
swiper.loopedSlides = slides.length;
}
var prependSlides = [];
var appendSlides = [];
slides.each(function (index, el) {
var slide = $(el);
if (index < swiper.loopedSlides) {
appendSlides.push(el);
}
if (index < slides.length && index >= slides.length - swiper.loopedSlides) {
prependSlides.push(el);
}
slide.attr('data-swiper-slide-index', index);
});
for (var i$1 = 0; i$1 < appendSlides.length; i$1 += 1) {
$wrapperEl.append($(appendSlides[i$1].cloneNode(true)).addClass(params.slideDuplicateClass));
}
for (var i$2 = prependSlides.length - 1; i$2 >= 0; i$2 -= 1) {
$wrapperEl.prepend($(prependSlides[i$2].cloneNode(true)).addClass(params.slideDuplicateClass));
}
}
function loopFix() {
var swiper = this;
var params = swiper.params;
var activeIndex = swiper.activeIndex;
var slides = swiper.slides;
var loopedSlides = swiper.loopedSlides;
var allowSlidePrev = swiper.allowSlidePrev;
var allowSlideNext = swiper.allowSlideNext;
var snapGrid = swiper.snapGrid;
var rtl = swiper.rtlTranslate;
var newIndex;
swiper.allowSlidePrev = true;
swiper.allowSlideNext = true;
var snapTranslate = -snapGrid[activeIndex];
var diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding
if (activeIndex < loopedSlides) {
newIndex = slides.length - loopedSlides * 3 + activeIndex;
newIndex += loopedSlides;
var slideChanged = swiper.slideTo(newIndex, 0, false, true);
if (slideChanged && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
} else if (params.slidesPerView === 'auto' && activeIndex >= loopedSlides * 2 || activeIndex >= slides.length - loopedSlides) {
// Fix For Positive Oversliding
newIndex = -slides.length + activeIndex + loopedSlides;
newIndex += loopedSlides;
var slideChanged$1 = swiper.slideTo(newIndex, 0, false, true);
if (slideChanged$1 && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
}
swiper.allowSlidePrev = allowSlidePrev;
swiper.allowSlideNext = allowSlideNext;
}
function loopDestroy() {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl;
var params = swiper.params;
var slides = swiper.slides;
$wrapperEl.children("." + params.slideClass + "." + params.slideDuplicateClass + ",." + params.slideClass + "." + params.slideBlankClass).remove();
slides.removeAttr('data-swiper-slide-index');
}
var loop = {
loopCreate: loopCreate,
loopFix: loopFix,
loopDestroy: loopDestroy
};
function setGrabCursor(moving) {
var swiper = this;
if (Support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked) {
return;
}
var el = swiper.el;
el.style.cursor = 'move';
el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
el.style.cursor = moving ? 'grabbing' : 'grab';
}
function unsetGrabCursor() {
var swiper = this;
if (Support.touch || swiper.params.watchOverflow && swiper.isLocked) {
return;
}
swiper.el.style.cursor = '';
}
var grabCursor = {
setGrabCursor: setGrabCursor,
unsetGrabCursor: unsetGrabCursor
};
function appendSlide(slides) {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl;
var params = swiper.params;
if (params.loop) {
swiper.loopDestroy();
}
if (_typeof(slides) === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) {
$wrapperEl.append(slides[i]);
}
}
} else {
$wrapperEl.append(slides);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
}
function prependSlide(slides) {
var swiper = this;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var activeIndex = swiper.activeIndex;
if (params.loop) {
swiper.loopDestroy();
}
var newActiveIndex = activeIndex + 1;
if (_typeof(slides) === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) {
$wrapperEl.prepend(slides[i]);
}
}
newActiveIndex = activeIndex + slides.length;
} else {
$wrapperEl.prepend(slides);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
swiper.slideTo(newActiveIndex, 0, false);
}
function addSlide(index, slides) {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl;
var params = swiper.params;
var activeIndex = swiper.activeIndex;
var activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children("." + params.slideClass);
}
var baseLength = swiper.slides.length;
if (index <= 0) {
swiper.prependSlide(slides);
return;
}
if (index >= baseLength) {
swiper.appendSlide(slides);
return;
}
var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
var slidesBuffer = [];
for (var i = baseLength - 1; i >= index; i -= 1) {
var currentSlide = swiper.slides.eq(i);
currentSlide.remove();
slidesBuffer.unshift(currentSlide);
}
if (_typeof(slides) === 'object' && 'length' in slides) {
for (var i$1 = 0; i$1 < slides.length; i$1 += 1) {
if (slides[i$1]) {
$wrapperEl.append(slides[i$1]);
}
}
newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
} else {
$wrapperEl.append(slides);
}
for (var i$2 = 0; i$2 < slidesBuffer.length; i$2 += 1) {
$wrapperEl.append(slidesBuffer[i$2]);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
function removeSlide(slidesIndexes) {
var swiper = this;
var params = swiper.params;
var $wrapperEl = swiper.$wrapperEl;
var activeIndex = swiper.activeIndex;
var activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children("." + params.slideClass);
}
var newActiveIndex = activeIndexBuffer;
var indexToRemove;
if (_typeof(slidesIndexes) === 'object' && 'length' in slidesIndexes) {
for (var i = 0; i < slidesIndexes.length; i += 1) {
indexToRemove = slidesIndexes[i];
if (swiper.slides[indexToRemove]) {
swiper.slides.eq(indexToRemove).remove();
}
if (indexToRemove < newActiveIndex) {
newActiveIndex -= 1;
}
}
newActiveIndex = Math.max(newActiveIndex, 0);
} else {
indexToRemove = slidesIndexes;
if (swiper.slides[indexToRemove]) {
swiper.slides.eq(indexToRemove).remove();
}
if (indexToRemove < newActiveIndex) {
newActiveIndex -= 1;
}
newActiveIndex = Math.max(newActiveIndex, 0);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
function removeAllSlides() {
var swiper = this;
var slidesIndexes = [];
for (var i = 0; i < swiper.slides.length; i += 1) {
slidesIndexes.push(i);
}
swiper.removeSlide(slidesIndexes);
}
var manipulation = {
appendSlide: appendSlide,
prependSlide: prependSlide,
addSlide: addSlide,
removeSlide: removeSlide,
removeAllSlides: removeAllSlides
};
var Device = function Device() {
var ua = win.navigator.userAgent;
var device = {
ios: false,
android: false,
androidChrome: false,
desktop: false,
windows: false,
iphone: false,
ipod: false,
ipad: false,
cordova: win.cordova || win.phonegap,
phonegap: win.cordova || win.phonegap
};
var windows = ua.match(/(Windows Phone);?[\s\/]+([\d.]+)?/); // eslint-disable-line
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
var iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); // Windows
if (windows) {
device.os = 'windows';
device.osVersion = windows[2];
device.windows = true;
} // Android
if (android && !windows) {
device.os = 'android';
device.osVersion = android[2];
device.android = true;
device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;
}
if (ipad || iphone || ipod) {
device.os = 'ios';
device.ios = true;
} // iOS
if (iphone && !ipod) {
device.osVersion = iphone[2].replace(/_/g, '.');
device.iphone = true;
}
if (ipad) {
device.osVersion = ipad[2].replace(/_/g, '.');
device.ipad = true;
}
if (ipod) {
device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
device.iphone = true;
} // iOS 8+ changed UA
if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {
if (device.osVersion.split('.')[0] === '10') {
device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];
}
} // Desktop
device.desktop = !(device.os || device.android || device.webView); // Webview
device.webView = (iphone || ipad || ipod) && ua.match(/.*AppleWebKit(?!.*Safari)/i); // Minimal UI
if (device.os && device.os === 'ios') {
var osVersionArr = device.osVersion.split('.');
var metaViewport = doc.querySelector('meta[name="viewport"]');
device.minimalUi = !device.webView && (ipod || iphone) && (osVersionArr[0] * 1 === 7 ? osVersionArr[1] * 1 >= 1 : osVersionArr[0] * 1 > 7) && metaViewport && metaViewport.getAttribute('content').indexOf('minimal-ui') >= 0;
} // Pixel Ratio
device.pixelRatio = win.devicePixelRatio || 1; // Export object
return device;
}();
function onTouchStart(event) {
var swiper = this;
var data = swiper.touchEventsData;
var params = swiper.params;
var touches = swiper.touches;
if (swiper.animating && params.preventInteractionOnTransition) {
return;
}
var e = event;
if (e.originalEvent) {
e = e.originalEvent;
}
data.isTouchEvent = e.type === 'touchstart';
if (!data.isTouchEvent && 'which' in e && e.which === 3) {
return;
}
if (!data.isTouchEvent && 'button' in e && e.button > 0) {
return;
}
if (data.isTouched && data.isMoved) {
return;
}
if (params.noSwiping && $(e.target).closest(params.noSwipingSelector ? params.noSwipingSelector : "." + params.noSwipingClass)[0]) {
swiper.allowClick = true;
return;
}
if (params.swipeHandler) {
if (!$(e).closest(params.swipeHandler)[0]) {
return;
}
}
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
var startX = touches.currentX;
var startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= win.screen.width - edgeSwipeThreshold)) {
return;
}
Utils.extend(data, {
isTouched: true,
isMoved: false,
allowTouchCallbacks: true,
isScrolling: undefined,
startMoving: undefined
});
touches.startX = startX;
touches.startY = startY;
data.touchStartTime = Utils.now();
swiper.allowClick = true;
swiper.updateSize();
swiper.swipeDirection = undefined;
if (params.threshold > 0) {
data.allowThresholdMove = false;
}
if (e.type !== 'touchstart') {
var preventDefault = true;
if ($(e.target).is(data.formElements)) {
preventDefault = false;
}
if (doc.activeElement && $(doc.activeElement).is(data.formElements) && doc.activeElement !== e.target) {
doc.activeElement.blur();
}
var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
if (params.touchStartForcePreventDefault || shouldPreventDefault) {
e.preventDefault();
}
}
swiper.emit('touchStart', e);
}
function onTouchMove(event) {
var swiper = this;
var data = swiper.touchEventsData;
var params = swiper.params;
var touches = swiper.touches;
var rtl = swiper.rtlTranslate;
var e = event;
if (e.originalEvent) {
e = e.originalEvent;
}
if (!data.isTouched) {
if (data.startMoving && data.isScrolling) {
swiper.emit('touchMoveOpposite', e);
}
return;
}
if (data.isTouchEvent && e.type === 'mousemove') {
return;
}
var pageX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
var pageY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
if (e.preventedByNestedSwiper) {
touches.startX = pageX;
touches.startY = pageY;
return;
}
if (!swiper.allowTouchMove) {
// isMoved = true;
swiper.allowClick = false;
if (data.isTouched) {
Utils.extend(touches, {
startX: pageX,
startY: pageY,
currentX: pageX,
currentY: pageY
});
data.touchStartTime = Utils.now();
}
return;
}
if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
if (swiper.isVertical()) {
// Vertical
if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
data.isTouched = false;
data.isMoved = false;
return;
}
} else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
return;
}
}
if (data.isTouchEvent && doc.activeElement) {
if (e.target === doc.activeElement && $(e.target).is(data.formElements)) {
data.isMoved = true;
swiper.allowClick = false;
return;
}
}
if (data.allowTouchCallbacks) {
swiper.emit('touchMove', e);
}
if (e.targetTouches && e.targetTouches.length > 1) {
return;
}
touches.currentX = pageX;
touches.currentY = pageY;
var diffX = touches.currentX - touches.startX;
var diffY = touches.currentY - touches.startY;
if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold) {
return;
}
if (typeof data.isScrolling === 'undefined') {
var touchAngle;
if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
data.isScrolling = false;
} else {
// eslint-disable-next-line
if (diffX * diffX + diffY * diffY >= 25) {
touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
}
}
}
if (data.isScrolling) {
swiper.emit('touchMoveOpposite', e);
}
if (typeof data.startMoving === 'undefined') {
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
data.startMoving = true;
}
}
if (data.isScrolling) {
data.isTouched = false;
return;
}
if (!data.startMoving) {
return;
}
swiper.allowClick = false;
e.preventDefault();
if (params.touchMoveStopPropagation && !params.nested) {
e.stopPropagation();
}
if (!data.isMoved) {
if (params.loop) {
swiper.loopFix();
}
data.startTranslate = swiper.getTranslate();
swiper.setTransition(0);
if (swiper.animating) {
swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
}
data.allowMomentumBounce = false; // Grab Cursor
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
swiper.setGrabCursor(true);
}
swiper.emit('sliderFirstMove', e);
}
swiper.emit('sliderMove', e);
data.isMoved = true;
var diff = swiper.isHorizontal() ? diffX : diffY;
touches.diff = diff;
diff *= params.touchRatio;
if (rtl) {
diff = -diff;
}
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
data.currentTranslate = diff + data.startTranslate;
var disableParentSwiper = true;
var resistanceRatio = params.resistanceRatio;
if (params.touchReleaseOnEdges) {
resistanceRatio = 0;
}
if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {
disableParentSwiper = false;
if (params.resistance) {
data.currentTranslate = swiper.minTranslate() - 1 + Math.pow(-swiper.minTranslate() + data.startTranslate + diff, resistanceRatio);
}
} else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
disableParentSwiper = false;
if (params.resistance) {
data.currentTranslate = swiper.maxTranslate() + 1 - Math.pow(swiper.maxTranslate() - data.startTranslate - diff, resistanceRatio);
}
}
if (disableParentSwiper) {
e.preventedByNestedSwiper = true;
} // Directions locks
if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
data.currentTranslate = data.startTranslate;
}
if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
data.currentTranslate = data.startTranslate;
} // Threshold
if (params.threshold > 0) {
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
if (!data.allowThresholdMove) {
data.allowThresholdMove = true;
touches.startX = touches.currentX;
touches.startY = touches.currentY;
data.currentTranslate = data.startTranslate;
touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
return;
}
} else {
data.currentTranslate = data.startTranslate;
return;
}
}
if (!params.followFinger) {
return;
} // Update active index in free mode
if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
if (params.freeMode) {
// Velocity
if (data.velocities.length === 0) {
data.velocities.push({
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
time: data.touchStartTime
});
}
data.velocities.push({
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
time: Utils.now()
});
} // Update progress
swiper.updateProgress(data.currentTranslate); // Update translate
swiper.setTranslate(data.currentTranslate);
}
function onTouchEnd(event) {
var swiper = this;
var data = swiper.touchEventsData;
var params = swiper.params;
var touches = swiper.touches;
var rtl = swiper.rtlTranslate;
var $wrapperEl = swiper.$wrapperEl;
var slidesGrid = swiper.slidesGrid;
var snapGrid = swiper.snapGrid;
var e = event;
if (e.originalEvent) {
e = e.originalEvent;
}
if (data.allowTouchCallbacks) {
swiper.emit('touchEnd', e);
}
data.allowTouchCallbacks = false;
if (!data.isTouched) {
if (data.isMoved && params.grabCursor) {
swiper.setGrabCursor(false);
}
data.isMoved = false;
data.startMoving = false;
return;
} // Return Grab Cursor
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
swiper.setGrabCursor(false);
} // Time diff
var touchEndTime = Utils.now();
var timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click
if (swiper.allowClick) {
swiper.updateClickedSlide(e);
swiper.emit('tap', e);
if (timeDiff < 300 && touchEndTime - data.lastClickTime > 300) {
if (data.clickTimeout) {
clearTimeout(data.clickTimeout);
}
data.clickTimeout = Utils.nextTick(function () {
if (!swiper || swiper.destroyed) {
return;
}
swiper.emit('click', e);
}, 300);
}
if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
if (data.clickTimeout) {
clearTimeout(data.clickTimeout);
}
swiper.emit('doubleTap', e);
}
}
data.lastClickTime = Utils.now();
Utils.nextTick(function () {
if (!swiper.destroyed) {
swiper.allowClick = true;
}
});
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
data.isTouched = false;
data.isMoved = false;
data.startMoving = false;
return;
}
data.isTouched = false;
data.isMoved = false;
data.startMoving = false;
var currentPos;
if (params.followFinger) {
currentPos = rtl ? swiper.translate : -swiper.translate;
} else {
currentPos = -data.currentTranslate;
}
if (params.freeMode) {
if (currentPos < -swiper.minTranslate()) {
swiper.slideTo(swiper.activeIndex);
return;
}
if (currentPos > -swiper.maxTranslate()) {
if (swiper.slides.length < snapGrid.length) {
swiper.slideTo(snapGrid.length - 1);
} else {
swiper.slideTo(swiper.slides.length - 1);
}
return;
}
if (params.freeModeMomentum) {
if (data.velocities.length > 1) {
var lastMoveEvent = data.velocities.pop();
var velocityEvent = data.velocities.pop();
var distance = lastMoveEvent.position - velocityEvent.position;
var time = lastMoveEvent.time - velocityEvent.time;
swiper.velocity = distance / time;
swiper.velocity /= 2;
if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {
swiper.velocity = 0;
} // this implies that the user stopped moving a finger then released.
// There would be no events with distance zero, so the last event is stale.
if (time > 150 || Utils.now() - lastMoveEvent.time > 300) {
swiper.velocity = 0;
}
} else {
swiper.velocity = 0;
}
swiper.velocity *= params.freeModeMomentumVelocityRatio;
data.velocities.length = 0;
var momentumDuration = 1000 * params.freeModeMomentumRatio;
var momentumDistance = swiper.velocity * momentumDuration;
var newPosition = swiper.translate + momentumDistance;
if (rtl) {
newPosition = -newPosition;
}
var doBounce = false;
var afterBouncePosition;
var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;
var needsLoopFix;
if (newPosition < swiper.maxTranslate()) {
if (params.freeModeMomentumBounce) {
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
newPosition = swiper.maxTranslate() - bounceAmount;
}
afterBouncePosition = swiper.maxTranslate();
doBounce = true;
data.allowMomentumBounce = true;
} else {
newPosition = swiper.maxTranslate();
}
if (params.loop && params.centeredSlides) {
needsLoopFix = true;
}
} else if (newPosition > swiper.minTranslate()) {
if (params.freeModeMomentumBounce) {
if (newPosition - swiper.minTranslate() > bounceAmount) {
newPosition = swiper.minTranslate() + bounceAmount;
}
afterBouncePosition = swiper.minTranslate();
doBounce = true;
data.allowMomentumBounce = true;
} else {
newPosition = swiper.minTranslate();
}
if (params.loop && params.centeredSlides) {
needsLoopFix = true;
}
} else if (params.freeModeSticky) {
var nextSlide;
for (var j = 0; j < snapGrid.length; j += 1) {
if (snapGrid[j] > -newPosition) {
nextSlide = j;
break;
}
}
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
newPosition = snapGrid[nextSlide];
} else {
newPosition = snapGrid[nextSlide - 1];
}
newPosition = -newPosition;
}
if (needsLoopFix) {
swiper.once('transitionEnd', function () {
swiper.loopFix();
});
} // Fix duration
if (swiper.velocity !== 0) {
if (rtl) {
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
} else {
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
}
} else if (params.freeModeSticky) {
swiper.slideToClosest();
return;
}
if (params.freeModeMomentumBounce && doBounce) {
swiper.updateProgress(afterBouncePosition);
swiper.setTransition(momentumDuration);
swiper.setTranslate(newPosition);
swiper.transitionStart(true, swiper.swipeDirection);
swiper.animating = true;
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) {
return;
}
swiper.emit('momentumBounce');
swiper.setTransition(params.speed);
swiper.setTranslate(afterBouncePosition);
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed) {
return;
}
swiper.transitionEnd();
});
});
} else if (swiper.velocity) {
swiper.updateProgress(newPosition);
swiper.setTransition(momentumDuration);
swiper.setTranslate(newPosition);
swiper.transitionStart(true, swiper.swipeDirection);
if (!swiper.animating) {
swiper.animating = true;
$wrapperEl.transitionEnd(function () {
if (!swiper || swiper.destroyed) {
return;
}
swiper.transitionEnd();
});
}
} else {
swiper.updateProgress(newPosition);
}
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
} else if (params.freeModeSticky) {
swiper.slideToClosest();
return;
}
if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {
swiper.updateProgress();
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
return;
} // Find current slide
var stopIndex = 0;
var groupSize = swiper.slidesSizesGrid[0];
for (var i = 0; i < slidesGrid.length; i += params.slidesPerGroup) {
if (typeof slidesGrid[i + params.slidesPerGroup] !== 'undefined') {
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + params.slidesPerGroup]) {
stopIndex = i;
groupSize = slidesGrid[i + params.slidesPerGroup] - slidesGrid[i];
}
} else if (currentPos >= slidesGrid[i]) {
stopIndex = i;
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
}
} // Find current slide size
var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
if (timeDiff > params.longSwipesMs) {
// Long touches
if (!params.longSwipes) {
swiper.slideTo(swiper.activeIndex);
return;
}
if (swiper.swipeDirection === 'next') {
if (ratio >= params.longSwipesRatio) {
swiper.slideTo(stopIndex + params.slidesPerGroup);
} else {
swiper.slideTo(stopIndex);
}
}
if (swiper.swipeDirection === 'prev') {
if (ratio > 1 - params.longSwipesRatio) {
swiper.slideTo(stopIndex + params.slidesPerGroup);
} else {
swiper.slideTo(stopIndex);
}
}
} else {
// Short swipes
if (!params.shortSwipes) {
swiper.slideTo(swiper.activeIndex);
return;
}
if (swiper.swipeDirection === 'next') {
swiper.slideTo(stopIndex + params.slidesPerGroup);
}
if (swiper.swipeDirection === 'prev') {
swiper.slideTo(stopIndex);
}
}
}
function onResize() {
var swiper = this;
var params = swiper.params;
var el = swiper.el;
if (el && el.offsetWidth === 0) {
return;
} // Breakpoints
if (params.breakpoints) {
swiper.setBreakpoint();
} // Save locks
var allowSlideNext = swiper.allowSlideNext;
var allowSlidePrev = swiper.allowSlidePrev;
var snapGrid = swiper.snapGrid; // Disable locks on resize
swiper.allowSlideNext = true;
swiper.allowSlidePrev = true;
swiper.updateSize();
swiper.updateSlides();
if (params.freeMode) {
var newTranslate = Math.min(Math.max(swiper.translate, swiper.maxTranslate()), swiper.minTranslate());
swiper.setTranslate(newTranslate);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
if (params.autoHeight) {
swiper.updateAutoHeight();
}
} else {
swiper.updateSlidesClasses();
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
swiper.slideTo(swiper.slides.length - 1, 0, false, true);
} else {
swiper.slideTo(swiper.activeIndex, 0, false, true);
}
}
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
swiper.autoplay.run();
} // Return locks after resize
swiper.allowSlidePrev = allowSlidePrev;
swiper.allowSlideNext = allowSlideNext;
if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
swiper.checkOverflow();
}
}
function onClick(e) {
var swiper = this;
if (!swiper.allowClick) {
if (swiper.params.preventClicks) {
e.preventDefault();
}
if (swiper.params.preventClicksPropagation && swiper.animating) {
e.stopPropagation();
e.stopImmediatePropagation();
}
}
}
function attachEvents() {
var swiper = this;
var params = swiper.params;
var touchEvents = swiper.touchEvents;
var el = swiper.el;
var wrapperEl = swiper.wrapperEl;
{
swiper.onTouchStart = onTouchStart.bind(swiper);
swiper.onTouchMove = onTouchMove.bind(swiper);
swiper.onTouchEnd = onTouchEnd.bind(swiper);
}
swiper.onClick = onClick.bind(swiper);
var target = params.touchEventsTarget === 'container' ? el : wrapperEl;
var capture = !!params.nested; // Touch Events
{
if (!Support.touch && (Support.pointerEvents || Support.prefixedPointerEvents)) {
target.addEventListener(touchEvents.start, swiper.onTouchStart, false);
doc.addEventListener(touchEvents.move, swiper.onTouchMove, capture);
doc.addEventListener(touchEvents.end, swiper.onTouchEnd, false);
} else {
if (Support.touch) {
var passiveListener = touchEvents.start === 'touchstart' && Support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
target.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
target.addEventListener(touchEvents.move, swiper.onTouchMove, Support.passiveListener ? {
passive: false,
capture: capture
} : capture);
target.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
}
if (params.simulateTouch && !Device.ios && !Device.android || params.simulateTouch && !Support.touch && Device.ios) {
target.addEventListener('mousedown', swiper.onTouchStart, false);
doc.addEventListener('mousemove', swiper.onTouchMove, capture);
doc.addEventListener('mouseup', swiper.onTouchEnd, false);
}
} // Prevent Links Clicks
if (params.preventClicks || params.preventClicksPropagation) {
target.addEventListener('click', swiper.onClick, true);
}
} // Resize handler
swiper.on(Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
}
function detachEvents() {
var swiper = this;
var params = swiper.params;
var touchEvents = swiper.touchEvents;
var el = swiper.el;
var wrapperEl = swiper.wrapperEl;
var target = params.touchEventsTarget === 'container' ? el : wrapperEl;
var capture = !!params.nested; // Touch Events
{
if (!Support.touch && (Support.pointerEvents || Support.prefixedPointerEvents)) {
target.removeEventListener(touchEvents.start, swiper.onTouchStart, false);
doc.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
doc.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);
} else {
if (Support.touch) {
var passiveListener = touchEvents.start === 'onTouchStart' && Support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
target.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
target.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
target.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
}
if (params.simulateTouch && !Device.ios && !Device.android || params.simulateTouch && !Support.touch && Device.ios) {
target.removeEventListener('mousedown', swiper.onTouchStart, false);
doc.removeEventListener('mousemove', swiper.onTouchMove, capture);
doc.removeEventListener('mouseup', swiper.onTouchEnd, false);
}
} // Prevent Links Clicks
if (params.preventClicks || params.preventClicksPropagation) {
target.removeEventListener('click', swiper.onClick, true);
}
} // Resize handler
swiper.off(Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize);
}
var events = {
attachEvents: attachEvents,
detachEvents: detachEvents
};
function setBreakpoint() {
var swiper = this;
var activeIndex = swiper.activeIndex;
var initialized = swiper.initialized;
var loopedSlides = swiper.loopedSlides;
if (loopedSlides === void 0) loopedSlides = 0;
var params = swiper.params;
var breakpoints = params.breakpoints;
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) {
return;
} // Set breakpoint for window width and update parameters
var breakpoint = swiper.getBreakpoint(breakpoints);
if (breakpoint && swiper.currentBreakpoint !== breakpoint) {
var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
if (breakpointOnlyParams) {
['slidesPerView', 'spaceBetween', 'slidesPerGroup'].forEach(function (param) {
var paramValue = breakpointOnlyParams[param];
if (typeof paramValue === 'undefined') {
return;
}
if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
breakpointOnlyParams[param] = 'auto';
} else if (param === 'slidesPerView') {
breakpointOnlyParams[param] = parseFloat(paramValue);
} else {
breakpointOnlyParams[param] = parseInt(paramValue, 10);
}
});
}
var breakpointParams = breakpointOnlyParams || swiper.originalParams;
var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
if (directionChanged && initialized) {
swiper.changeDirection();
}
Utils.extend(swiper.params, breakpointParams);
Utils.extend(swiper, {
allowTouchMove: swiper.params.allowTouchMove,
allowSlideNext: swiper.params.allowSlideNext,
allowSlidePrev: swiper.params.allowSlidePrev
});
swiper.currentBreakpoint = breakpoint;
if (needsReLoop && initialized) {
swiper.loopDestroy();
swiper.loopCreate();
swiper.updateSlides();
swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);
}
swiper.emit('breakpoint', breakpointParams);
}
}
function getBreakpoint(breakpoints) {
var swiper = this; // Get breakpoint for window width
if (!breakpoints) {
return undefined;
}
var breakpoint = false;
var points = [];
Object.keys(breakpoints).forEach(function (point) {
points.push(point);
});
points.sort(function (a, b) {
return parseInt(a, 10) - parseInt(b, 10);
});
for (var i = 0; i < points.length; i += 1) {
var point = points[i];
if (swiper.params.breakpointsInverse) {
if (point <= win.innerWidth) {
breakpoint = point;
}
} else if (point >= win.innerWidth && !breakpoint) {
breakpoint = point;
}
}
return breakpoint || 'max';
}
var breakpoints = {
setBreakpoint: setBreakpoint,
getBreakpoint: getBreakpoint
};
function addClasses() {
var swiper = this;
var classNames = swiper.classNames;
var params = swiper.params;
var rtl = swiper.rtl;
var $el = swiper.$el;
var suffixes = [];
suffixes.push('initialized');
suffixes.push(params.direction);
if (params.freeMode) {
suffixes.push('free-mode');
}
if (!Support.flexbox) {
suffixes.push('no-flexbox');
}
if (params.autoHeight) {
suffixes.push('autoheight');
}
if (rtl) {
suffixes.push('rtl');
}
if (params.slidesPerColumn > 1) {
suffixes.push('multirow');
}
if (Device.android) {
suffixes.push('android');
}
if (Device.ios) {
suffixes.push('ios');
} // WP8 Touch Events Fix
if ((Browser.isIE || Browser.isEdge) && (Support.pointerEvents || Support.prefixedPointerEvents)) {
suffixes.push("wp8-" + params.direction);
}
suffixes.forEach(function (suffix) {
classNames.push(params.containerModifierClass + suffix);
});
$el.addClass(classNames.join(' '));
}
function removeClasses() {
var swiper = this;
var $el = swiper.$el;
var classNames = swiper.classNames;
$el.removeClass(classNames.join(' '));
}
var classes = {
addClasses: addClasses,
removeClasses: removeClasses
};
function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {
var image;
function onReady() {
if (callback) {
callback();
}
}
if (!imageEl.complete || !checkForComplete) {
if (src) {
image = new win.Image();
image.onload = onReady;
image.onerror = onReady;
if (sizes) {
image.sizes = sizes;
}
if (srcset) {
image.srcset = srcset;
}
if (src) {
image.src = src;
}
} else {
onReady();
}
} else {
// image already loaded...
onReady();
}
}
function preloadImages() {
var swiper = this;
swiper.imagesToLoad = swiper.$el.find('img');
function onReady() {
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) {
return;
}
if (swiper.imagesLoaded !== undefined) {
swiper.imagesLoaded += 1;
}
if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
if (swiper.params.updateOnImagesReady) {
swiper.update();
}
swiper.emit('imagesReady');
}
}
for (var i = 0; i < swiper.imagesToLoad.length; i += 1) {
var imageEl = swiper.imagesToLoad[i];
swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);
}
}
var images = {
loadImage: loadImage,
preloadImages: preloadImages
};
function checkOverflow() {
var swiper = this;
var wasLocked = swiper.isLocked;
swiper.isLocked = swiper.snapGrid.length === 1;
swiper.allowSlideNext = !swiper.isLocked;
swiper.allowSlidePrev = !swiper.isLocked; // events
if (wasLocked !== swiper.isLocked) {
swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
}
if (wasLocked && wasLocked !== swiper.isLocked) {
swiper.isEnd = false;
swiper.navigation.update();
}
}
var checkOverflow$1 = {
checkOverflow: checkOverflow
};
var defaults = {
init: true,
direction: 'horizontal',
touchEventsTarget: 'container',
initialSlide: 0,
speed: 300,
//
preventInteractionOnTransition: false,
// To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
edgeSwipeDetection: false,
edgeSwipeThreshold: 20,
// Free mode
freeMode: false,
freeModeMomentum: true,
freeModeMomentumRatio: 1,
freeModeMomentumBounce: true,
freeModeMomentumBounceRatio: 1,
freeModeMomentumVelocityRatio: 1,
freeModeSticky: false,
freeModeMinimumVelocity: 0.02,
// Autoheight
autoHeight: false,
// Set wrapper width
setWrapperSize: false,
// Virtual Translate
virtualTranslate: false,
// Effects
effect: 'slide',
// 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
// Breakpoints
breakpoints: undefined,
breakpointsInverse: false,
// Slides grid
spaceBetween: 0,
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerColumnFill: 'column',
slidesPerGroup: 1,
centeredSlides: false,
slidesOffsetBefore: 0,
// in px
slidesOffsetAfter: 0,
// in px
normalizeSlideIndex: true,
centerInsufficientSlides: false,
// Disable swiper and hide navigation when container not overflow
watchOverflow: false,
// Round length
roundLengths: false,
// Touches
touchRatio: 1,
touchAngle: 45,
simulateTouch: true,
shortSwipes: true,
longSwipes: true,
longSwipesRatio: 0.5,
longSwipesMs: 300,
followFinger: true,
allowTouchMove: true,
threshold: 0,
touchMoveStopPropagation: true,
touchStartPreventDefault: true,
touchStartForcePreventDefault: false,
touchReleaseOnEdges: false,
// Unique Navigation Elements
uniqueNavElements: true,
// Resistance
resistance: true,
resistanceRatio: 0.85,
// Progress
watchSlidesProgress: false,
watchSlidesVisibility: false,
// Cursor
grabCursor: false,
// Clicks
preventClicks: true,
preventClicksPropagation: true,
slideToClickedSlide: false,
// Images
preloadImages: true,
updateOnImagesReady: true,
// loop
loop: false,
loopAdditionalSlides: 0,
loopedSlides: null,
loopFillGroupWithBlank: false,
// Swiping/no swiping
allowSlidePrev: true,
allowSlideNext: true,
swipeHandler: null,
// '.swipe-handler',
noSwiping: true,
noSwipingClass: 'swiper-no-swiping',
noSwipingSelector: null,
// Passive Listeners
passiveListeners: true,
// NS
containerModifierClass: 'swiper-container-',
// NEW
slideClass: 'swiper-slide',
slideBlankClass: 'swiper-slide-invisible-blank',
slideActiveClass: 'swiper-slide-active',
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
slideVisibleClass: 'swiper-slide-visible',
slideDuplicateClass: 'swiper-slide-duplicate',
slideNextClass: 'swiper-slide-next',
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
slidePrevClass: 'swiper-slide-prev',
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
wrapperClass: 'swiper-wrapper',
// Callbacks
runCallbacksOnInit: true
};
/* eslint no-param-reassign: "off" */
var prototypes = {
update: update,
translate: translate,
transition: transition$1,
slide: slide,
loop: loop,
grabCursor: grabCursor,
manipulation: manipulation,
events: events,
breakpoints: breakpoints,
checkOverflow: checkOverflow$1,
classes: classes,
images: images
};
var extendedDefaults = {};
var Swiper =
/*@__PURE__*/
function (SwiperClass) {
function Swiper() {
var assign;
var args = [],
len = arguments.length;
while (len--) {
args[len] = arguments[len];
}
var el;
var params;
if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {
params = args[0];
} else {
assign = args, el = assign[0], params = assign[1];
}
if (!params) {
params = {};
}
params = Utils.extend({}, params);
if (el && !params.el) {
params.el = el;
}
SwiperClass.call(this, params);
Object.keys(prototypes).forEach(function (prototypeGroup) {
Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) {
if (!Swiper.prototype[protoMethod]) {
Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
}
});
}); // Swiper Instance
var swiper = this;
if (typeof swiper.modules === 'undefined') {
swiper.modules = {};
}
Object.keys(swiper.modules).forEach(function (moduleName) {
var module = swiper.modules[moduleName];
if (module.params) {
var moduleParamName = Object.keys(module.params)[0];
var moduleParams = module.params[moduleParamName];
if (_typeof(moduleParams) !== 'object' || moduleParams === null) {
return;
}
if (!(moduleParamName in params && 'enabled' in moduleParams)) {
return;
}
if (params[moduleParamName] === true) {
params[moduleParamName] = {
enabled: true
};
}
if (_typeof(params[moduleParamName]) === 'object' && !('enabled' in params[moduleParamName])) {
params[moduleParamName].enabled = true;
}
if (!params[moduleParamName]) {
params[moduleParamName] = {
enabled: false
};
}
}
}); // Extend defaults with modules params
var swiperParams = Utils.extend({}, defaults);
swiper.useModulesParams(swiperParams); // Extend defaults with passed params
swiper.params = Utils.extend({}, swiperParams, extendedDefaults, params);
swiper.originalParams = Utils.extend({}, swiper.params);
swiper.passedParams = Utils.extend({}, params); // Save Dom lib
swiper.$ = $; // Find el
var $el = $(swiper.params.el);
el = $el[0];
if (!el) {
return undefined;
}
if ($el.length > 1) {
var swipers = [];
$el.each(function (index, containerEl) {
var newParams = Utils.extend({}, params, {
el: containerEl
});
swipers.push(new Swiper(newParams));
});
return swipers;
}
el.swiper = swiper;
$el.data('swiper', swiper); // Find Wrapper
var $wrapperEl = $el.children("." + swiper.params.wrapperClass); // Extend Swiper
Utils.extend(swiper, {
$el: $el,
el: el,
$wrapperEl: $wrapperEl,
wrapperEl: $wrapperEl[0],
// Classes
classNames: [],
// Slides
slides: $(),
slidesGrid: [],
snapGrid: [],
slidesSizesGrid: [],
// isDirection
isHorizontal: function isHorizontal() {
return swiper.params.direction === 'horizontal';
},
isVertical: function isVertical() {
return swiper.params.direction === 'vertical';
},
// RTL
rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
wrongRTL: $wrapperEl.css('display') === '-webkit-box',
// Indexes
activeIndex: 0,
realIndex: 0,
//
isBeginning: true,
isEnd: false,
// Props
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: false,
// Locks
allowSlideNext: swiper.params.allowSlideNext,
allowSlidePrev: swiper.params.allowSlidePrev,
// Touch Events
touchEvents: function touchEvents() {
var touch = ['touchstart', 'touchmove', 'touchend'];
var desktop = ['mousedown', 'mousemove', 'mouseup'];
if (Support.pointerEvents) {
desktop = ['pointerdown', 'pointermove', 'pointerup'];
} else if (Support.prefixedPointerEvents) {
desktop = ['MSPointerDown', 'MSPointerMove', 'MSPointerUp'];
}
swiper.touchEventsTouch = {
start: touch[0],
move: touch[1],
end: touch[2]
};
swiper.touchEventsDesktop = {
start: desktop[0],
move: desktop[1],
end: desktop[2]
};
return Support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
}(),
touchEventsData: {
isTouched: undefined,
isMoved: undefined,
allowTouchCallbacks: undefined,
touchStartTime: undefined,
isScrolling: undefined,
currentTranslate: undefined,
startTranslate: undefined,
allowThresholdMove: undefined,
// Form elements to match
formElements: 'input, select, option, textarea, button, video',
// Last click time
lastClickTime: Utils.now(),
clickTimeout: undefined,
// Velocities
velocities: [],
allowMomentumBounce: undefined,
isTouchEvent: undefined,
startMoving: undefined
},
// Clicks
allowClick: true,
// Touches
allowTouchMove: swiper.params.allowTouchMove,
touches: {
startX: 0,
startY: 0,
currentX: 0,
currentY: 0,
diff: 0
},
// Images
imagesToLoad: [],
imagesLoaded: 0
}); // Install Modules
swiper.useModules(); // Init
if (swiper.params.init) {
swiper.init();
} // Return app instance
return swiper;
}
if (SwiperClass) Swiper.__proto__ = SwiperClass;
Swiper.prototype = Object.create(SwiperClass && SwiperClass.prototype);
Swiper.prototype.constructor = Swiper;
var staticAccessors = {
extendedDefaults: {
configurable: true
},
defaults: {
configurable: true
},
Class: {
configurable: true
},
$: {
configurable: true
}
};
Swiper.prototype.slidesPerViewDynamic = function slidesPerViewDynamic() {
var swiper = this;
var params = swiper.params;
var slides = swiper.slides;
var slidesGrid = swiper.slidesGrid;
var swiperSize = swiper.size;
var activeIndex = swiper.activeIndex;
var spv = 1;
if (params.centeredSlides) {
var slideSize = slides[activeIndex].swiperSlideSize;
var breakLoop;
for (var i = activeIndex + 1; i < slides.length; i += 1) {
if (slides[i] && !breakLoop) {
slideSize += slides[i].swiperSlideSize;
spv += 1;
if (slideSize > swiperSize) {
breakLoop = true;
}
}
}
for (var i$1 = activeIndex - 1; i$1 >= 0; i$1 -= 1) {
if (slides[i$1] && !breakLoop) {
slideSize += slides[i$1].swiperSlideSize;
spv += 1;
if (slideSize > swiperSize) {
breakLoop = true;
}
}
}
} else {
for (var i$2 = activeIndex + 1; i$2 < slides.length; i$2 += 1) {
if (slidesGrid[i$2] - slidesGrid[activeIndex] < swiperSize) {
spv += 1;
}
}
}
return spv;
};
Swiper.prototype.update = function update() {
var swiper = this;
if (!swiper || swiper.destroyed) {
return;
}
var snapGrid = swiper.snapGrid;
var params = swiper.params; // Breakpoints
if (params.breakpoints) {
swiper.setBreakpoint();
}
swiper.updateSize();
swiper.updateSlides();
swiper.updateProgress();
swiper.updateSlidesClasses();
function setTranslate() {
var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
swiper.setTranslate(newTranslate);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
}
var translated;
if (swiper.params.freeMode) {
setTranslate();
if (swiper.params.autoHeight) {
swiper.updateAutoHeight();
}
} else {
if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
} else {
translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
}
if (!translated) {
setTranslate();
}
}
if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
swiper.checkOverflow();
}
swiper.emit('update');
};
Swiper.prototype.changeDirection = function changeDirection(newDirection, needUpdate) {
if (needUpdate === void 0) needUpdate = true;
var swiper = this;
var currentDirection = swiper.params.direction;
if (!newDirection) {
// eslint-disable-next-line
newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
}
if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
return swiper;
}
swiper.$el.removeClass("" + swiper.params.containerModifierClass + currentDirection + " wp8-" + currentDirection).addClass("" + swiper.params.containerModifierClass + newDirection);
if ((Browser.isIE || Browser.isEdge) && (Support.pointerEvents || Support.prefixedPointerEvents)) {
swiper.$el.addClass(swiper.params.containerModifierClass + "wp8-" + newDirection);
}
swiper.params.direction = newDirection;
swiper.slides.each(function (slideIndex, slideEl) {
if (newDirection === 'vertical') {
slideEl.style.width = '';
} else {
slideEl.style.height = '';
}
});
swiper.emit('changeDirection');
if (needUpdate) {
swiper.update();
}
return swiper;
};
Swiper.prototype.init = function init() {
var swiper = this;
if (swiper.initialized) {
return;
}
swiper.emit('beforeInit'); // Set breakpoint
if (swiper.params.breakpoints) {
swiper.setBreakpoint();
} // Add Classes
swiper.addClasses(); // Create loop
if (swiper.params.loop) {
swiper.loopCreate();
} // Update size
swiper.updateSize(); // Update slides
swiper.updateSlides();
if (swiper.params.watchOverflow) {
swiper.checkOverflow();
} // Set Grab Cursor
if (swiper.params.grabCursor) {
swiper.setGrabCursor();
}
if (swiper.params.preloadImages) {
swiper.preloadImages();
} // Slide To Initial Slide
if (swiper.params.loop) {
swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);
} else {
swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);
} // Attach events
swiper.attachEvents(); // Init Flag
swiper.initialized = true; // Emit
swiper.emit('init');
};
Swiper.prototype.destroy = function destroy(deleteInstance, cleanStyles) {
if (deleteInstance === void 0) deleteInstance = true;
if (cleanStyles === void 0) cleanStyles = true;
var swiper = this;
var params = swiper.params;
var $el = swiper.$el;
var $wrapperEl = swiper.$wrapperEl;
var slides = swiper.slides;
if (typeof swiper.params === 'undefined' || swiper.destroyed) {
return null;
}
swiper.emit('beforeDestroy'); // Init Flag
swiper.initialized = false; // Detach events
swiper.detachEvents(); // Destroy loop
if (params.loop) {
swiper.loopDestroy();
} // Cleanup styles
if (cleanStyles) {
swiper.removeClasses();
$el.removeAttr('style');
$wrapperEl.removeAttr('style');
if (slides && slides.length) {
slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index').removeAttr('data-swiper-column').removeAttr('data-swiper-row');
}
}
swiper.emit('destroy'); // Detach emitter events
Object.keys(swiper.eventsListeners).forEach(function (eventName) {
swiper.off(eventName);
});
if (deleteInstance !== false) {
swiper.$el[0].swiper = null;
swiper.$el.data('swiper', null);
Utils.deleteProps(swiper);
}
swiper.destroyed = true;
return null;
};
Swiper.extendDefaults = function extendDefaults(newDefaults) {
Utils.extend(extendedDefaults, newDefaults);
};
staticAccessors.extendedDefaults.get = function () {
return extendedDefaults;
};
staticAccessors.defaults.get = function () {
return defaults;
};
staticAccessors.Class.get = function () {
return SwiperClass;
};
staticAccessors.$.get = function () {
return $;
};
Object.defineProperties(Swiper, staticAccessors);
return Swiper;
}(SwiperClass);
var Device$1 = {
name: 'device',
proto: {
device: Device
},
static: {
device: Device
}
};
var Support$1 = {
name: 'support',
proto: {
support: Support
},
static: {
support: Support
}
};
var Browser$1 = {
name: 'browser',
proto: {
browser: Browser
},
static: {
browser: Browser
}
};
var Resize = {
name: 'resize',
create: function create() {
var swiper = this;
Utils.extend(swiper, {
resize: {
resizeHandler: function resizeHandler() {
if (!swiper || swiper.destroyed || !swiper.initialized) {
return;
}
swiper.emit('beforeResize');
swiper.emit('resize');
},
orientationChangeHandler: function orientationChangeHandler() {
if (!swiper || swiper.destroyed || !swiper.initialized) {
return;
}
swiper.emit('orientationchange');
}
}
});
},
on: {
init: function init() {
var swiper = this; // Emit resize
win.addEventListener('resize', swiper.resize.resizeHandler); // Emit orientationchange
win.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);
},
destroy: function destroy() {
var swiper = this;
win.removeEventListener('resize', swiper.resize.resizeHandler);
win.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);
}
}
};
var Observer = {
func: win.MutationObserver || win.WebkitMutationObserver,
attach: function attach(target, options) {
if (options === void 0) options = {};
var swiper = this;
var ObserverFunc = Observer.func;
var observer = new ObserverFunc(function (mutations) {
// The observerUpdate event should only be triggered
// once despite the number of mutations. Additional
// triggers are redundant and are very costly
if (mutations.length === 1) {
swiper.emit('observerUpdate', mutations[0]);
return;
}
var observerUpdate = function observerUpdate() {
swiper.emit('observerUpdate', mutations[0]);
};
if (win.requestAnimationFrame) {
win.requestAnimationFrame(observerUpdate);
} else {
win.setTimeout(observerUpdate, 0);
}
});
observer.observe(target, {
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
childList: typeof options.childList === 'undefined' ? true : options.childList,
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
});
swiper.observer.observers.push(observer);
},
init: function init() {
var swiper = this;
if (!Support.observer || !swiper.params.observer) {
return;
}
if (swiper.params.observeParents) {
var containerParents = swiper.$el.parents();
for (var i = 0; i < containerParents.length; i += 1) {
swiper.observer.attach(containerParents[i]);
}
} // Observe container
swiper.observer.attach(swiper.$el[0], {
childList: swiper.params.observeSlideChildren
}); // Observe wrapper
swiper.observer.attach(swiper.$wrapperEl[0], {
attributes: false
});
},
destroy: function destroy() {
var swiper = this;
swiper.observer.observers.forEach(function (observer) {
observer.disconnect();
});
swiper.observer.observers = [];
}
};
var Observer$1 = {
name: 'observer',
params: {
observer: false,
observeParents: false,
observeSlideChildren: false
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
observer: {
init: Observer.init.bind(swiper),
attach: Observer.attach.bind(swiper),
destroy: Observer.destroy.bind(swiper),
observers: []
}
});
},
on: {
init: function init() {
var swiper = this;
swiper.observer.init();
},
destroy: function destroy() {
var swiper = this;
swiper.observer.destroy();
}
}
};
var Virtual = {
update: function update(force) {
var swiper = this;
var ref = swiper.params;
var slidesPerView = ref.slidesPerView;
var slidesPerGroup = ref.slidesPerGroup;
var centeredSlides = ref.centeredSlides;
var ref$1 = swiper.params.virtual;
var addSlidesBefore = ref$1.addSlidesBefore;
var addSlidesAfter = ref$1.addSlidesAfter;
var ref$2 = swiper.virtual;
var previousFrom = ref$2.from;
var previousTo = ref$2.to;
var slides = ref$2.slides;
var previousSlidesGrid = ref$2.slidesGrid;
var renderSlide = ref$2.renderSlide;
var previousOffset = ref$2.offset;
swiper.updateActiveIndex();
var activeIndex = swiper.activeIndex || 0;
var offsetProp;
if (swiper.rtlTranslate) {
offsetProp = 'right';
} else {
offsetProp = swiper.isHorizontal() ? 'left' : 'top';
}
var slidesAfter;
var slidesBefore;
if (centeredSlides) {
slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore;
slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter;
} else {
slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesBefore;
slidesBefore = slidesPerGroup + addSlidesAfter;
}
var from = Math.max((activeIndex || 0) - slidesBefore, 0);
var to = Math.min((activeIndex || 0) + slidesAfter, slides.length - 1);
var offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0);
Utils.extend(swiper.virtual, {
from: from,
to: to,
offset: offset,
slidesGrid: swiper.slidesGrid
});
function onRendered() {
swiper.updateSlides();
swiper.updateProgress();
swiper.updateSlidesClasses();
if (swiper.lazy && swiper.params.lazy.enabled) {
swiper.lazy.load();
}
}
if (previousFrom === from && previousTo === to && !force) {
if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) {
swiper.slides.css(offsetProp, offset + "px");
}
swiper.updateProgress();
return;
}
if (swiper.params.virtual.renderExternal) {
swiper.params.virtual.renderExternal.call(swiper, {
offset: offset,
from: from,
to: to,
slides: function getSlides() {
var slidesToRender = [];
for (var i = from; i <= to; i += 1) {
slidesToRender.push(slides[i]);
}
return slidesToRender;
}()
});
onRendered();
return;
}
var prependIndexes = [];
var appendIndexes = [];
if (force) {
swiper.$wrapperEl.find("." + swiper.params.slideClass).remove();
} else {
for (var i = previousFrom; i <= previousTo; i += 1) {
if (i < from || i > to) {
swiper.$wrapperEl.find("." + swiper.params.slideClass + "[data-swiper-slide-index=\"" + i + "\"]").remove();
}
}
}
for (var i$1 = 0; i$1 < slides.length; i$1 += 1) {
if (i$1 >= from && i$1 <= to) {
if (typeof previousTo === 'undefined' || force) {
appendIndexes.push(i$1);
} else {
if (i$1 > previousTo) {
appendIndexes.push(i$1);
}
if (i$1 < previousFrom) {
prependIndexes.push(i$1);
}
}
}
}
appendIndexes.forEach(function (index) {
swiper.$wrapperEl.append(renderSlide(slides[index], index));
});
prependIndexes.sort(function (a, b) {
return b - a;
}).forEach(function (index) {
swiper.$wrapperEl.prepend(renderSlide(slides[index], index));
});
swiper.$wrapperEl.children('.swiper-slide').css(offsetProp, offset + "px");
onRendered();
},
renderSlide: function renderSlide(slide, index) {
var swiper = this;
var params = swiper.params.virtual;
if (params.cache && swiper.virtual.cache[index]) {
return swiper.virtual.cache[index];
}
var $slideEl = params.renderSlide ? $(params.renderSlide.call(swiper, slide, index)) : $("<div class=\"" + swiper.params.slideClass + "\" data-swiper-slide-index=\"" + index + "\">" + slide + "</div>");
if (!$slideEl.attr('data-swiper-slide-index')) {
$slideEl.attr('data-swiper-slide-index', index);
}
if (params.cache) {
swiper.virtual.cache[index] = $slideEl;
}
return $slideEl;
},
appendSlide: function appendSlide(slides) {
var swiper = this;
if (_typeof(slides) === 'object' && 'length' in slides) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) {
swiper.virtual.slides.push(slides[i]);
}
}
} else {
swiper.virtual.slides.push(slides);
}
swiper.virtual.update(true);
},
prependSlide: function prependSlide(slides) {
var swiper = this;
var activeIndex = swiper.activeIndex;
var newActiveIndex = activeIndex + 1;
var numberOfNewSlides = 1;
if (Array.isArray(slides)) {
for (var i = 0; i < slides.length; i += 1) {
if (slides[i]) {
swiper.virtual.slides.unshift(slides[i]);
}
}
newActiveIndex = activeIndex + slides.length;
numberOfNewSlides = slides.length;
} else {
swiper.virtual.slides.unshift(slides);
}
if (swiper.params.virtual.cache) {
var cache = swiper.virtual.cache;
var newCache = {};
Object.keys(cache).forEach(function (cachedIndex) {
newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = cache[cachedIndex];
});
swiper.virtual.cache = newCache;
}
swiper.virtual.update(true);
swiper.slideTo(newActiveIndex, 0);
},
removeSlide: function removeSlide(slidesIndexes) {
var swiper = this;
if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) {
return;
}
var activeIndex = swiper.activeIndex;
if (Array.isArray(slidesIndexes)) {
for (var i = slidesIndexes.length - 1; i >= 0; i -= 1) {
swiper.virtual.slides.splice(slidesIndexes[i], 1);
if (swiper.params.virtual.cache) {
delete swiper.virtual.cache[slidesIndexes[i]];
}
if (slidesIndexes[i] < activeIndex) {
activeIndex -= 1;
}
activeIndex = Math.max(activeIndex, 0);
}
} else {
swiper.virtual.slides.splice(slidesIndexes, 1);
if (swiper.params.virtual.cache) {
delete swiper.virtual.cache[slidesIndexes];
}
if (slidesIndexes < activeIndex) {
activeIndex -= 1;
}
activeIndex = Math.max(activeIndex, 0);
}
swiper.virtual.update(true);
swiper.slideTo(activeIndex, 0);
},
removeAllSlides: function removeAllSlides() {
var swiper = this;
swiper.virtual.slides = [];
if (swiper.params.virtual.cache) {
swiper.virtual.cache = {};
}
swiper.virtual.update(true);
swiper.slideTo(0, 0);
}
};
var Virtual$1 = {
name: 'virtual',
params: {
virtual: {
enabled: false,
slides: [],
cache: true,
renderSlide: null,
renderExternal: null,
addSlidesBefore: 0,
addSlidesAfter: 0
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
virtual: {
update: Virtual.update.bind(swiper),
appendSlide: Virtual.appendSlide.bind(swiper),
prependSlide: Virtual.prependSlide.bind(swiper),
removeSlide: Virtual.removeSlide.bind(swiper),
removeAllSlides: Virtual.removeAllSlides.bind(swiper),
renderSlide: Virtual.renderSlide.bind(swiper),
slides: swiper.params.virtual.slides,
cache: {}
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (!swiper.params.virtual.enabled) {
return;
}
swiper.classNames.push(swiper.params.containerModifierClass + "virtual");
var overwriteParams = {
watchSlidesProgress: true
};
Utils.extend(swiper.params, overwriteParams);
Utils.extend(swiper.originalParams, overwriteParams);
if (!swiper.params.initialSlide) {
swiper.virtual.update();
}
},
setTranslate: function setTranslate() {
var swiper = this;
if (!swiper.params.virtual.enabled) {
return;
}
swiper.virtual.update();
}
}
};
var Keyboard = {
handle: function handle(event) {
var swiper = this;
var rtl = swiper.rtlTranslate;
var e = event;
if (e.originalEvent) {
e = e.originalEvent;
} // jquery fix
var kc = e.keyCode || e.charCode; // Directions locks
if (!swiper.allowSlideNext && (swiper.isHorizontal() && kc === 39 || swiper.isVertical() && kc === 40 || kc === 34)) {
return false;
}
if (!swiper.allowSlidePrev && (swiper.isHorizontal() && kc === 37 || swiper.isVertical() && kc === 38 || kc === 33)) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return undefined;
}
if (doc.activeElement && doc.activeElement.nodeName && (doc.activeElement.nodeName.toLowerCase() === 'input' || doc.activeElement.nodeName.toLowerCase() === 'textarea')) {
return undefined;
}
if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
var inView = false; // Check that swiper should be inside of visible area of window
if (swiper.$el.parents("." + swiper.params.slideClass).length > 0 && swiper.$el.parents("." + swiper.params.slideActiveClass).length === 0) {
return undefined;
}
var windowWidth = win.innerWidth;
var windowHeight = win.innerHeight;
var swiperOffset = swiper.$el.offset();
if (rtl) {
swiperOffset.left -= swiper.$el[0].scrollLeft;
}
var swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiper.width, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiper.height], [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height]];
for (var i = 0; i < swiperCoord.length; i += 1) {
var point = swiperCoord[i];
if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
inView = true;
}
}
if (!inView) {
return undefined;
}
}
if (swiper.isHorizontal()) {
if (kc === 33 || kc === 34 || kc === 37 || kc === 39) {
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
}
if ((kc === 34 || kc === 39) && !rtl || (kc === 33 || kc === 37) && rtl) {
swiper.slideNext();
}
if ((kc === 33 || kc === 37) && !rtl || (kc === 34 || kc === 39) && rtl) {
swiper.slidePrev();
}
} else {
if (kc === 33 || kc === 34 || kc === 38 || kc === 40) {
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
}
if (kc === 34 || kc === 40) {
swiper.slideNext();
}
if (kc === 33 || kc === 38) {
swiper.slidePrev();
}
}
swiper.emit('keyPress', kc);
return undefined;
},
enable: function enable() {
var swiper = this;
if (swiper.keyboard.enabled) {
return;
}
$(doc).on('keydown', swiper.keyboard.handle);
swiper.keyboard.enabled = true;
},
disable: function disable() {
var swiper = this;
if (!swiper.keyboard.enabled) {
return;
}
$(doc).off('keydown', swiper.keyboard.handle);
swiper.keyboard.enabled = false;
}
};
var Keyboard$1 = {
name: 'keyboard',
params: {
keyboard: {
enabled: false,
onlyInViewport: true
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
keyboard: {
enabled: false,
enable: Keyboard.enable.bind(swiper),
disable: Keyboard.disable.bind(swiper),
handle: Keyboard.handle.bind(swiper)
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.keyboard.enabled) {
swiper.keyboard.enable();
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.keyboard.enabled) {
swiper.keyboard.disable();
}
}
}
};
function isEventSupported() {
var eventName = 'onwheel';
var isSupported = eventName in doc;
if (!isSupported) {
var element = doc.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && doc.implementation && doc.implementation.hasFeature // always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
&& doc.implementation.hasFeature('', '') !== true) {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = doc.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
var Mousewheel = {
lastScrollTime: Utils.now(),
event: function getEvent() {
if (win.navigator.userAgent.indexOf('firefox') > -1) {
return 'DOMMouseScroll';
}
return isEventSupported() ? 'wheel' : 'mousewheel';
}(),
normalize: function normalize(e) {
// Reasonable defaults
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
var sX = 0;
var sY = 0; // spinX, spinY
var pX = 0;
var pY = 0; // pixelX, pixelY
// Legacy
if ('detail' in e) {
sY = e.detail;
}
if ('wheelDelta' in e) {
sY = -e.wheelDelta / 120;
}
if ('wheelDeltaY' in e) {
sY = -e.wheelDeltaY / 120;
}
if ('wheelDeltaX' in e) {
sX = -e.wheelDeltaX / 120;
} // side scrolling on FF with DOMMouseScroll
if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
sX = sY;
sY = 0;
}
pX = sX * PIXEL_STEP;
pY = sY * PIXEL_STEP;
if ('deltaY' in e) {
pY = e.deltaY;
}
if ('deltaX' in e) {
pX = e.deltaX;
}
if ((pX || pY) && e.deltaMode) {
if (e.deltaMode === 1) {
// delta in LINE units
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
} else {
// delta in PAGE units
pX *= PAGE_HEIGHT;
pY *= PAGE_HEIGHT;
}
} // Fall-back if spin cannot be determined
if (pX && !sX) {
sX = pX < 1 ? -1 : 1;
}
if (pY && !sY) {
sY = pY < 1 ? -1 : 1;
}
return {
spinX: sX,
spinY: sY,
pixelX: pX,
pixelY: pY
};
},
handleMouseEnter: function handleMouseEnter() {
var swiper = this;
swiper.mouseEntered = true;
},
handleMouseLeave: function handleMouseLeave() {
var swiper = this;
swiper.mouseEntered = false;
},
handle: function handle(event) {
var e = event;
var swiper = this;
var params = swiper.params.mousewheel;
if (!swiper.mouseEntered && !params.releaseOnEdges) {
return true;
}
if (e.originalEvent) {
e = e.originalEvent;
} // jquery fix
var delta = 0;
var rtlFactor = swiper.rtlTranslate ? -1 : 1;
var data = Mousewheel.normalize(e);
if (params.forceToAxis) {
if (swiper.isHorizontal()) {
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) {
delta = data.pixelX * rtlFactor;
} else {
return true;
}
} else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) {
delta = data.pixelY;
} else {
return true;
}
} else {
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
}
if (delta === 0) {
return true;
}
if (params.invert) {
delta = -delta;
}
if (!swiper.params.freeMode) {
if (Utils.now() - swiper.mousewheel.lastScrollTime > 60) {
if (delta < 0) {
if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
swiper.slideNext();
swiper.emit('scroll', e);
} else if (params.releaseOnEdges) {
return true;
}
} else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
swiper.slidePrev();
swiper.emit('scroll', e);
} else if (params.releaseOnEdges) {
return true;
}
}
swiper.mousewheel.lastScrollTime = new win.Date().getTime();
} else {
// Freemode or scrollContainer:
if (swiper.params.loop) {
swiper.loopFix();
}
var position = swiper.getTranslate() + delta * params.sensitivity;
var wasBeginning = swiper.isBeginning;
var wasEnd = swiper.isEnd;
if (position >= swiper.minTranslate()) {
position = swiper.minTranslate();
}
if (position <= swiper.maxTranslate()) {
position = swiper.maxTranslate();
}
swiper.setTransition(0);
swiper.setTranslate(position);
swiper.updateProgress();
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) {
swiper.updateSlidesClasses();
}
if (swiper.params.freeModeSticky) {
clearTimeout(swiper.mousewheel.timeout);
swiper.mousewheel.timeout = Utils.nextTick(function () {
swiper.slideToClosest();
}, 300);
} // Emit event
swiper.emit('scroll', e); // Stop autoplay
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) {
swiper.autoplay.stop();
} // Return page scroll on edge positions
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) {
return true;
}
}
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
return false;
},
enable: function enable() {
var swiper = this;
if (!Mousewheel.event) {
return false;
}
if (swiper.mousewheel.enabled) {
return false;
}
var target = swiper.$el;
if (swiper.params.mousewheel.eventsTarged !== 'container') {
target = $(swiper.params.mousewheel.eventsTarged);
}
target.on('mouseenter', swiper.mousewheel.handleMouseEnter);
target.on('mouseleave', swiper.mousewheel.handleMouseLeave);
target.on(Mousewheel.event, swiper.mousewheel.handle);
swiper.mousewheel.enabled = true;
return true;
},
disable: function disable() {
var swiper = this;
if (!Mousewheel.event) {
return false;
}
if (!swiper.mousewheel.enabled) {
return false;
}
var target = swiper.$el;
if (swiper.params.mousewheel.eventsTarged !== 'container') {
target = $(swiper.params.mousewheel.eventsTarged);
}
target.off(Mousewheel.event, swiper.mousewheel.handle);
swiper.mousewheel.enabled = false;
return true;
}
};
var Mousewheel$1 = {
name: 'mousewheel',
params: {
mousewheel: {
enabled: false,
releaseOnEdges: false,
invert: false,
forceToAxis: false,
sensitivity: 1,
eventsTarged: 'container'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
mousewheel: {
enabled: false,
enable: Mousewheel.enable.bind(swiper),
disable: Mousewheel.disable.bind(swiper),
handle: Mousewheel.handle.bind(swiper),
handleMouseEnter: Mousewheel.handleMouseEnter.bind(swiper),
handleMouseLeave: Mousewheel.handleMouseLeave.bind(swiper),
lastScrollTime: Utils.now()
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.mousewheel.enabled) {
swiper.mousewheel.enable();
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.mousewheel.enabled) {
swiper.mousewheel.disable();
}
}
}
};
var Navigation = {
update: function update() {
// Update Navigation Buttons
var swiper = this;
var params = swiper.params.navigation;
if (swiper.params.loop) {
return;
}
var ref = swiper.navigation;
var $nextEl = ref.$nextEl;
var $prevEl = ref.$prevEl;
if ($prevEl && $prevEl.length > 0) {
if (swiper.isBeginning) {
$prevEl.addClass(params.disabledClass);
} else {
$prevEl.removeClass(params.disabledClass);
}
$prevEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
}
if ($nextEl && $nextEl.length > 0) {
if (swiper.isEnd) {
$nextEl.addClass(params.disabledClass);
} else {
$nextEl.removeClass(params.disabledClass);
}
$nextEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
}
},
onPrevClick: function onPrevClick(e) {
var swiper = this;
e.preventDefault();
if (swiper.isBeginning && !swiper.params.loop) {
return;
}
swiper.slidePrev();
},
onNextClick: function onNextClick(e) {
var swiper = this;
e.preventDefault();
if (swiper.isEnd && !swiper.params.loop) {
return;
}
swiper.slideNext();
},
init: function init() {
var swiper = this;
var params = swiper.params.navigation;
if (!(params.nextEl || params.prevEl)) {
return;
}
var $nextEl;
var $prevEl;
if (params.nextEl) {
$nextEl = $(params.nextEl);
if (swiper.params.uniqueNavElements && typeof params.nextEl === 'string' && $nextEl.length > 1 && swiper.$el.find(params.nextEl).length === 1) {
$nextEl = swiper.$el.find(params.nextEl);
}
}
if (params.prevEl) {
$prevEl = $(params.prevEl);
if (swiper.params.uniqueNavElements && typeof params.prevEl === 'string' && $prevEl.length > 1 && swiper.$el.find(params.prevEl).length === 1) {
$prevEl = swiper.$el.find(params.prevEl);
}
}
if ($nextEl && $nextEl.length > 0) {
$nextEl.on('click', swiper.navigation.onNextClick);
}
if ($prevEl && $prevEl.length > 0) {
$prevEl.on('click', swiper.navigation.onPrevClick);
}
Utils.extend(swiper.navigation, {
$nextEl: $nextEl,
nextEl: $nextEl && $nextEl[0],
$prevEl: $prevEl,
prevEl: $prevEl && $prevEl[0]
});
},
destroy: function destroy() {
var swiper = this;
var ref = swiper.navigation;
var $nextEl = ref.$nextEl;
var $prevEl = ref.$prevEl;
if ($nextEl && $nextEl.length) {
$nextEl.off('click', swiper.navigation.onNextClick);
$nextEl.removeClass(swiper.params.navigation.disabledClass);
}
if ($prevEl && $prevEl.length) {
$prevEl.off('click', swiper.navigation.onPrevClick);
$prevEl.removeClass(swiper.params.navigation.disabledClass);
}
}
};
var Navigation$1 = {
name: 'navigation',
params: {
navigation: {
nextEl: null,
prevEl: null,
hideOnClick: false,
disabledClass: 'swiper-button-disabled',
hiddenClass: 'swiper-button-hidden',
lockClass: 'swiper-button-lock'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
navigation: {
init: Navigation.init.bind(swiper),
update: Navigation.update.bind(swiper),
destroy: Navigation.destroy.bind(swiper),
onNextClick: Navigation.onNextClick.bind(swiper),
onPrevClick: Navigation.onPrevClick.bind(swiper)
}
});
},
on: {
init: function init() {
var swiper = this;
swiper.navigation.init();
swiper.navigation.update();
},
toEdge: function toEdge() {
var swiper = this;
swiper.navigation.update();
},
fromEdge: function fromEdge() {
var swiper = this;
swiper.navigation.update();
},
destroy: function destroy() {
var swiper = this;
swiper.navigation.destroy();
},
click: function click(e) {
var swiper = this;
var ref = swiper.navigation;
var $nextEl = ref.$nextEl;
var $prevEl = ref.$prevEl;
if (swiper.params.navigation.hideOnClick && !$(e.target).is($prevEl) && !$(e.target).is($nextEl)) {
var isHidden;
if ($nextEl) {
isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);
} else if ($prevEl) {
isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);
}
if (isHidden === true) {
swiper.emit('navigationShow', swiper);
} else {
swiper.emit('navigationHide', swiper);
}
if ($nextEl) {
$nextEl.toggleClass(swiper.params.navigation.hiddenClass);
}
if ($prevEl) {
$prevEl.toggleClass(swiper.params.navigation.hiddenClass);
}
}
}
}
};
var Pagination = {
update: function update() {
// Render || Update Pagination bullets/items
var swiper = this;
var rtl = swiper.rtl;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) {
return;
}
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
var $el = swiper.pagination.$el; // Current/Total
var current;
var total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
if (swiper.params.loop) {
current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);
if (current > slidesLength - 1 - swiper.loopedSlides * 2) {
current -= slidesLength - swiper.loopedSlides * 2;
}
if (current > total - 1) {
current -= total;
}
if (current < 0 && swiper.params.paginationType !== 'bullets') {
current = total + current;
}
} else if (typeof swiper.snapIndex !== 'undefined') {
current = swiper.snapIndex;
} else {
current = swiper.activeIndex || 0;
} // Types
if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
var bullets = swiper.pagination.bullets;
var firstIndex;
var lastIndex;
var midIndex;
if (params.dynamicBullets) {
swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);
$el.css(swiper.isHorizontal() ? 'width' : 'height', swiper.pagination.bulletSize * (params.dynamicMainBullets + 4) + "px");
if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
swiper.pagination.dynamicBulletIndex += current - swiper.previousIndex;
if (swiper.pagination.dynamicBulletIndex > params.dynamicMainBullets - 1) {
swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;
} else if (swiper.pagination.dynamicBulletIndex < 0) {
swiper.pagination.dynamicBulletIndex = 0;
}
}
firstIndex = current - swiper.pagination.dynamicBulletIndex;
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
midIndex = (lastIndex + firstIndex) / 2;
}
bullets.removeClass(params.bulletActiveClass + " " + params.bulletActiveClass + "-next " + params.bulletActiveClass + "-next-next " + params.bulletActiveClass + "-prev " + params.bulletActiveClass + "-prev-prev " + params.bulletActiveClass + "-main");
if ($el.length > 1) {
bullets.each(function (index, bullet) {
var $bullet = $(bullet);
var bulletIndex = $bullet.index();
if (bulletIndex === current) {
$bullet.addClass(params.bulletActiveClass);
}
if (params.dynamicBullets) {
if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
$bullet.addClass(params.bulletActiveClass + "-main");
}
if (bulletIndex === firstIndex) {
$bullet.prev().addClass(params.bulletActiveClass + "-prev").prev().addClass(params.bulletActiveClass + "-prev-prev");
}
if (bulletIndex === lastIndex) {
$bullet.next().addClass(params.bulletActiveClass + "-next").next().addClass(params.bulletActiveClass + "-next-next");
}
}
});
} else {
var $bullet = bullets.eq(current);
$bullet.addClass(params.bulletActiveClass);
if (params.dynamicBullets) {
var $firstDisplayedBullet = bullets.eq(firstIndex);
var $lastDisplayedBullet = bullets.eq(lastIndex);
for (var i = firstIndex; i <= lastIndex; i += 1) {
bullets.eq(i).addClass(params.bulletActiveClass + "-main");
}
$firstDisplayedBullet.prev().addClass(params.bulletActiveClass + "-prev").prev().addClass(params.bulletActiveClass + "-prev-prev");
$lastDisplayedBullet.next().addClass(params.bulletActiveClass + "-next").next().addClass(params.bulletActiveClass + "-next-next");
}
}
if (params.dynamicBullets) {
var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
var bulletsOffset = (swiper.pagination.bulletSize * dynamicBulletsLength - swiper.pagination.bulletSize) / 2 - midIndex * swiper.pagination.bulletSize;
var offsetProp = rtl ? 'right' : 'left';
bullets.css(swiper.isHorizontal() ? offsetProp : 'top', bulletsOffset + "px");
}
}
if (params.type === 'fraction') {
$el.find("." + params.currentClass).text(params.formatFractionCurrent(current + 1));
$el.find("." + params.totalClass).text(params.formatFractionTotal(total));
}
if (params.type === 'progressbar') {
var progressbarDirection;
if (params.progressbarOpposite) {
progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
} else {
progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
}
var scale = (current + 1) / total;
var scaleX = 1;
var scaleY = 1;
if (progressbarDirection === 'horizontal') {
scaleX = scale;
} else {
scaleY = scale;
}
$el.find("." + params.progressbarFillClass).transform("translate3d(0,0,0) scaleX(" + scaleX + ") scaleY(" + scaleY + ")").transition(swiper.params.speed);
}
if (params.type === 'custom' && params.renderCustom) {
$el.html(params.renderCustom(swiper, current + 1, total));
swiper.emit('paginationRender', swiper, $el[0]);
} else {
swiper.emit('paginationUpdate', swiper, $el[0]);
}
$el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
},
render: function render() {
// Render Container
var swiper = this;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) {
return;
}
var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
var $el = swiper.pagination.$el;
var paginationHTML = '';
if (params.type === 'bullets') {
var numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
for (var i = 0; i < numberOfBullets; i += 1) {
if (params.renderBullet) {
paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
} else {
paginationHTML += "<" + params.bulletElement + " class=\"" + params.bulletClass + "\"></" + params.bulletElement + ">";
}
}
$el.html(paginationHTML);
swiper.pagination.bullets = $el.find("." + params.bulletClass);
}
if (params.type === 'fraction') {
if (params.renderFraction) {
paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
} else {
paginationHTML = "<span class=\"" + params.currentClass + "\"></span>" + ' / ' + "<span class=\"" + params.totalClass + "\"></span>";
}
$el.html(paginationHTML);
}
if (params.type === 'progressbar') {
if (params.renderProgressbar) {
paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
} else {
paginationHTML = "<span class=\"" + params.progressbarFillClass + "\"></span>";
}
$el.html(paginationHTML);
}
if (params.type !== 'custom') {
swiper.emit('paginationRender', swiper.pagination.$el[0]);
}
},
init: function init() {
var swiper = this;
var params = swiper.params.pagination;
if (!params.el) {
return;
}
var $el = $(params.el);
if ($el.length === 0) {
return;
}
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && swiper.$el.find(params.el).length === 1) {
$el = swiper.$el.find(params.el);
}
if (params.type === 'bullets' && params.clickable) {
$el.addClass(params.clickableClass);
}
$el.addClass(params.modifierClass + params.type);
if (params.type === 'bullets' && params.dynamicBullets) {
$el.addClass("" + params.modifierClass + params.type + "-dynamic");
swiper.pagination.dynamicBulletIndex = 0;
if (params.dynamicMainBullets < 1) {
params.dynamicMainBullets = 1;
}
}
if (params.type === 'progressbar' && params.progressbarOpposite) {
$el.addClass(params.progressbarOppositeClass);
}
if (params.clickable) {
$el.on('click', "." + params.bulletClass, function onClick(e) {
e.preventDefault();
var index = $(this).index() * swiper.params.slidesPerGroup;
if (swiper.params.loop) {
index += swiper.loopedSlides;
}
swiper.slideTo(index);
});
}
Utils.extend(swiper.pagination, {
$el: $el,
el: $el[0]
});
},
destroy: function destroy() {
var swiper = this;
var params = swiper.params.pagination;
if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) {
return;
}
var $el = swiper.pagination.$el;
$el.removeClass(params.hiddenClass);
$el.removeClass(params.modifierClass + params.type);
if (swiper.pagination.bullets) {
swiper.pagination.bullets.removeClass(params.bulletActiveClass);
}
if (params.clickable) {
$el.off('click', "." + params.bulletClass);
}
}
};
var Pagination$1 = {
name: 'pagination',
params: {
pagination: {
el: null,
bulletElement: 'span',
clickable: false,
hideOnClick: false,
renderBullet: null,
renderProgressbar: null,
renderFraction: null,
renderCustom: null,
progressbarOpposite: false,
type: 'bullets',
// 'bullets' or 'progressbar' or 'fraction' or 'custom'
dynamicBullets: false,
dynamicMainBullets: 1,
formatFractionCurrent: function formatFractionCurrent(number) {
return number;
},
formatFractionTotal: function formatFractionTotal(number) {
return number;
},
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
modifierClass: 'swiper-pagination-',
// NEW
currentClass: 'swiper-pagination-current',
totalClass: 'swiper-pagination-total',
hiddenClass: 'swiper-pagination-hidden',
progressbarFillClass: 'swiper-pagination-progressbar-fill',
progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',
clickableClass: 'swiper-pagination-clickable',
// NEW
lockClass: 'swiper-pagination-lock'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
pagination: {
init: Pagination.init.bind(swiper),
render: Pagination.render.bind(swiper),
update: Pagination.update.bind(swiper),
destroy: Pagination.destroy.bind(swiper),
dynamicBulletIndex: 0
}
});
},
on: {
init: function init() {
var swiper = this;
swiper.pagination.init();
swiper.pagination.render();
swiper.pagination.update();
},
activeIndexChange: function activeIndexChange() {
var swiper = this;
if (swiper.params.loop) {
swiper.pagination.update();
} else if (typeof swiper.snapIndex === 'undefined') {
swiper.pagination.update();
}
},
snapIndexChange: function snapIndexChange() {
var swiper = this;
if (!swiper.params.loop) {
swiper.pagination.update();
}
},
slidesLengthChange: function slidesLengthChange() {
var swiper = this;
if (swiper.params.loop) {
swiper.pagination.render();
swiper.pagination.update();
}
},
snapGridLengthChange: function snapGridLengthChange() {
var swiper = this;
if (!swiper.params.loop) {
swiper.pagination.render();
swiper.pagination.update();
}
},
destroy: function destroy() {
var swiper = this;
swiper.pagination.destroy();
},
click: function click(e) {
var swiper = this;
if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && swiper.pagination.$el.length > 0 && !$(e.target).hasClass(swiper.params.pagination.bulletClass)) {
var isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);
if (isHidden === true) {
swiper.emit('paginationShow', swiper);
} else {
swiper.emit('paginationHide', swiper);
}
swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);
}
}
}
};
var Scrollbar = {
setTranslate: function setTranslate() {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) {
return;
}
var scrollbar = swiper.scrollbar;
var rtl = swiper.rtlTranslate;
var progress = swiper.progress;
var dragSize = scrollbar.dragSize;
var trackSize = scrollbar.trackSize;
var $dragEl = scrollbar.$dragEl;
var $el = scrollbar.$el;
var params = swiper.params.scrollbar;
var newSize = dragSize;
var newPos = (trackSize - dragSize) * progress;
if (rtl) {
newPos = -newPos;
if (newPos > 0) {
newSize = dragSize - newPos;
newPos = 0;
} else if (-newPos + dragSize > trackSize) {
newSize = trackSize + newPos;
}
} else if (newPos < 0) {
newSize = dragSize + newPos;
newPos = 0;
} else if (newPos + dragSize > trackSize) {
newSize = trackSize - newPos;
}
if (swiper.isHorizontal()) {
if (Support.transforms3d) {
$dragEl.transform("translate3d(" + newPos + "px, 0, 0)");
} else {
$dragEl.transform("translateX(" + newPos + "px)");
}
$dragEl[0].style.width = newSize + "px";
} else {
if (Support.transforms3d) {
$dragEl.transform("translate3d(0px, " + newPos + "px, 0)");
} else {
$dragEl.transform("translateY(" + newPos + "px)");
}
$dragEl[0].style.height = newSize + "px";
}
if (params.hide) {
clearTimeout(swiper.scrollbar.timeout);
$el[0].style.opacity = 1;
swiper.scrollbar.timeout = setTimeout(function () {
$el[0].style.opacity = 0;
$el.transition(400);
}, 1000);
}
},
setTransition: function setTransition(duration) {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) {
return;
}
swiper.scrollbar.$dragEl.transition(duration);
},
updateSize: function updateSize() {
var swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) {
return;
}
var scrollbar = swiper.scrollbar;
var $dragEl = scrollbar.$dragEl;
var $el = scrollbar.$el;
$dragEl[0].style.width = '';
$dragEl[0].style.height = '';
var trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;
var divider = swiper.size / swiper.virtualSize;
var moveDivider = divider * (trackSize / swiper.size);
var dragSize;
if (swiper.params.scrollbar.dragSize === 'auto') {
dragSize = trackSize * divider;
} else {
dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
}
if (swiper.isHorizontal()) {
$dragEl[0].style.width = dragSize + "px";
} else {
$dragEl[0].style.height = dragSize + "px";
}
if (divider >= 1) {
$el[0].style.display = 'none';
} else {
$el[0].style.display = '';
}
if (swiper.params.scrollbar.hide) {
$el[0].style.opacity = 0;
}
Utils.extend(scrollbar, {
trackSize: trackSize,
divider: divider,
moveDivider: moveDivider,
dragSize: dragSize
});
scrollbar.$el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass);
},
getPointerPosition: function getPointerPosition(e) {
var swiper = this;
if (swiper.isHorizontal()) {
return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX || e.clientX;
}
return e.type === 'touchstart' || e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY || e.clientY;
},
setDragPosition: function setDragPosition(e) {
var swiper = this;
var scrollbar = swiper.scrollbar;
var rtl = swiper.rtlTranslate;
var $el = scrollbar.$el;
var dragSize = scrollbar.dragSize;
var trackSize = scrollbar.trackSize;
var dragStartPos = scrollbar.dragStartPos;
var positionRatio;
positionRatio = (scrollbar.getPointerPosition(e) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
positionRatio = Math.max(Math.min(positionRatio, 1), 0);
if (rtl) {
positionRatio = 1 - positionRatio;
}
var position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio;
swiper.updateProgress(position);
swiper.setTranslate(position);
swiper.updateActiveIndex();
swiper.updateSlidesClasses();
},
onDragStart: function onDragStart(e) {
var swiper = this;
var params = swiper.params.scrollbar;
var scrollbar = swiper.scrollbar;
var $wrapperEl = swiper.$wrapperEl;
var $el = scrollbar.$el;
var $dragEl = scrollbar.$dragEl;
swiper.scrollbar.isTouched = true;
swiper.scrollbar.dragStartPos = e.target === $dragEl[0] || e.target === $dragEl ? scrollbar.getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
e.preventDefault();
e.stopPropagation();
$wrapperEl.transition(100);
$dragEl.transition(100);
scrollbar.setDragPosition(e);
clearTimeout(swiper.scrollbar.dragTimeout);
$el.transition(0);
if (params.hide) {
$el.css('opacity', 1);
}
swiper.emit('scrollbarDragStart', e);
},
onDragMove: function onDragMove(e) {
var swiper = this;
var scrollbar = swiper.scrollbar;
var $wrapperEl = swiper.$wrapperEl;
var $el = scrollbar.$el;
var $dragEl = scrollbar.$dragEl;
if (!swiper.scrollbar.isTouched) {
return;
}
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
scrollbar.setDragPosition(e);
$wrapperEl.transition(0);
$el.transition(0);
$dragEl.transition(0);
swiper.emit('scrollbarDragMove', e);
},
onDragEnd: function onDragEnd(e) {
var swiper = this;
var params = swiper.params.scrollbar;
var scrollbar = swiper.scrollbar;
var $el = scrollbar.$el;
if (!swiper.scrollbar.isTouched) {
return;
}
swiper.scrollbar.isTouched = false;
if (params.hide) {
clearTimeout(swiper.scrollbar.dragTimeout);
swiper.scrollbar.dragTimeout = Utils.nextTick(function () {
$el.css('opacity', 0);
$el.transition(400);
}, 1000);
}
swiper.emit('scrollbarDragEnd', e);
if (params.snapOnRelease) {
swiper.slideToClosest();
}
},
enableDraggable: function enableDraggable() {
var swiper = this;
if (!swiper.params.scrollbar.el) {
return;
}
var scrollbar = swiper.scrollbar;
var touchEventsTouch = swiper.touchEventsTouch;
var touchEventsDesktop = swiper.touchEventsDesktop;
var params = swiper.params;
var $el = scrollbar.$el;
var target = $el[0];
var activeListener = Support.passiveListener && params.passiveListeners ? {
passive: false,
capture: false
} : false;
var passiveListener = Support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
if (!Support.touch) {
target.addEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
doc.addEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
doc.addEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
} else {
target.addEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
target.addEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
target.addEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
}
},
disableDraggable: function disableDraggable() {
var swiper = this;
if (!swiper.params.scrollbar.el) {
return;
}
var scrollbar = swiper.scrollbar;
var touchEventsTouch = swiper.touchEventsTouch;
var touchEventsDesktop = swiper.touchEventsDesktop;
var params = swiper.params;
var $el = scrollbar.$el;
var target = $el[0];
var activeListener = Support.passiveListener && params.passiveListeners ? {
passive: false,
capture: false
} : false;
var passiveListener = Support.passiveListener && params.passiveListeners ? {
passive: true,
capture: false
} : false;
if (!Support.touch) {
target.removeEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
doc.removeEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
doc.removeEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
} else {
target.removeEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
target.removeEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
target.removeEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
}
},
init: function init() {
var swiper = this;
if (!swiper.params.scrollbar.el) {
return;
}
var scrollbar = swiper.scrollbar;
var $swiperEl = swiper.$el;
var params = swiper.params.scrollbar;
var $el = $(params.el);
if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) {
$el = $swiperEl.find(params.el);
}
var $dragEl = $el.find("." + swiper.params.scrollbar.dragClass);
if ($dragEl.length === 0) {
$dragEl = $("<div class=\"" + swiper.params.scrollbar.dragClass + "\"></div>");
$el.append($dragEl);
}
Utils.extend(scrollbar, {
$el: $el,
el: $el[0],
$dragEl: $dragEl,
dragEl: $dragEl[0]
});
if (params.draggable) {
scrollbar.enableDraggable();
}
},
destroy: function destroy() {
var swiper = this;
swiper.scrollbar.disableDraggable();
}
};
var Scrollbar$1 = {
name: 'scrollbar',
params: {
scrollbar: {
el: null,
dragSize: 'auto',
hide: false,
draggable: false,
snapOnRelease: true,
lockClass: 'swiper-scrollbar-lock',
dragClass: 'swiper-scrollbar-drag'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
scrollbar: {
init: Scrollbar.init.bind(swiper),
destroy: Scrollbar.destroy.bind(swiper),
updateSize: Scrollbar.updateSize.bind(swiper),
setTranslate: Scrollbar.setTranslate.bind(swiper),
setTransition: Scrollbar.setTransition.bind(swiper),
enableDraggable: Scrollbar.enableDraggable.bind(swiper),
disableDraggable: Scrollbar.disableDraggable.bind(swiper),
setDragPosition: Scrollbar.setDragPosition.bind(swiper),
getPointerPosition: Scrollbar.getPointerPosition.bind(swiper),
onDragStart: Scrollbar.onDragStart.bind(swiper),
onDragMove: Scrollbar.onDragMove.bind(swiper),
onDragEnd: Scrollbar.onDragEnd.bind(swiper),
isTouched: false,
timeout: null,
dragTimeout: null
}
});
},
on: {
init: function init() {
var swiper = this;
swiper.scrollbar.init();
swiper.scrollbar.updateSize();
swiper.scrollbar.setTranslate();
},
update: function update() {
var swiper = this;
swiper.scrollbar.updateSize();
},
resize: function resize() {
var swiper = this;
swiper.scrollbar.updateSize();
},
observerUpdate: function observerUpdate() {
var swiper = this;
swiper.scrollbar.updateSize();
},
setTranslate: function setTranslate() {
var swiper = this;
swiper.scrollbar.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
swiper.scrollbar.setTransition(duration);
},
destroy: function destroy() {
var swiper = this;
swiper.scrollbar.destroy();
}
}
};
var Parallax = {
setTransform: function setTransform(el, progress) {
var swiper = this;
var rtl = swiper.rtl;
var $el = $(el);
var rtlFactor = rtl ? -1 : 1;
var p = $el.attr('data-swiper-parallax') || '0';
var x = $el.attr('data-swiper-parallax-x');
var y = $el.attr('data-swiper-parallax-y');
var scale = $el.attr('data-swiper-parallax-scale');
var opacity = $el.attr('data-swiper-parallax-opacity');
if (x || y) {
x = x || '0';
y = y || '0';
} else if (swiper.isHorizontal()) {
x = p;
y = '0';
} else {
y = p;
x = '0';
}
if (x.indexOf('%') >= 0) {
x = parseInt(x, 10) * progress * rtlFactor + "%";
} else {
x = x * progress * rtlFactor + "px";
}
if (y.indexOf('%') >= 0) {
y = parseInt(y, 10) * progress + "%";
} else {
y = y * progress + "px";
}
if (typeof opacity !== 'undefined' && opacity !== null) {
var currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress));
$el[0].style.opacity = currentOpacity;
}
if (typeof scale === 'undefined' || scale === null) {
$el.transform("translate3d(" + x + ", " + y + ", 0px)");
} else {
var currentScale = scale - (scale - 1) * (1 - Math.abs(progress));
$el.transform("translate3d(" + x + ", " + y + ", 0px) scale(" + currentScale + ")");
}
},
setTranslate: function setTranslate() {
var swiper = this;
var $el = swiper.$el;
var slides = swiper.slides;
var progress = swiper.progress;
var snapGrid = swiper.snapGrid;
$el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (index, el) {
swiper.parallax.setTransform(el, progress);
});
slides.each(function (slideIndex, slideEl) {
var slideProgress = slideEl.progress;
if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') {
slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1);
}
slideProgress = Math.min(Math.max(slideProgress, -1), 1);
$(slideEl).find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (index, el) {
swiper.parallax.setTransform(el, slideProgress);
});
});
},
setTransition: function setTransition(duration) {
if (duration === void 0) duration = this.params.speed;
var swiper = this;
var $el = swiper.$el;
$el.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').each(function (index, parallaxEl) {
var $parallaxEl = $(parallaxEl);
var parallaxDuration = parseInt($parallaxEl.attr('data-swiper-parallax-duration'), 10) || duration;
if (duration === 0) {
parallaxDuration = 0;
}
$parallaxEl.transition(parallaxDuration);
});
}
};
var Parallax$1 = {
name: 'parallax',
params: {
parallax: {
enabled: false
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
parallax: {
setTransform: Parallax.setTransform.bind(swiper),
setTranslate: Parallax.setTranslate.bind(swiper),
setTransition: Parallax.setTransition.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (!swiper.params.parallax.enabled) {
return;
}
swiper.params.watchSlidesProgress = true;
swiper.originalParams.watchSlidesProgress = true;
},
init: function init() {
var swiper = this;
if (!swiper.params.parallax.enabled) {
return;
}
swiper.parallax.setTranslate();
},
setTranslate: function setTranslate() {
var swiper = this;
if (!swiper.params.parallax.enabled) {
return;
}
swiper.parallax.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
if (!swiper.params.parallax.enabled) {
return;
}
swiper.parallax.setTransition(duration);
}
}
};
var Zoom = {
// Calc Scale From Multi-touches
getDistanceBetweenTouches: function getDistanceBetweenTouches(e) {
if (e.targetTouches.length < 2) {
return 1;
}
var x1 = e.targetTouches[0].pageX;
var y1 = e.targetTouches[0].pageY;
var x2 = e.targetTouches[1].pageX;
var y2 = e.targetTouches[1].pageY;
var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
return distance;
},
// Events
onGestureStart: function onGestureStart(e) {
var swiper = this;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
zoom.fakeGestureTouched = false;
zoom.fakeGestureMoved = false;
if (!Support.gestures) {
if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {
return;
}
zoom.fakeGestureTouched = true;
gesture.scaleStart = Zoom.getDistanceBetweenTouches(e);
}
if (!gesture.$slideEl || !gesture.$slideEl.length) {
gesture.$slideEl = $(e.target).closest('.swiper-slide');
if (gesture.$slideEl.length === 0) {
gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
}
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
if (gesture.$imageWrapEl.length === 0) {
gesture.$imageEl = undefined;
return;
}
}
gesture.$imageEl.transition(0);
swiper.zoom.isScaling = true;
},
onGestureChange: function onGestureChange(e) {
var swiper = this;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (!Support.gestures) {
if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {
return;
}
zoom.fakeGestureMoved = true;
gesture.scaleMove = Zoom.getDistanceBetweenTouches(e);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
if (Support.gestures) {
zoom.scale = e.scale * zoom.currentScale;
} else {
zoom.scale = gesture.scaleMove / gesture.scaleStart * zoom.currentScale;
}
if (zoom.scale > gesture.maxRatio) {
zoom.scale = gesture.maxRatio - 1 + Math.pow(zoom.scale - gesture.maxRatio + 1, 0.5);
}
if (zoom.scale < params.minRatio) {
zoom.scale = params.minRatio + 1 - Math.pow(params.minRatio - zoom.scale + 1, 0.5);
}
gesture.$imageEl.transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
},
onGestureEnd: function onGestureEnd(e) {
var swiper = this;
var params = swiper.params.zoom;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (!Support.gestures) {
if (!zoom.fakeGestureTouched || !zoom.fakeGestureMoved) {
return;
}
if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2 && !Device.android) {
return;
}
zoom.fakeGestureTouched = false;
zoom.fakeGestureMoved = false;
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
gesture.$imageEl.transition(swiper.params.speed).transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
zoom.currentScale = zoom.scale;
zoom.isScaling = false;
if (zoom.scale === 1) {
gesture.$slideEl = undefined;
}
},
onTouchStart: function onTouchStart(e) {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
var image = zoom.image;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
if (image.isTouched) {
return;
}
if (Device.android) {
e.preventDefault();
}
image.isTouched = true;
image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
},
onTouchMove: function onTouchMove(e) {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
var image = zoom.image;
var velocity = zoom.velocity;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
swiper.allowClick = false;
if (!image.isTouched || !gesture.$slideEl) {
return;
}
if (!image.isMoved) {
image.width = gesture.$imageEl[0].offsetWidth;
image.height = gesture.$imageEl[0].offsetHeight;
image.startX = Utils.getTranslate(gesture.$imageWrapEl[0], 'x') || 0;
image.startY = Utils.getTranslate(gesture.$imageWrapEl[0], 'y') || 0;
gesture.slideWidth = gesture.$slideEl[0].offsetWidth;
gesture.slideHeight = gesture.$slideEl[0].offsetHeight;
gesture.$imageWrapEl.transition(0);
if (swiper.rtl) {
image.startX = -image.startX;
image.startY = -image.startY;
}
} // Define if we need image drag
var scaledWidth = image.width * zoom.scale;
var scaledHeight = image.height * zoom.scale;
if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) {
return;
}
image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
image.maxX = -image.minX;
image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
image.maxY = -image.minY;
image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
if (!image.isMoved && !zoom.isScaling) {
if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) {
image.isTouched = false;
return;
}
if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) {
image.isTouched = false;
return;
}
}
e.preventDefault();
e.stopPropagation();
image.isMoved = true;
image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX;
image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY;
if (image.currentX < image.minX) {
image.currentX = image.minX + 1 - Math.pow(image.minX - image.currentX + 1, 0.8);
}
if (image.currentX > image.maxX) {
image.currentX = image.maxX - 1 + Math.pow(image.currentX - image.maxX + 1, 0.8);
}
if (image.currentY < image.minY) {
image.currentY = image.minY + 1 - Math.pow(image.minY - image.currentY + 1, 0.8);
}
if (image.currentY > image.maxY) {
image.currentY = image.maxY - 1 + Math.pow(image.currentY - image.maxY + 1, 0.8);
} // Velocity
if (!velocity.prevPositionX) {
velocity.prevPositionX = image.touchesCurrent.x;
}
if (!velocity.prevPositionY) {
velocity.prevPositionY = image.touchesCurrent.y;
}
if (!velocity.prevTime) {
velocity.prevTime = Date.now();
}
velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) {
velocity.x = 0;
}
if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) {
velocity.y = 0;
}
velocity.prevPositionX = image.touchesCurrent.x;
velocity.prevPositionY = image.touchesCurrent.y;
velocity.prevTime = Date.now();
gesture.$imageWrapEl.transform("translate3d(" + image.currentX + "px, " + image.currentY + "px,0)");
},
onTouchEnd: function onTouchEnd() {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
var image = zoom.image;
var velocity = zoom.velocity;
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
if (!image.isTouched || !image.isMoved) {
image.isTouched = false;
image.isMoved = false;
return;
}
image.isTouched = false;
image.isMoved = false;
var momentumDurationX = 300;
var momentumDurationY = 300;
var momentumDistanceX = velocity.x * momentumDurationX;
var newPositionX = image.currentX + momentumDistanceX;
var momentumDistanceY = velocity.y * momentumDurationY;
var newPositionY = image.currentY + momentumDistanceY; // Fix duration
if (velocity.x !== 0) {
momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);
}
if (velocity.y !== 0) {
momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);
}
var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
image.currentX = newPositionX;
image.currentY = newPositionY; // Define if we need image drag
var scaledWidth = image.width * zoom.scale;
var scaledHeight = image.height * zoom.scale;
image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0);
image.maxX = -image.minX;
image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);
image.maxY = -image.minY;
image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);
gesture.$imageWrapEl.transition(momentumDuration).transform("translate3d(" + image.currentX + "px, " + image.currentY + "px,0)");
},
onTransitionEnd: function onTransitionEnd() {
var swiper = this;
var zoom = swiper.zoom;
var gesture = zoom.gesture;
if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) {
gesture.$imageEl.transform('translate3d(0,0,0) scale(1)');
gesture.$imageWrapEl.transform('translate3d(0,0,0)');
zoom.scale = 1;
zoom.currentScale = 1;
gesture.$slideEl = undefined;
gesture.$imageEl = undefined;
gesture.$imageWrapEl = undefined;
}
},
// Toggle Zoom
toggle: function toggle(e) {
var swiper = this;
var zoom = swiper.zoom;
if (zoom.scale && zoom.scale !== 1) {
// Zoom Out
zoom.out();
} else {
// Zoom In
zoom.in(e);
}
},
in: function in$1(e) {
var swiper = this;
var zoom = swiper.zoom;
var params = swiper.params.zoom;
var gesture = zoom.gesture;
var image = zoom.image;
if (!gesture.$slideEl) {
gesture.$slideEl = swiper.clickedSlide ? $(swiper.clickedSlide) : swiper.slides.eq(swiper.activeIndex);
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
gesture.$slideEl.addClass("" + params.zoomedSlideClass);
var touchX;
var touchY;
var offsetX;
var offsetY;
var diffX;
var diffY;
var translateX;
var translateY;
var imageWidth;
var imageHeight;
var scaledWidth;
var scaledHeight;
var translateMinX;
var translateMinY;
var translateMaxX;
var translateMaxY;
var slideWidth;
var slideHeight;
if (typeof image.touchesStart.x === 'undefined' && e) {
touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
} else {
touchX = image.touchesStart.x;
touchY = image.touchesStart.y;
}
zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
zoom.currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
if (e) {
slideWidth = gesture.$slideEl[0].offsetWidth;
slideHeight = gesture.$slideEl[0].offsetHeight;
offsetX = gesture.$slideEl.offset().left;
offsetY = gesture.$slideEl.offset().top;
diffX = offsetX + slideWidth / 2 - touchX;
diffY = offsetY + slideHeight / 2 - touchY;
imageWidth = gesture.$imageEl[0].offsetWidth;
imageHeight = gesture.$imageEl[0].offsetHeight;
scaledWidth = imageWidth * zoom.scale;
scaledHeight = imageHeight * zoom.scale;
translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0);
translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0);
translateMaxX = -translateMinX;
translateMaxY = -translateMinY;
translateX = diffX * zoom.scale;
translateY = diffY * zoom.scale;
if (translateX < translateMinX) {
translateX = translateMinX;
}
if (translateX > translateMaxX) {
translateX = translateMaxX;
}
if (translateY < translateMinY) {
translateY = translateMinY;
}
if (translateY > translateMaxY) {
translateY = translateMaxY;
}
} else {
translateX = 0;
translateY = 0;
}
gesture.$imageWrapEl.transition(300).transform("translate3d(" + translateX + "px, " + translateY + "px,0)");
gesture.$imageEl.transition(300).transform("translate3d(0,0,0) scale(" + zoom.scale + ")");
},
out: function out() {
var swiper = this;
var zoom = swiper.zoom;
var params = swiper.params.zoom;
var gesture = zoom.gesture;
if (!gesture.$slideEl) {
gesture.$slideEl = swiper.clickedSlide ? $(swiper.clickedSlide) : swiper.slides.eq(swiper.activeIndex);
gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas');
gesture.$imageWrapEl = gesture.$imageEl.parent("." + params.containerClass);
}
if (!gesture.$imageEl || gesture.$imageEl.length === 0) {
return;
}
zoom.scale = 1;
zoom.currentScale = 1;
gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)');
gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)');
gesture.$slideEl.removeClass("" + params.zoomedSlideClass);
gesture.$slideEl = undefined;
},
// Attach/Detach Events
enable: function enable() {
var swiper = this;
var zoom = swiper.zoom;
if (zoom.enabled) {
return;
}
zoom.enabled = true;
var passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? {
passive: true,
capture: false
} : false; // Scale image
if (Support.gestures) {
swiper.$wrapperEl.on('gesturestart', '.swiper-slide', zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.on('gesturechange', '.swiper-slide', zoom.onGestureChange, passiveListener);
swiper.$wrapperEl.on('gestureend', '.swiper-slide', zoom.onGestureEnd, passiveListener);
} else if (swiper.touchEvents.start === 'touchstart') {
swiper.$wrapperEl.on(swiper.touchEvents.start, '.swiper-slide', zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.on(swiper.touchEvents.move, '.swiper-slide', zoom.onGestureChange, passiveListener);
swiper.$wrapperEl.on(swiper.touchEvents.end, '.swiper-slide', zoom.onGestureEnd, passiveListener);
} // Move image
swiper.$wrapperEl.on(swiper.touchEvents.move, "." + swiper.params.zoom.containerClass, zoom.onTouchMove);
},
disable: function disable() {
var swiper = this;
var zoom = swiper.zoom;
if (!zoom.enabled) {
return;
}
swiper.zoom.enabled = false;
var passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? {
passive: true,
capture: false
} : false; // Scale image
if (Support.gestures) {
swiper.$wrapperEl.off('gesturestart', '.swiper-slide', zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.off('gesturechange', '.swiper-slide', zoom.onGestureChange, passiveListener);
swiper.$wrapperEl.off('gestureend', '.swiper-slide', zoom.onGestureEnd, passiveListener);
} else if (swiper.touchEvents.start === 'touchstart') {
swiper.$wrapperEl.off(swiper.touchEvents.start, '.swiper-slide', zoom.onGestureStart, passiveListener);
swiper.$wrapperEl.off(swiper.touchEvents.move, '.swiper-slide', zoom.onGestureChange, passiveListener);
swiper.$wrapperEl.off(swiper.touchEvents.end, '.swiper-slide', zoom.onGestureEnd, passiveListener);
} // Move image
swiper.$wrapperEl.off(swiper.touchEvents.move, "." + swiper.params.zoom.containerClass, zoom.onTouchMove);
}
};
var Zoom$1 = {
name: 'zoom',
params: {
zoom: {
enabled: false,
maxRatio: 3,
minRatio: 1,
toggle: true,
containerClass: 'swiper-zoom-container',
zoomedSlideClass: 'swiper-slide-zoomed'
}
},
create: function create() {
var swiper = this;
var zoom = {
enabled: false,
scale: 1,
currentScale: 1,
isScaling: false,
gesture: {
$slideEl: undefined,
slideWidth: undefined,
slideHeight: undefined,
$imageEl: undefined,
$imageWrapEl: undefined,
maxRatio: 3
},
image: {
isTouched: undefined,
isMoved: undefined,
currentX: undefined,
currentY: undefined,
minX: undefined,
minY: undefined,
maxX: undefined,
maxY: undefined,
width: undefined,
height: undefined,
startX: undefined,
startY: undefined,
touchesStart: {},
touchesCurrent: {}
},
velocity: {
x: undefined,
y: undefined,
prevPositionX: undefined,
prevPositionY: undefined,
prevTime: undefined
}
};
'onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out'.split(' ').forEach(function (methodName) {
zoom[methodName] = Zoom[methodName].bind(swiper);
});
Utils.extend(swiper, {
zoom: zoom
});
var scale = 1;
Object.defineProperty(swiper.zoom, 'scale', {
get: function get() {
return scale;
},
set: function set(value) {
if (scale !== value) {
var imageEl = swiper.zoom.gesture.$imageEl ? swiper.zoom.gesture.$imageEl[0] : undefined;
var slideEl = swiper.zoom.gesture.$slideEl ? swiper.zoom.gesture.$slideEl[0] : undefined;
swiper.emit('zoomChange', value, imageEl, slideEl);
}
scale = value;
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.zoom.enabled) {
swiper.zoom.enable();
}
},
destroy: function destroy() {
var swiper = this;
swiper.zoom.disable();
},
touchStart: function touchStart(e) {
var swiper = this;
if (!swiper.zoom.enabled) {
return;
}
swiper.zoom.onTouchStart(e);
},
touchEnd: function touchEnd(e) {
var swiper = this;
if (!swiper.zoom.enabled) {
return;
}
swiper.zoom.onTouchEnd(e);
},
doubleTap: function doubleTap(e) {
var swiper = this;
if (swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
swiper.zoom.toggle(e);
}
},
transitionEnd: function transitionEnd() {
var swiper = this;
if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
swiper.zoom.onTransitionEnd();
}
}
}
};
var Lazy = {
loadInSlide: function loadInSlide(index, loadInDuplicate) {
if (loadInDuplicate === void 0) loadInDuplicate = true;
var swiper = this;
var params = swiper.params.lazy;
if (typeof index === 'undefined') {
return;
}
if (swiper.slides.length === 0) {
return;
}
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
var $slideEl = isVirtual ? swiper.$wrapperEl.children("." + swiper.params.slideClass + "[data-swiper-slide-index=\"" + index + "\"]") : swiper.slides.eq(index);
var $images = $slideEl.find("." + params.elementClass + ":not(." + params.loadedClass + "):not(." + params.loadingClass + ")");
if ($slideEl.hasClass(params.elementClass) && !$slideEl.hasClass(params.loadedClass) && !$slideEl.hasClass(params.loadingClass)) {
$images = $images.add($slideEl[0]);
}
if ($images.length === 0) {
return;
}
$images.each(function (imageIndex, imageEl) {
var $imageEl = $(imageEl);
$imageEl.addClass(params.loadingClass);
var background = $imageEl.attr('data-background');
var src = $imageEl.attr('data-src');
var srcset = $imageEl.attr('data-srcset');
var sizes = $imageEl.attr('data-sizes');
swiper.loadImage($imageEl[0], src || background, srcset, sizes, false, function () {
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper && !swiper.params || swiper.destroyed) {
return;
}
if (background) {
$imageEl.css('background-image', "url(\"" + background + "\")");
$imageEl.removeAttr('data-background');
} else {
if (srcset) {
$imageEl.attr('srcset', srcset);
$imageEl.removeAttr('data-srcset');
}
if (sizes) {
$imageEl.attr('sizes', sizes);
$imageEl.removeAttr('data-sizes');
}
if (src) {
$imageEl.attr('src', src);
$imageEl.removeAttr('data-src');
}
}
$imageEl.addClass(params.loadedClass).removeClass(params.loadingClass);
$slideEl.find("." + params.preloaderClass).remove();
if (swiper.params.loop && loadInDuplicate) {
var slideOriginalIndex = $slideEl.attr('data-swiper-slide-index');
if ($slideEl.hasClass(swiper.params.slideDuplicateClass)) {
var originalSlide = swiper.$wrapperEl.children("[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]:not(." + swiper.params.slideDuplicateClass + ")");
swiper.lazy.loadInSlide(originalSlide.index(), false);
} else {
var duplicatedSlide = swiper.$wrapperEl.children("." + swiper.params.slideDuplicateClass + "[data-swiper-slide-index=\"" + slideOriginalIndex + "\"]");
swiper.lazy.loadInSlide(duplicatedSlide.index(), false);
}
}
swiper.emit('lazyImageReady', $slideEl[0], $imageEl[0]);
});
swiper.emit('lazyImageLoad', $slideEl[0], $imageEl[0]);
});
},
load: function load() {
var swiper = this;
var $wrapperEl = swiper.$wrapperEl;
var swiperParams = swiper.params;
var slides = swiper.slides;
var activeIndex = swiper.activeIndex;
var isVirtual = swiper.virtual && swiperParams.virtual.enabled;
var params = swiperParams.lazy;
var slidesPerView = swiperParams.slidesPerView;
if (slidesPerView === 'auto') {
slidesPerView = 0;
}
function slideExist(index) {
if (isVirtual) {
if ($wrapperEl.children("." + swiperParams.slideClass + "[data-swiper-slide-index=\"" + index + "\"]").length) {
return true;
}
} else if (slides[index]) {
return true;
}
return false;
}
function slideIndex(slideEl) {
if (isVirtual) {
return $(slideEl).attr('data-swiper-slide-index');
}
return $(slideEl).index();
}
if (!swiper.lazy.initialImageLoaded) {
swiper.lazy.initialImageLoaded = true;
}
if (swiper.params.watchSlidesVisibility) {
$wrapperEl.children("." + swiperParams.slideVisibleClass).each(function (elIndex, slideEl) {
var index = isVirtual ? $(slideEl).attr('data-swiper-slide-index') : $(slideEl).index();
swiper.lazy.loadInSlide(index);
});
} else if (slidesPerView > 1) {
for (var i = activeIndex; i < activeIndex + slidesPerView; i += 1) {
if (slideExist(i)) {
swiper.lazy.loadInSlide(i);
}
}
} else {
swiper.lazy.loadInSlide(activeIndex);
}
if (params.loadPrevNext) {
if (slidesPerView > 1 || params.loadPrevNextAmount && params.loadPrevNextAmount > 1) {
var amount = params.loadPrevNextAmount;
var spv = slidesPerView;
var maxIndex = Math.min(activeIndex + spv + Math.max(amount, spv), slides.length);
var minIndex = Math.max(activeIndex - Math.max(spv, amount), 0); // Next Slides
for (var i$1 = activeIndex + slidesPerView; i$1 < maxIndex; i$1 += 1) {
if (slideExist(i$1)) {
swiper.lazy.loadInSlide(i$1);
}
} // Prev Slides
for (var i$2 = minIndex; i$2 < activeIndex; i$2 += 1) {
if (slideExist(i$2)) {
swiper.lazy.loadInSlide(i$2);
}
}
} else {
var nextSlide = $wrapperEl.children("." + swiperParams.slideNextClass);
if (nextSlide.length > 0) {
swiper.lazy.loadInSlide(slideIndex(nextSlide));
}
var prevSlide = $wrapperEl.children("." + swiperParams.slidePrevClass);
if (prevSlide.length > 0) {
swiper.lazy.loadInSlide(slideIndex(prevSlide));
}
}
}
}
};
var Lazy$1 = {
name: 'lazy',
params: {
lazy: {
enabled: false,
loadPrevNext: false,
loadPrevNextAmount: 1,
loadOnTransitionStart: false,
elementClass: 'swiper-lazy',
loadingClass: 'swiper-lazy-loading',
loadedClass: 'swiper-lazy-loaded',
preloaderClass: 'swiper-lazy-preloader'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
lazy: {
initialImageLoaded: false,
load: Lazy.load.bind(swiper),
loadInSlide: Lazy.loadInSlide.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (swiper.params.lazy.enabled && swiper.params.preloadImages) {
swiper.params.preloadImages = false;
}
},
init: function init() {
var swiper = this;
if (swiper.params.lazy.enabled && !swiper.params.loop && swiper.params.initialSlide === 0) {
swiper.lazy.load();
}
},
scroll: function scroll() {
var swiper = this;
if (swiper.params.freeMode && !swiper.params.freeModeSticky) {
swiper.lazy.load();
}
},
resize: function resize() {
var swiper = this;
if (swiper.params.lazy.enabled) {
swiper.lazy.load();
}
},
scrollbarDragMove: function scrollbarDragMove() {
var swiper = this;
if (swiper.params.lazy.enabled) {
swiper.lazy.load();
}
},
transitionStart: function transitionStart() {
var swiper = this;
if (swiper.params.lazy.enabled) {
if (swiper.params.lazy.loadOnTransitionStart || !swiper.params.lazy.loadOnTransitionStart && !swiper.lazy.initialImageLoaded) {
swiper.lazy.load();
}
}
},
transitionEnd: function transitionEnd() {
var swiper = this;
if (swiper.params.lazy.enabled && !swiper.params.lazy.loadOnTransitionStart) {
swiper.lazy.load();
}
}
}
};
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
var Controller = {
LinearSpline: function LinearSpline(x, y) {
var binarySearch = function search() {
var maxIndex;
var minIndex;
var guess;
return function (array, val) {
minIndex = -1;
maxIndex = array.length;
while (maxIndex - minIndex > 1) {
guess = maxIndex + minIndex >> 1;
if (array[guess] <= val) {
minIndex = guess;
} else {
maxIndex = guess;
}
}
return maxIndex;
};
}();
this.x = x;
this.y = y;
this.lastIndex = x.length - 1; // Given an x value (x2), return the expected y2 value:
// (x1,y1) is the known point before given value,
// (x3,y3) is the known point after given value.
var i1;
var i3;
this.interpolate = function interpolate(x2) {
if (!x2) {
return 0;
} // Get the indexes of x1 and x3 (the array indexes before and after given x2):
i3 = binarySearch(this.x, x2);
i1 = i3 - 1; // We have our indexes i1 & i3, so we can calculate already:
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
};
return this;
},
// xxx: for now i will just save one spline function to to
getInterpolateFunction: function getInterpolateFunction(c) {
var swiper = this;
if (!swiper.controller.spline) {
swiper.controller.spline = swiper.params.loop ? new Controller.LinearSpline(swiper.slidesGrid, c.slidesGrid) : new Controller.LinearSpline(swiper.snapGrid, c.snapGrid);
}
},
setTranslate: function setTranslate(setTranslate$1, byController) {
var swiper = this;
var controlled = swiper.controller.control;
var multiplier;
var controlledTranslate;
function setControlledTranslate(c) {
// this will create an Interpolate function based on the snapGrids
// x is the Grid of the scrolled scroller and y will be the controlled scroller
// it makes sense to create this only once and recall it for the interpolation
// the function does a lot of value caching for performance
var translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
if (swiper.params.controller.by === 'slide') {
swiper.controller.getInterpolateFunction(c); // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
// but it did not work out
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
}
if (!controlledTranslate || swiper.params.controller.by === 'container') {
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
}
if (swiper.params.controller.inverse) {
controlledTranslate = c.maxTranslate() - controlledTranslate;
}
c.updateProgress(controlledTranslate);
c.setTranslate(controlledTranslate, swiper);
c.updateActiveIndex();
c.updateSlidesClasses();
}
if (Array.isArray(controlled)) {
for (var i = 0; i < controlled.length; i += 1) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTranslate(controlled[i]);
}
}
} else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTranslate(controlled);
}
},
setTransition: function setTransition(duration, byController) {
var swiper = this;
var controlled = swiper.controller.control;
var i;
function setControlledTransition(c) {
c.setTransition(duration, swiper);
if (duration !== 0) {
c.transitionStart();
if (c.params.autoHeight) {
Utils.nextTick(function () {
c.updateAutoHeight();
});
}
c.$wrapperEl.transitionEnd(function () {
if (!controlled) {
return;
}
if (c.params.loop && swiper.params.controller.by === 'slide') {
c.loopFix();
}
c.transitionEnd();
});
}
}
if (Array.isArray(controlled)) {
for (i = 0; i < controlled.length; i += 1) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTransition(controlled[i]);
}
}
} else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTransition(controlled);
}
}
};
var Controller$1 = {
name: 'controller',
params: {
controller: {
control: undefined,
inverse: false,
by: 'slide' // or 'container'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
controller: {
control: swiper.params.controller.control,
getInterpolateFunction: Controller.getInterpolateFunction.bind(swiper),
setTranslate: Controller.setTranslate.bind(swiper),
setTransition: Controller.setTransition.bind(swiper)
}
});
},
on: {
update: function update() {
var swiper = this;
if (!swiper.controller.control) {
return;
}
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
resize: function resize() {
var swiper = this;
if (!swiper.controller.control) {
return;
}
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
observerUpdate: function observerUpdate() {
var swiper = this;
if (!swiper.controller.control) {
return;
}
if (swiper.controller.spline) {
swiper.controller.spline = undefined;
delete swiper.controller.spline;
}
},
setTranslate: function setTranslate(translate, byController) {
var swiper = this;
if (!swiper.controller.control) {
return;
}
swiper.controller.setTranslate(translate, byController);
},
setTransition: function setTransition(duration, byController) {
var swiper = this;
if (!swiper.controller.control) {
return;
}
swiper.controller.setTransition(duration, byController);
}
}
};
var a11y = {
makeElFocusable: function makeElFocusable($el) {
$el.attr('tabIndex', '0');
return $el;
},
addElRole: function addElRole($el, role) {
$el.attr('role', role);
return $el;
},
addElLabel: function addElLabel($el, label) {
$el.attr('aria-label', label);
return $el;
},
disableEl: function disableEl($el) {
$el.attr('aria-disabled', true);
return $el;
},
enableEl: function enableEl($el) {
$el.attr('aria-disabled', false);
return $el;
},
onEnterKey: function onEnterKey(e) {
var swiper = this;
var params = swiper.params.a11y;
if (e.keyCode !== 13) {
return;
}
var $targetEl = $(e.target);
if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) {
if (!(swiper.isEnd && !swiper.params.loop)) {
swiper.slideNext();
}
if (swiper.isEnd) {
swiper.a11y.notify(params.lastSlideMessage);
} else {
swiper.a11y.notify(params.nextSlideMessage);
}
}
if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) {
if (!(swiper.isBeginning && !swiper.params.loop)) {
swiper.slidePrev();
}
if (swiper.isBeginning) {
swiper.a11y.notify(params.firstSlideMessage);
} else {
swiper.a11y.notify(params.prevSlideMessage);
}
}
if (swiper.pagination && $targetEl.is("." + swiper.params.pagination.bulletClass)) {
$targetEl[0].click();
}
},
notify: function notify(message) {
var swiper = this;
var notification = swiper.a11y.liveRegion;
if (notification.length === 0) {
return;
}
notification.html('');
notification.html(message);
},
updateNavigation: function updateNavigation() {
var swiper = this;
if (swiper.params.loop) {
return;
}
var ref = swiper.navigation;
var $nextEl = ref.$nextEl;
var $prevEl = ref.$prevEl;
if ($prevEl && $prevEl.length > 0) {
if (swiper.isBeginning) {
swiper.a11y.disableEl($prevEl);
} else {
swiper.a11y.enableEl($prevEl);
}
}
if ($nextEl && $nextEl.length > 0) {
if (swiper.isEnd) {
swiper.a11y.disableEl($nextEl);
} else {
swiper.a11y.enableEl($nextEl);
}
}
},
updatePagination: function updatePagination() {
var swiper = this;
var params = swiper.params.a11y;
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.bullets.each(function (bulletIndex, bulletEl) {
var $bulletEl = $(bulletEl);
swiper.a11y.makeElFocusable($bulletEl);
swiper.a11y.addElRole($bulletEl, 'button');
swiper.a11y.addElLabel($bulletEl, params.paginationBulletMessage.replace(/{{index}}/, $bulletEl.index() + 1));
});
}
},
init: function init() {
var swiper = this;
swiper.$el.append(swiper.a11y.liveRegion); // Navigation
var params = swiper.params.a11y;
var $nextEl;
var $prevEl;
if (swiper.navigation && swiper.navigation.$nextEl) {
$nextEl = swiper.navigation.$nextEl;
}
if (swiper.navigation && swiper.navigation.$prevEl) {
$prevEl = swiper.navigation.$prevEl;
}
if ($nextEl) {
swiper.a11y.makeElFocusable($nextEl);
swiper.a11y.addElRole($nextEl, 'button');
swiper.a11y.addElLabel($nextEl, params.nextSlideMessage);
$nextEl.on('keydown', swiper.a11y.onEnterKey);
}
if ($prevEl) {
swiper.a11y.makeElFocusable($prevEl);
swiper.a11y.addElRole($prevEl, 'button');
swiper.a11y.addElLabel($prevEl, params.prevSlideMessage);
$prevEl.on('keydown', swiper.a11y.onEnterKey);
} // Pagination
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.$el.on('keydown', "." + swiper.params.pagination.bulletClass, swiper.a11y.onEnterKey);
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.a11y.liveRegion && swiper.a11y.liveRegion.length > 0) {
swiper.a11y.liveRegion.remove();
}
var $nextEl;
var $prevEl;
if (swiper.navigation && swiper.navigation.$nextEl) {
$nextEl = swiper.navigation.$nextEl;
}
if (swiper.navigation && swiper.navigation.$prevEl) {
$prevEl = swiper.navigation.$prevEl;
}
if ($nextEl) {
$nextEl.off('keydown', swiper.a11y.onEnterKey);
}
if ($prevEl) {
$prevEl.off('keydown', swiper.a11y.onEnterKey);
} // Pagination
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
swiper.pagination.$el.off('keydown', "." + swiper.params.pagination.bulletClass, swiper.a11y.onEnterKey);
}
}
};
var A11y = {
name: 'a11y',
params: {
a11y: {
enabled: true,
notificationClass: 'swiper-notification',
prevSlideMessage: 'Previous slide',
nextSlideMessage: 'Next slide',
firstSlideMessage: 'This is the first slide',
lastSlideMessage: 'This is the last slide',
paginationBulletMessage: 'Go to slide {{index}}'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
a11y: {
liveRegion: $("<span class=\"" + swiper.params.a11y.notificationClass + "\" aria-live=\"assertive\" aria-atomic=\"true\"></span>")
}
});
Object.keys(a11y).forEach(function (methodName) {
swiper.a11y[methodName] = a11y[methodName].bind(swiper);
});
},
on: {
init: function init() {
var swiper = this;
if (!swiper.params.a11y.enabled) {
return;
}
swiper.a11y.init();
swiper.a11y.updateNavigation();
},
toEdge: function toEdge() {
var swiper = this;
if (!swiper.params.a11y.enabled) {
return;
}
swiper.a11y.updateNavigation();
},
fromEdge: function fromEdge() {
var swiper = this;
if (!swiper.params.a11y.enabled) {
return;
}
swiper.a11y.updateNavigation();
},
paginationUpdate: function paginationUpdate() {
var swiper = this;
if (!swiper.params.a11y.enabled) {
return;
}
swiper.a11y.updatePagination();
},
destroy: function destroy() {
var swiper = this;
if (!swiper.params.a11y.enabled) {
return;
}
swiper.a11y.destroy();
}
}
};
var History = {
init: function init() {
var swiper = this;
if (!swiper.params.history) {
return;
}
if (!win.history || !win.history.pushState) {
swiper.params.history.enabled = false;
swiper.params.hashNavigation.enabled = true;
return;
}
var history = swiper.history;
history.initialized = true;
history.paths = History.getPathValues();
if (!history.paths.key && !history.paths.value) {
return;
}
history.scrollToSlide(0, history.paths.value, swiper.params.runCallbacksOnInit);
if (!swiper.params.history.replaceState) {
win.addEventListener('popstate', swiper.history.setHistoryPopState);
}
},
destroy: function destroy() {
var swiper = this;
if (!swiper.params.history.replaceState) {
win.removeEventListener('popstate', swiper.history.setHistoryPopState);
}
},
setHistoryPopState: function setHistoryPopState() {
var swiper = this;
swiper.history.paths = History.getPathValues();
swiper.history.scrollToSlide(swiper.params.speed, swiper.history.paths.value, false);
},
getPathValues: function getPathValues() {
var pathArray = win.location.pathname.slice(1).split('/').filter(function (part) {
return part !== '';
});
var total = pathArray.length;
var key = pathArray[total - 2];
var value = pathArray[total - 1];
return {
key: key,
value: value
};
},
setHistory: function setHistory(key, index) {
var swiper = this;
if (!swiper.history.initialized || !swiper.params.history.enabled) {
return;
}
var slide = swiper.slides.eq(index);
var value = History.slugify(slide.attr('data-history'));
if (!win.location.pathname.includes(key)) {
value = key + "/" + value;
}
var currentState = win.history.state;
if (currentState && currentState.value === value) {
return;
}
if (swiper.params.history.replaceState) {
win.history.replaceState({
value: value
}, null, value);
} else {
win.history.pushState({
value: value
}, null, value);
}
},
slugify: function slugify(text) {
return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
},
scrollToSlide: function scrollToSlide(speed, value, runCallbacks) {
var swiper = this;
if (value) {
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
var slide = swiper.slides.eq(i);
var slideHistory = History.slugify(slide.attr('data-history'));
if (slideHistory === value && !slide.hasClass(swiper.params.slideDuplicateClass)) {
var index = slide.index();
swiper.slideTo(index, speed, runCallbacks);
}
}
} else {
swiper.slideTo(0, speed, runCallbacks);
}
}
};
var History$1 = {
name: 'history',
params: {
history: {
enabled: false,
replaceState: false,
key: 'slides'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
history: {
init: History.init.bind(swiper),
setHistory: History.setHistory.bind(swiper),
setHistoryPopState: History.setHistoryPopState.bind(swiper),
scrollToSlide: History.scrollToSlide.bind(swiper),
destroy: History.destroy.bind(swiper)
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.history.enabled) {
swiper.history.init();
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.params.history.enabled) {
swiper.history.destroy();
}
},
transitionEnd: function transitionEnd() {
var swiper = this;
if (swiper.history.initialized) {
swiper.history.setHistory(swiper.params.history.key, swiper.activeIndex);
}
}
}
};
var HashNavigation = {
onHashCange: function onHashCange() {
var swiper = this;
var newHash = doc.location.hash.replace('#', '');
var activeSlideHash = swiper.slides.eq(swiper.activeIndex).attr('data-hash');
if (newHash !== activeSlideHash) {
var newIndex = swiper.$wrapperEl.children("." + swiper.params.slideClass + "[data-hash=\"" + newHash + "\"]").index();
if (typeof newIndex === 'undefined') {
return;
}
swiper.slideTo(newIndex);
}
},
setHash: function setHash() {
var swiper = this;
if (!swiper.hashNavigation.initialized || !swiper.params.hashNavigation.enabled) {
return;
}
if (swiper.params.hashNavigation.replaceState && win.history && win.history.replaceState) {
win.history.replaceState(null, null, "#" + swiper.slides.eq(swiper.activeIndex).attr('data-hash') || '');
} else {
var slide = swiper.slides.eq(swiper.activeIndex);
var hash = slide.attr('data-hash') || slide.attr('data-history');
doc.location.hash = hash || '';
}
},
init: function init() {
var swiper = this;
if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) {
return;
}
swiper.hashNavigation.initialized = true;
var hash = doc.location.hash.replace('#', '');
if (hash) {
var speed = 0;
for (var i = 0, length = swiper.slides.length; i < length; i += 1) {
var slide = swiper.slides.eq(i);
var slideHash = slide.attr('data-hash') || slide.attr('data-history');
if (slideHash === hash && !slide.hasClass(swiper.params.slideDuplicateClass)) {
var index = slide.index();
swiper.slideTo(index, speed, swiper.params.runCallbacksOnInit, true);
}
}
}
if (swiper.params.hashNavigation.watchState) {
$(win).on('hashchange', swiper.hashNavigation.onHashCange);
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.params.hashNavigation.watchState) {
$(win).off('hashchange', swiper.hashNavigation.onHashCange);
}
}
};
var HashNavigation$1 = {
name: 'hash-navigation',
params: {
hashNavigation: {
enabled: false,
replaceState: false,
watchState: false
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
hashNavigation: {
initialized: false,
init: HashNavigation.init.bind(swiper),
destroy: HashNavigation.destroy.bind(swiper),
setHash: HashNavigation.setHash.bind(swiper),
onHashCange: HashNavigation.onHashCange.bind(swiper)
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.init();
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.params.hashNavigation.enabled) {
swiper.hashNavigation.destroy();
}
},
transitionEnd: function transitionEnd() {
var swiper = this;
if (swiper.hashNavigation.initialized) {
swiper.hashNavigation.setHash();
}
}
}
};
/* eslint no-underscore-dangle: "off" */
var Autoplay = {
run: function run() {
var swiper = this;
var $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
var delay = swiper.params.autoplay.delay;
if ($activeSlideEl.attr('data-swiper-autoplay')) {
delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
}
clearTimeout(swiper.autoplay.timeout);
swiper.autoplay.timeout = Utils.nextTick(function () {
if (swiper.params.autoplay.reverseDirection) {
if (swiper.params.loop) {
swiper.loopFix();
swiper.slidePrev(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.isBeginning) {
swiper.slidePrev(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.params.autoplay.stopOnLastSlide) {
swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
swiper.emit('autoplay');
} else {
swiper.autoplay.stop();
}
} else if (swiper.params.loop) {
swiper.loopFix();
swiper.slideNext(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.isEnd) {
swiper.slideNext(swiper.params.speed, true, true);
swiper.emit('autoplay');
} else if (!swiper.params.autoplay.stopOnLastSlide) {
swiper.slideTo(0, swiper.params.speed, true, true);
swiper.emit('autoplay');
} else {
swiper.autoplay.stop();
}
}, delay);
},
start: function start() {
var swiper = this;
if (typeof swiper.autoplay.timeout !== 'undefined') {
return false;
}
if (swiper.autoplay.running) {
return false;
}
swiper.autoplay.running = true;
swiper.emit('autoplayStart');
swiper.autoplay.run();
return true;
},
stop: function stop() {
var swiper = this;
if (!swiper.autoplay.running) {
return false;
}
if (typeof swiper.autoplay.timeout === 'undefined') {
return false;
}
if (swiper.autoplay.timeout) {
clearTimeout(swiper.autoplay.timeout);
swiper.autoplay.timeout = undefined;
}
swiper.autoplay.running = false;
swiper.emit('autoplayStop');
return true;
},
pause: function pause(speed) {
var swiper = this;
if (!swiper.autoplay.running) {
return;
}
if (swiper.autoplay.paused) {
return;
}
if (swiper.autoplay.timeout) {
clearTimeout(swiper.autoplay.timeout);
}
swiper.autoplay.paused = true;
if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
swiper.autoplay.paused = false;
swiper.autoplay.run();
} else {
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.autoplay.onTransitionEnd);
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
}
}
};
var Autoplay$1 = {
name: 'autoplay',
params: {
autoplay: {
enabled: false,
delay: 3000,
waitForTransition: true,
disableOnInteraction: true,
stopOnLastSlide: false,
reverseDirection: false
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
autoplay: {
running: false,
paused: false,
run: Autoplay.run.bind(swiper),
start: Autoplay.start.bind(swiper),
stop: Autoplay.stop.bind(swiper),
pause: Autoplay.pause.bind(swiper),
onTransitionEnd: function onTransitionEnd(e) {
if (!swiper || swiper.destroyed || !swiper.$wrapperEl) {
return;
}
if (e.target !== this) {
return;
}
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.autoplay.onTransitionEnd);
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
swiper.autoplay.paused = false;
if (!swiper.autoplay.running) {
swiper.autoplay.stop();
} else {
swiper.autoplay.run();
}
}
}
});
},
on: {
init: function init() {
var swiper = this;
if (swiper.params.autoplay.enabled) {
swiper.autoplay.start();
}
},
beforeTransitionStart: function beforeTransitionStart(speed, internal) {
var swiper = this;
if (swiper.autoplay.running) {
if (internal || !swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.pause(speed);
} else {
swiper.autoplay.stop();
}
}
},
sliderFirstMove: function sliderFirstMove() {
var swiper = this;
if (swiper.autoplay.running) {
if (swiper.params.autoplay.disableOnInteraction) {
swiper.autoplay.stop();
} else {
swiper.autoplay.pause();
}
}
},
destroy: function destroy() {
var swiper = this;
if (swiper.autoplay.running) {
swiper.autoplay.stop();
}
}
}
};
var Fade = {
setTranslate: function setTranslate() {
var swiper = this;
var slides = swiper.slides;
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = swiper.slides.eq(i);
var offset = $slideEl[0].swiperSlideOffset;
var tx = -offset;
if (!swiper.params.virtualTranslate) {
tx -= swiper.translate;
}
var ty = 0;
if (!swiper.isHorizontal()) {
ty = tx;
tx = 0;
}
var slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs($slideEl[0].progress), 0) : 1 + Math.min(Math.max($slideEl[0].progress, -1), 0);
$slideEl.css({
opacity: slideOpacity
}).transform("translate3d(" + tx + "px, " + ty + "px, 0px)");
}
},
setTransition: function setTransition(duration) {
var swiper = this;
var slides = swiper.slides;
var $wrapperEl = swiper.$wrapperEl;
slides.transition(duration);
if (swiper.params.virtualTranslate && duration !== 0) {
var eventTriggered = false;
slides.transitionEnd(function () {
if (eventTriggered) {
return;
}
if (!swiper || swiper.destroyed) {
return;
}
eventTriggered = true;
swiper.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
for (var i = 0; i < triggerEvents.length; i += 1) {
$wrapperEl.trigger(triggerEvents[i]);
}
});
}
}
};
var EffectFade = {
name: 'effect-fade',
params: {
fadeEffect: {
crossFade: false
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
fadeEffect: {
setTranslate: Fade.setTranslate.bind(swiper),
setTransition: Fade.setTransition.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (swiper.params.effect !== 'fade') {
return;
}
swiper.classNames.push(swiper.params.containerModifierClass + "fade");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
spaceBetween: 0,
virtualTranslate: true
};
Utils.extend(swiper.params, overwriteParams);
Utils.extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate() {
var swiper = this;
if (swiper.params.effect !== 'fade') {
return;
}
swiper.fadeEffect.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
if (swiper.params.effect !== 'fade') {
return;
}
swiper.fadeEffect.setTransition(duration);
}
}
};
var Cube = {
setTranslate: function setTranslate() {
var swiper = this;
var $el = swiper.$el;
var $wrapperEl = swiper.$wrapperEl;
var slides = swiper.slides;
var swiperWidth = swiper.width;
var swiperHeight = swiper.height;
var rtl = swiper.rtlTranslate;
var swiperSize = swiper.size;
var params = swiper.params.cubeEffect;
var isHorizontal = swiper.isHorizontal();
var isVirtual = swiper.virtual && swiper.params.virtual.enabled;
var wrapperRotate = 0;
var $cubeShadowEl;
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
$wrapperEl.append($cubeShadowEl);
}
$cubeShadowEl.css({
height: swiperWidth + "px"
});
} else {
$cubeShadowEl = $el.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = $('<div class="swiper-cube-shadow"></div>');
$el.append($cubeShadowEl);
}
}
}
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = slides.eq(i);
var slideIndex = i;
if (isVirtual) {
slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10);
}
var slideAngle = slideIndex * 90;
var round = Math.floor(slideAngle / 360);
if (rtl) {
slideAngle = -slideAngle;
round = Math.floor(-slideAngle / 360);
}
var progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
var tx = 0;
var ty = 0;
var tz = 0;
if (slideIndex % 4 === 0) {
tx = -round * 4 * swiperSize;
tz = 0;
} else if ((slideIndex - 1) % 4 === 0) {
tx = 0;
tz = -round * 4 * swiperSize;
} else if ((slideIndex - 2) % 4 === 0) {
tx = swiperSize + round * 4 * swiperSize;
tz = swiperSize;
} else if ((slideIndex - 3) % 4 === 0) {
tx = -swiperSize;
tz = 3 * swiperSize + swiperSize * 4 * round;
}
if (rtl) {
tx = -tx;
}
if (!isHorizontal) {
ty = tx;
tx = 0;
}
var transform = "rotateX(" + (isHorizontal ? 0 : -slideAngle) + "deg) rotateY(" + (isHorizontal ? slideAngle : 0) + "deg) translate3d(" + tx + "px, " + ty + "px, " + tz + "px)";
if (progress <= 1 && progress > -1) {
wrapperRotate = slideIndex * 90 + progress * 90;
if (rtl) {
wrapperRotate = -slideIndex * 90 - progress * 90;
}
}
$slideEl.transform(transform);
if (params.slideShadows) {
// Set shadows
var shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>");
$slideEl.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>");
$slideEl.append(shadowAfter);
}
if (shadowBefore.length) {
shadowBefore[0].style.opacity = Math.max(-progress, 0);
}
if (shadowAfter.length) {
shadowAfter[0].style.opacity = Math.max(progress, 0);
}
}
}
$wrapperEl.css({
'-webkit-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'-moz-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'-ms-transform-origin': "50% 50% -" + swiperSize / 2 + "px",
'transform-origin': "50% 50% -" + swiperSize / 2 + "px"
});
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl.transform("translate3d(0px, " + (swiperWidth / 2 + params.shadowOffset) + "px, " + -swiperWidth / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + params.shadowScale + ")");
} else {
var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
var scale1 = params.shadowScale;
var scale2 = params.shadowScale / multiplier;
var offset = params.shadowOffset;
$cubeShadowEl.transform("scale3d(" + scale1 + ", 1, " + scale2 + ") translate3d(0px, " + (swiperHeight / 2 + offset) + "px, " + -swiperHeight / 2 / scale2 + "px) rotateX(-90deg)");
}
}
var zFactor = Browser.isSafari || Browser.isUiWebView ? -swiperSize / 2 : 0;
$wrapperEl.transform("translate3d(0px,0," + zFactor + "px) rotateX(" + (swiper.isHorizontal() ? 0 : wrapperRotate) + "deg) rotateY(" + (swiper.isHorizontal() ? -wrapperRotate : 0) + "deg)");
},
setTransition: function setTransition(duration) {
var swiper = this;
var $el = swiper.$el;
var slides = swiper.slides;
slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) {
$el.find('.swiper-cube-shadow').transition(duration);
}
}
};
var EffectCube = {
name: 'effect-cube',
params: {
cubeEffect: {
slideShadows: true,
shadow: true,
shadowOffset: 20,
shadowScale: 0.94
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
cubeEffect: {
setTranslate: Cube.setTranslate.bind(swiper),
setTransition: Cube.setTransition.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (swiper.params.effect !== 'cube') {
return;
}
swiper.classNames.push(swiper.params.containerModifierClass + "cube");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
resistanceRatio: 0,
spaceBetween: 0,
centeredSlides: false,
virtualTranslate: true
};
Utils.extend(swiper.params, overwriteParams);
Utils.extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate() {
var swiper = this;
if (swiper.params.effect !== 'cube') {
return;
}
swiper.cubeEffect.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
if (swiper.params.effect !== 'cube') {
return;
}
swiper.cubeEffect.setTransition(duration);
}
}
};
var Flip = {
setTranslate: function setTranslate() {
var swiper = this;
var slides = swiper.slides;
var rtl = swiper.rtlTranslate;
for (var i = 0; i < slides.length; i += 1) {
var $slideEl = slides.eq(i);
var progress = $slideEl[0].progress;
if (swiper.params.flipEffect.limitRotation) {
progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
}
var offset = $slideEl[0].swiperSlideOffset;
var rotate = -180 * progress;
var rotateY = rotate;
var rotateX = 0;
var tx = -offset;
var ty = 0;
if (!swiper.isHorizontal()) {
ty = tx;
tx = 0;
rotateX = -rotateY;
rotateY = 0;
} else if (rtl) {
rotateY = -rotateY;
}
$slideEl[0].style.zIndex = -Math.abs(Math.round(progress)) + slides.length;
if (swiper.params.flipEffect.slideShadows) {
// Set shadows
var shadowBefore = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var shadowAfter = swiper.isHorizontal() ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'left' : 'top') + "\"></div>");
$slideEl.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $("<div class=\"swiper-slide-shadow-" + (swiper.isHorizontal() ? 'right' : 'bottom') + "\"></div>");
$slideEl.append(shadowAfter);
}
if (shadowBefore.length) {
shadowBefore[0].style.opacity = Math.max(-progress, 0);
}
if (shadowAfter.length) {
shadowAfter[0].style.opacity = Math.max(progress, 0);
}
}
$slideEl.transform("translate3d(" + tx + "px, " + ty + "px, 0px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg)");
}
},
setTransition: function setTransition(duration) {
var swiper = this;
var slides = swiper.slides;
var activeIndex = swiper.activeIndex;
var $wrapperEl = swiper.$wrapperEl;
slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (swiper.params.virtualTranslate && duration !== 0) {
var eventTriggered = false; // eslint-disable-next-line
slides.eq(activeIndex).transitionEnd(function onTransitionEnd() {
if (eventTriggered) {
return;
}
if (!swiper || swiper.destroyed) {
return;
} // if (!$(this).hasClass(swiper.params.slideActiveClass)) return;
eventTriggered = true;
swiper.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend'];
for (var i = 0; i < triggerEvents.length; i += 1) {
$wrapperEl.trigger(triggerEvents[i]);
}
});
}
}
};
var EffectFlip = {
name: 'effect-flip',
params: {
flipEffect: {
slideShadows: true,
limitRotation: true
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
flipEffect: {
setTranslate: Flip.setTranslate.bind(swiper),
setTransition: Flip.setTransition.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (swiper.params.effect !== 'flip') {
return;
}
swiper.classNames.push(swiper.params.containerModifierClass + "flip");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
var overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
spaceBetween: 0,
virtualTranslate: true
};
Utils.extend(swiper.params, overwriteParams);
Utils.extend(swiper.originalParams, overwriteParams);
},
setTranslate: function setTranslate() {
var swiper = this;
if (swiper.params.effect !== 'flip') {
return;
}
swiper.flipEffect.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
if (swiper.params.effect !== 'flip') {
return;
}
swiper.flipEffect.setTransition(duration);
}
}
};
var Coverflow = {
setTranslate: function setTranslate() {
var swiper = this;
var swiperWidth = swiper.width;
var swiperHeight = swiper.height;
var slides = swiper.slides;
var $wrapperEl = swiper.$wrapperEl;
var slidesSizesGrid = swiper.slidesSizesGrid;
var params = swiper.params.coverflowEffect;
var isHorizontal = swiper.isHorizontal();
var transform = swiper.translate;
var center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;
var rotate = isHorizontal ? params.rotate : -params.rotate;
var translate = params.depth; // Each slide offset from center
for (var i = 0, length = slides.length; i < length; i += 1) {
var $slideEl = slides.eq(i);
var slideSize = slidesSizesGrid[i];
var slideOffset = $slideEl[0].swiperSlideOffset;
var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * params.modifier;
var rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
var rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; // var rotateZ = 0
var translateZ = -translate * Math.abs(offsetMultiplier);
var translateY = isHorizontal ? 0 : params.stretch * offsetMultiplier;
var translateX = isHorizontal ? params.stretch * offsetMultiplier : 0; // Fix for ultra small values
if (Math.abs(translateX) < 0.001) {
translateX = 0;
}
if (Math.abs(translateY) < 0.001) {
translateY = 0;
}
if (Math.abs(translateZ) < 0.001) {
translateZ = 0;
}
if (Math.abs(rotateY) < 0.001) {
rotateY = 0;
}
if (Math.abs(rotateX) < 0.001) {
rotateX = 0;
}
var slideTransform = "translate3d(" + translateX + "px," + translateY + "px," + translateZ + "px) rotateX(" + rotateX + "deg) rotateY(" + rotateY + "deg)";
$slideEl.transform(slideTransform);
$slideEl[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
if (params.slideShadows) {
// Set shadows
var $shadowBeforeEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
var $shadowAfterEl = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if ($shadowBeforeEl.length === 0) {
$shadowBeforeEl = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'left' : 'top') + "\"></div>");
$slideEl.append($shadowBeforeEl);
}
if ($shadowAfterEl.length === 0) {
$shadowAfterEl = $("<div class=\"swiper-slide-shadow-" + (isHorizontal ? 'right' : 'bottom') + "\"></div>");
$slideEl.append($shadowAfterEl);
}
if ($shadowBeforeEl.length) {
$shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
}
if ($shadowAfterEl.length) {
$shadowAfterEl[0].style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;
}
}
} // Set correct perspective for IE10
if (Support.pointerEvents || Support.prefixedPointerEvents) {
var ws = $wrapperEl[0].style;
ws.perspectiveOrigin = center + "px 50%";
}
},
setTransition: function setTransition(duration) {
var swiper = this;
swiper.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
}
};
var EffectCoverflow = {
name: 'effect-coverflow',
params: {
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
coverflowEffect: {
setTranslate: Coverflow.setTranslate.bind(swiper),
setTransition: Coverflow.setTransition.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
if (swiper.params.effect !== 'coverflow') {
return;
}
swiper.classNames.push(swiper.params.containerModifierClass + "coverflow");
swiper.classNames.push(swiper.params.containerModifierClass + "3d");
swiper.params.watchSlidesProgress = true;
swiper.originalParams.watchSlidesProgress = true;
},
setTranslate: function setTranslate() {
var swiper = this;
if (swiper.params.effect !== 'coverflow') {
return;
}
swiper.coverflowEffect.setTranslate();
},
setTransition: function setTransition(duration) {
var swiper = this;
if (swiper.params.effect !== 'coverflow') {
return;
}
swiper.coverflowEffect.setTransition(duration);
}
}
};
var Thumbs = {
init: function init() {
var swiper = this;
var ref = swiper.params;
var thumbsParams = ref.thumbs;
var SwiperClass = swiper.constructor;
if (thumbsParams.swiper instanceof SwiperClass) {
swiper.thumbs.swiper = thumbsParams.swiper;
Utils.extend(swiper.thumbs.swiper.originalParams, {
watchSlidesProgress: true,
slideToClickedSlide: false
});
Utils.extend(swiper.thumbs.swiper.params, {
watchSlidesProgress: true,
slideToClickedSlide: false
});
} else if (Utils.isObject(thumbsParams.swiper)) {
swiper.thumbs.swiper = new SwiperClass(Utils.extend({}, thumbsParams.swiper, {
watchSlidesVisibility: true,
watchSlidesProgress: true,
slideToClickedSlide: false
}));
swiper.thumbs.swiperCreated = true;
}
swiper.thumbs.swiper.$el.addClass(swiper.params.thumbs.thumbsContainerClass);
swiper.thumbs.swiper.on('tap', swiper.thumbs.onThumbClick);
},
onThumbClick: function onThumbClick() {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) {
return;
}
var clickedIndex = thumbsSwiper.clickedIndex;
var clickedSlide = thumbsSwiper.clickedSlide;
if (clickedSlide && $(clickedSlide).hasClass(swiper.params.thumbs.slideThumbActiveClass)) {
return;
}
if (typeof clickedIndex === 'undefined' || clickedIndex === null) {
return;
}
var slideToIndex;
if (thumbsSwiper.params.loop) {
slideToIndex = parseInt($(thumbsSwiper.clickedSlide).attr('data-swiper-slide-index'), 10);
} else {
slideToIndex = clickedIndex;
}
if (swiper.params.loop) {
var currentIndex = swiper.activeIndex;
if (swiper.slides.eq(currentIndex).hasClass(swiper.params.slideDuplicateClass)) {
swiper.loopFix(); // eslint-disable-next-line
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
currentIndex = swiper.activeIndex;
}
var prevIndex = swiper.slides.eq(currentIndex).prevAll("[data-swiper-slide-index=\"" + slideToIndex + "\"]").eq(0).index();
var nextIndex = swiper.slides.eq(currentIndex).nextAll("[data-swiper-slide-index=\"" + slideToIndex + "\"]").eq(0).index();
if (typeof prevIndex === 'undefined') {
slideToIndex = nextIndex;
} else if (typeof nextIndex === 'undefined') {
slideToIndex = prevIndex;
} else if (nextIndex - currentIndex < currentIndex - prevIndex) {
slideToIndex = nextIndex;
} else {
slideToIndex = prevIndex;
}
}
swiper.slideTo(slideToIndex);
},
update: function update(initial) {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) {
return;
}
var slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView;
if (swiper.realIndex !== thumbsSwiper.realIndex) {
var currentThumbsIndex = thumbsSwiper.activeIndex;
var newThumbsIndex;
if (thumbsSwiper.params.loop) {
if (thumbsSwiper.slides.eq(currentThumbsIndex).hasClass(thumbsSwiper.params.slideDuplicateClass)) {
thumbsSwiper.loopFix(); // eslint-disable-next-line
thumbsSwiper._clientLeft = thumbsSwiper.$wrapperEl[0].clientLeft;
currentThumbsIndex = thumbsSwiper.activeIndex;
} // Find actual thumbs index to slide to
var prevThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).prevAll("[data-swiper-slide-index=\"" + swiper.realIndex + "\"]").eq(0).index();
var nextThumbsIndex = thumbsSwiper.slides.eq(currentThumbsIndex).nextAll("[data-swiper-slide-index=\"" + swiper.realIndex + "\"]").eq(0).index();
if (typeof prevThumbsIndex === 'undefined') {
newThumbsIndex = nextThumbsIndex;
} else if (typeof nextThumbsIndex === 'undefined') {
newThumbsIndex = prevThumbsIndex;
} else if (nextThumbsIndex - currentThumbsIndex === currentThumbsIndex - prevThumbsIndex) {
newThumbsIndex = currentThumbsIndex;
} else if (nextThumbsIndex - currentThumbsIndex < currentThumbsIndex - prevThumbsIndex) {
newThumbsIndex = nextThumbsIndex;
} else {
newThumbsIndex = prevThumbsIndex;
}
} else {
newThumbsIndex = swiper.realIndex;
}
if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) {
if (thumbsSwiper.params.centeredSlides) {
if (newThumbsIndex > currentThumbsIndex) {
newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1;
} else {
newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1;
}
} else if (newThumbsIndex > currentThumbsIndex) {
newThumbsIndex = newThumbsIndex - slidesPerView + 1;
}
thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined);
}
} // Activate thumbs
var thumbsToActivate = 1;
var thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass;
if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) {
thumbsToActivate = swiper.params.slidesPerView;
}
thumbsSwiper.slides.removeClass(thumbActiveClass);
if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual) {
for (var i = 0; i < thumbsToActivate; i += 1) {
thumbsSwiper.$wrapperEl.children("[data-swiper-slide-index=\"" + (swiper.realIndex + i) + "\"]").addClass(thumbActiveClass);
}
} else {
for (var i$1 = 0; i$1 < thumbsToActivate; i$1 += 1) {
thumbsSwiper.slides.eq(swiper.realIndex + i$1).addClass(thumbActiveClass);
}
}
}
};
var Thumbs$1 = {
name: 'thumbs',
params: {
thumbs: {
swiper: null,
slideThumbActiveClass: 'swiper-slide-thumb-active',
thumbsContainerClass: 'swiper-container-thumbs'
}
},
create: function create() {
var swiper = this;
Utils.extend(swiper, {
thumbs: {
swiper: null,
init: Thumbs.init.bind(swiper),
update: Thumbs.update.bind(swiper),
onThumbClick: Thumbs.onThumbClick.bind(swiper)
}
});
},
on: {
beforeInit: function beforeInit() {
var swiper = this;
var ref = swiper.params;
var thumbs = ref.thumbs;
if (!thumbs || !thumbs.swiper) {
return;
}
swiper.thumbs.init();
swiper.thumbs.update(true);
},
slideChange: function slideChange() {
var swiper = this;
if (!swiper.thumbs.swiper) {
return;
}
swiper.thumbs.update();
},
update: function update() {
var swiper = this;
if (!swiper.thumbs.swiper) {
return;
}
swiper.thumbs.update();
},
resize: function resize() {
var swiper = this;
if (!swiper.thumbs.swiper) {
return;
}
swiper.thumbs.update();
},
observerUpdate: function observerUpdate() {
var swiper = this;
if (!swiper.thumbs.swiper) {
return;
}
swiper.thumbs.update();
},
setTransition: function setTransition(duration) {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) {
return;
}
thumbsSwiper.setTransition(duration);
},
beforeDestroy: function beforeDestroy() {
var swiper = this;
var thumbsSwiper = swiper.thumbs.swiper;
if (!thumbsSwiper) {
return;
}
if (swiper.thumbs.swiperCreated && thumbsSwiper) {
thumbsSwiper.destroy();
}
}
}
}; // Swiper Class
var components = [Device$1, Support$1, Browser$1, Resize, Observer$1, Virtual$1, Keyboard$1, Mousewheel$1, Navigation$1, Pagination$1, Scrollbar$1, Parallax$1, Zoom$1, Lazy$1, Controller$1, A11y, History$1, HashNavigation$1, Autoplay$1, EffectFade, EffectCube, EffectFlip, EffectCoverflow, Thumbs$1];
if (typeof Swiper.use === 'undefined') {
Swiper.use = Swiper.Class.use;
Swiper.installModule = Swiper.Class.installModule;
}
Swiper.use(components);
return Swiper;
});
/***/ }),
/* 147 */
/*!*********************************************!*\
!*** ./node_modules/object-assign/index.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
} // Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
} // https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
} // https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 148 */
/*!******************************************!*\
!*** ./node_modules/prop-types/index.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (false) {
var ReactIs = require('react-is'); // By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(/*! ./factoryWithThrowingShims */ 149)();
}
/***/ }),
/* 149 */
/*!*************************************************************!*\
!*** ./node_modules/prop-types/factoryWithThrowingShims.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ 150);
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
module.exports = function () {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
err.name = 'Invariant Violation';
throw err;
}
;
shim.isRequired = shim;
function getShim() {
return shim;
}
; // Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 150 */
/*!*************************************************************!*\
!*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 151 */
/*!***************************************************!*\
!*** ./node_modules/react-id-swiper/lib/utils.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cn = void 0;
var cn = function cn(className) {
return typeof className === 'string' ? className.split('.').join(' ').trim() : '';
};
exports.cn = cn;
/***/ }),
/* 152 */
/*!********************************************!*\
!*** ./node_modules/lodash/_nativeKeys.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 85);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/* 153 */
/*!******************************************!*\
!*** ./node_modules/lodash/_DataView.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11),
root = __webpack_require__(/*! ./_root */ 1);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/* 154 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseIsNative.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ 26),
isMasked = __webpack_require__(/*! ./_isMasked */ 157),
isObject = __webpack_require__(/*! ./isObject */ 2),
toSource = __webpack_require__(/*! ./_toSource */ 88);
/**
* 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 for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** 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 if a method is native. */
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ }),
/* 155 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_getRawTag.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = _Symbol ? _Symbol.toStringTag : 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;
}
module.exports = getRawTag;
/***/ }),
/* 156 */
/*!************************************************!*\
!*** ./node_modules/lodash/_objectToString.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* 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);
}
module.exports = objectToString;
/***/ }),
/* 157 */
/*!******************************************!*\
!*** ./node_modules/lodash/_isMasked.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(/*! ./_coreJsData */ 158);
/** Used to detect methods masquerading as native. */
var maskSrcKey = function () {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? 'Symbol(src)_1.' + uid : '';
}();
/**
* Checks if `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;
}
module.exports = isMasked;
/***/ }),
/* 158 */
/*!********************************************!*\
!*** ./node_modules/lodash/_coreJsData.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 1);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/* 159 */
/*!******************************************!*\
!*** ./node_modules/lodash/_getValue.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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];
}
module.exports = getValue;
/***/ }),
/* 160 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_Promise.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11),
root = __webpack_require__(/*! ./_root */ 1);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/* 161 */
/*!*************************************!*\
!*** ./node_modules/lodash/_Set.js ***!
\*************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 11),
root = __webpack_require__(/*! ./_root */ 1);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 162 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseIsArguments.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* 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;
}
module.exports = baseIsArguments;
/***/ }),
/* 163 */
/*!******************************************!*\
!*** ./node_modules/lodash/stubFalse.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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 = stubFalse;
/***/ }),
/* 164 */
/*!**************************************************!*\
!*** ./node_modules/lodash/_baseIsTypedArray.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isLength = __webpack_require__(/*! ./isLength */ 53),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.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)];
}
module.exports = baseIsTypedArray;
/***/ }),
/* 165 */
/*!**************************************************************************!*\
!*** ./includes/modules/TestifyCarouselParent/components/ajax/index.jsx ***!
\**************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(/*! jquery */ 83);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var TestifyCarouselAjaxComponent=/*#__PURE__*/function(_Component){_inherits(TestifyCarouselAjaxComponent,_Component);function TestifyCarouselAjaxComponent(props){var _this;_classCallCheck(this,TestifyCarouselAjaxComponent);_this=_possibleConstructorReturn(this,(TestifyCarouselAjaxComponent.__proto__||Object.getPrototypeOf(TestifyCarouselAjaxComponent)).call(this,props));_this.state={isLoaded:false,result:null,error:null,first:true};return _this;}_createClass(TestifyCarouselAjaxComponent,[{key:"componentDidMount",value:function componentDidMount(){var _this2=this;setTimeout(function(){return _this2.setState({first:false},function(){return _this2._reload(_this2.props,'ajax');});},250);}},{key:"componentWillUnmount",value:function componentWillUnmount(){this._abortRunningAjaxCall();}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var newProps=this.props;var oldProps=prevProps;if(!this.props||!prevProps){return;}if(!!this._shouldReload(oldProps,newProps)){this._reload(newProps,this._shouldReload(oldProps,newProps));}}},{key:"_shouldReload",value:function _shouldReload(oldProps,newProps){throw new Error('You must implement the method _shouldReload(oldProps, newProps)');}},{key:"_reloadData",value:function _reloadData(props){throw new Error('You must implement the method _reloadData(props)');}},{key:"_reload",value:function _reload(props){var _this3=this;var type=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var component=this;switch(type){case"ajax":component.setState({isLoaded:false},function(){//Cancel running Ajax call if any
_this3._abortRunningAjaxCall();//Make new Ajax call
_this3.ajaxCall=__WEBPACK_IMPORTED_MODULE_1_jquery___default.a.ajax({url:window.testify_carousel.ajaxurl,type:'POST',data:_this3._reloadData(props),success:function success(response){if(response.success===false){component.setState({isLoaded:true,error:"Error: Failed to load"});}else{// console.log(response);
component.setState({isLoaded:true,result:response});}},complete:function complete(){component.ajaxCall=null;}});});break;case"rerender":component.setState({isLoaded:false},function(){component.setState({isLoaded:true});});break;case"default":break;}}},{key:"_abortRunningAjaxCall",value:function _abortRunningAjaxCall(){if(this.ajaxCall!==undefined&&this.ajaxCall!==null&&this.ajaxCall.readyState!==4){this.ajaxCall.abort();}}},{key:"_render",value:function _render(){throw new Error('You must implement the method _render()');}},{key:"render",value:function render(){if(this.state.error){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",null,this.state.error.message);}else if(!this.state.isLoaded){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"dss_loading_indicator",style:{height:100+'px',minWidth:100+'px'}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"et-fb-loader-wrapper"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"et-fb-loader"})));}else{return this._render();}}}]);return TestifyCarouselAjaxComponent;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);/* harmony default export */ __webpack_exports__["a"] = (TestifyCarouselAjaxComponent);
/***/ }),
/* 166 */
/*!****************************************************!*\
!*** ./includes/module_dependencies/background.js ***!
\****************************************************/
/*! exports provided: getBackgroundStyle */
/*! exports used: getBackgroundStyle */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getBackgroundStyle; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(/*! lodash */ 57);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_includes__ = __webpack_require__(/*! lodash/includes */ 30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_includes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_includes__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined__ = __webpack_require__(/*! lodash/isUndefined */ 59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isNaN__ = __webpack_require__(/*! lodash/isNaN */ 94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isNaN___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isNaN__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__hover_options__ = __webpack_require__(/*! ./hover-options */ 60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__ = __webpack_require__(/*! ./responsive-options-pure */ 129);
function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*/ // External dependenciess
// Internal dependencies
/**
* Get background UI option's style based on given attrs and attr name.
*
* @since 4.3.3
*
* @since 4.6.0 Add sticky styles support.
*
* @param {*} moduleArgs
*/var getBackgroundStyle=function getBackgroundStyle(moduleArgs){var defaultArgs={basePropName:'background',attrs:{},important:'',fieldsDefinition:{},selector:'',selectorHover:'',priority:'',functionName:'',isChildItem:false,renderSlug:'',address:'',defaults:{},has_background_color_toggle:false,use_background_color:true,use_background_color_gradient:true,use_background_image:true,use_background_video:false,use_background_color_reset:true,propNameAliases:{}};var args=_objectSpread2(_objectSpread2({},defaultArgs),moduleArgs);var attrs=args.attrs,basePropName=args.basePropName,important=args.important,isChildItem=args.isChildItem,selector=args.selector,propNameAliases=args.propNameAliases,defaults=args.defaults;// Populate style
var backgroundStyles=[];var getPropNameAlias=function getPropNameAlias(basePropName){return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(propNameAliases,basePropName,basePropName);};var basePropNameParsed=getPropNameAlias(basePropName);// Populate image using additionalCss format
var updateStylesArray=function updateStylesArray(selector,declaration,device){backgroundStyles.push({selector:selector,declaration:declaration,device:device});};// Get status.
var isHoverMode=false;// something that needs to be updater later
var isHoverEnabled=isHoverMode&&__WEBPACK_IMPORTED_MODULE_4__hover_options__["a" /* default */].isEnabled(basePropNameParsed+'_color',attrs);var isResponsiveEnabled=__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].isResponsiveEnabled(attrs,basePropNameParsed+'_color');/**
* Get main background value based on enabled status of current field. It's used to selectively
* get the correct color, gradient status, image, and video. It's introduced along with new
* enable fields to decide should we remove or inherit the value from larger device.
*
* @since 3.24.1
* @since 4.5.0 Set default for background color, image, gradient, and video to adapt Global Presets.
*
* @param {object} attrs All module attributes.
* @param {string} baseSetting Setting need to be checked.
* @param {string} mode Current preview mode.
* @param {string} backgroundBase Background base name (background, button_bg, etc.).
* @param {string} moduleName Module name.
* @param {string} value Active value.
* @param {string} defaultValue Active default value.
*
* @returns {object} Pair of new value and default value.
*/var getInheritanceBackgroundValue=function getInheritanceBackgroundValue(attrs,baseSetting,mode){var backgroundBase=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'background';var defaults=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'';var moduleName=arguments.length>5&&arguments[5]!==undefined?arguments[5]:'';var value=arguments.length>6&&arguments[6]!==undefined?arguments[6]:'';var defaultValue=arguments.length>7&&arguments[7]!==undefined?arguments[7]:'';// Default new values is same with the generated one.
var newValues={default:defaultValue,value:value};// Empty string slug for desktop.
var mapSlugs={desktop:[''],hover:['__hover',''],sticky:['__sticky',''],tablet:['_tablet',''],phone:['_phone','_tablet','']};// Bail early if setting name is not listed on.
var enabledFields=["".concat(backgroundBase,"_color"),"".concat(backgroundBase,"_use_color_gradient"),"".concat(backgroundBase,"_use_color_gradient"),"".concat(backgroundBase,"_image"),"".concat(backgroundBase,"_video_mp4"),"".concat(backgroundBase,"_video_webm"),"".concat(backgroundBase,"_video_webm"),"__video_".concat(backgroundBase)];if(!__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(enabledFields,baseSetting)||__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default()(mapSlugs[mode])){return newValues;}// Need to set value and defaultValue for the initial new default and value.
var newValue=value;var newDefault=defaultValue;var fields=defaults;Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["forEach"])(mapSlugs[mode],function(slug){// Enabled Background Color and Image.
if(__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(["".concat(backgroundBase,"_color"),"".concat(backgroundBase,"_image"),"".concat(backgroundBase,"_video_mp4"),"".concat(backgroundBase,"_video_webm")],baseSetting)){var bgBaseType=baseSetting.replace("".concat(backgroundBase,"_"),'');var enableDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(fields,"".concat(backgroundBase,"_enable_").concat(bgBaseType).concat(slug,".default"),'');var enableValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,"".concat(backgroundBase,"_enable_").concat(bgBaseType).concat(slug),enableDefault);var bgDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(fields,"".concat(backgroundBase,"_").concat(bgBaseType).concat(slug,".default"),'');var bgValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,"".concat(backgroundBase,"_").concat(bgBaseType).concat(slug),bgDefault);var isBgEnabled=!isOff(enableValue);if(''!==bgValue&&isBgEnabled){newValue=bgValue;newDefault=defaultValue;return false;}if(!isBgEnabled){newValue='';newDefault='';return false;}// Enabled Background Gradient.
}else if(__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(["".concat(backgroundBase,"_use_color_gradient")],baseSetting)){newValue='off';var grdientMap=_defineProperty({},"".concat(backgroundBase,"_use_color_gradient"),{value:"".concat(backgroundBase,"_use_color_gradient").concat(slug),start:"".concat(backgroundBase,"_color_gradient_start").concat(slug),end:"".concat(backgroundBase,"_color_gradient_end").concat(slug)});var selectedField=!__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default()(grdientMap[baseSetting])?grdientMap[baseSetting]:{};// Enable Gradient Field.
var useGradientField=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(fields,selectedField.value,{});var useGradientDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(useGradientField,'default','');var useGradientValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,selectedField.value,useGradientDefault);var isGradientEnabled=!isOff(useGradientValue);// Gradient Start Color Field.
var gradientStartField=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(fields,selectedField.start,{});var gradientStartDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(gradientStartField,'default','');var gradientStartValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,selectedField.start,gradientStartDefault);// Gradient End Color Field.
var gradientEndField=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(fields,selectedField.end,{});var gradientEndDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(gradientEndField,'default','');var gradientEndValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,selectedField.end,gradientEndDefault);if((''!==gradientStartValue||''!==gradientEndValue)&&isGradientEnabled){newValue='on';return false;}if(!isGradientEnabled){newValue='off';return false;}}});return{value:newValue,default:newDefault};};// Get Background Default Value.
var getBackgroundDefaultValue=function getBackgroundDefaultValue(name,device){var defaultValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(defaults,name);// Return default value for hover because hover is rendered on normal mode.
if(isHoverEnabled){return defaultValue;}return __WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getDefaultValue(attrs,__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getFieldName(name,device),defaultValue);};// Get background value.
var getBackgroundValue=function getBackgroundValue(name,device){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var forceReturn=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var forceDesktop=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;// As default, get current device value first.
var fieldName=__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getFieldName(name,device);var isEnabled='desktop'!==device?isResponsiveEnabled:true;var deviceValue=isEnabled?__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getAnyValue(attrs,fieldName,defaultValue,forceReturn):'';if(isHoverEnabled){// Background issue on parent-child item when hover mode is active on parent.
// Since we can't detect if hover is active on parent or child, we should supply current
// device value as default for the child item. In this case, we force to render tablet
// and phone values on hover state if current hover is enabled on the parent.
if(isChildItem){defaultValue=__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getAnyValue(attrs,fieldName,'',true)||defaultValue;}// Force to return desktop value just in case hover value is missing. Background
// image properties rely on desktop value.
if(forceDesktop){deviceValue=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name,defaultValue);}return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,__WEBPACK_IMPORTED_MODULE_4__hover_options__["a" /* default */].getHoverField(name))||deviceValue||defaultValue;}return deviceValue;};var sanitizeInputUnit=function sanitizeInputUnit(value,auto_important,default_unit,property){value=toString(value);auto_important=!!auto_important;var valid_one_char_units=['%'];var valid_two_chars_units=['em','px','cm','mm','in','pt','pc','ex','vh','vw','ms'];var valid_three_chars_units=['deg','rem'];var important='!important';var important_length=important.length;var has_important=false;var value_length=value.length;var unit_value;var result;if(''===value){return'';}// check for !important
if(value.substr(0-important_length,important_length)===important){has_important=true;value_length-=important_length;value=value.substr(0,value_length).trim();}// Allow allowlisted strings to be used
if(!__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default()(property)){unit_value=value;// Re-add !important tag
if(has_important&&!auto_important){unit_value="".concat(unit_value," ").concat(important);}return unit_value;}// Test against allowed one-character units
if(__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(valid_one_char_units,value.substr(-1,1))){unit_value=parseFloat(value)+value.substr(-1,1);// Re-add !important tag
if(has_important&&!auto_important){unit_value="".concat(unit_value," ").concat(important);}return unit_value;}// Test against allowed three-character units
if(__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(valid_three_chars_units,value.substr(-3,3))){unit_value=parseFloat(value)+value.substr(-3,3);// Re-add !important tag
if(has_important&&!auto_important){unit_value="".concat(unit_value," ").concat(important);}return unit_value;}// Test against allowed two-character units
if(__WEBPACK_IMPORTED_MODULE_1_lodash_includes___default()(valid_two_chars_units,value.substr(-2,2))){unit_value=parseFloat(value)+value.substr(-2,2);// Re-add !important tag
if(has_important&&!auto_important){unit_value="".concat(unit_value," ").concat(important);}return unit_value;}if(__WEBPACK_IMPORTED_MODULE_3_lodash_isNaN___default()(parseFloat(value))){return'';}result=parseFloat(value);if(!__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default()(default_unit)){return result+default_unit;}if(__WEBPACK_IMPORTED_MODULE_2_lodash_isUndefined___default()(default_unit)||'no_default_unit'!==default_unit){result+='px';}// Return and automatically append px (default value)
return result;};var getGradient=function getGradient(args){var direction='linear'===args.type?args.direction:"circle at ".concat(args.radialDirection);var startPosition=sanitizeInputUnit(args.startPosition,undefined,'%');var endPosition=sanitizeInputUnit(args.endPosition,undefined,'%');return"".concat(args.type,"-gradient(\n ").concat(direction,",\n ").concat(args.colorStart," ").concat(startPosition,",\n ").concat(args.colorEnd," ").concat(endPosition,"\n )");};var isOn=function isOn(value){return'on'===value;};var isOff=function isOff(value){return'off'===value;};var hasValue=function hasValue(value){return''!==value&&undefined!==value&&value!==false&&!__WEBPACK_IMPORTED_MODULE_3_lodash_isNaN___default()(value);};// Possible values for use_background_* variables are true, false, or 'fields_only'
var hasColorToggle=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(args.attrs,"".concat(basePropName,"_enable"),false);var useColorOptions=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(args.attrs,"".concat(basePropName,"_color"),'');var useGradientOptions=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(args.attrs,"".concat(basePropName,"_use_color_gradient"),'');var useImageOptions=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(args.attrs,"".concat(basePropName,"_enable_image"),'');var useColorResetOptions=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(args.attrs,"".concat(basePropName,"_color_reset"),'');// Save processed desktop values.
var gradientOverlaysImageDesktop='off';var colorDesktop='';var imageSizeDesktop='';var imagePositionDesktop='';var imageRepeatDesktop='';var imageBlendDesktop='';// Store background images status because the process is extensive.
var imageStatus={desktop:false,tablet:false,phone:false};var prevImageBlend='';// Responsive settings for background.
Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["forEach"])(__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].getDevicesList(),function(device){// Ensure responsive settings is enabled on mobile.
var isDesktop='desktop'===device;if(!isDesktop&&!__WEBPACK_IMPORTED_MODULE_5__responsive_options_pure__["a" /* default */].isResponsiveEnabled(attrs,basePropNameParsed)){return;}var responsiveSuffix=!isDesktop?"_".concat(device):'';var previewMode=isHoverEnabled?'hover':device;// C.1. Background Color - Value and activation status.
var useColor=getBackgroundValue("".concat(basePropName,"_color"),device,'',true);var noColor=isOff(useColor);var newColorValues=getInheritanceBackgroundValue(args.attrs,getPropNameAlias("".concat(basePropName,"_color")),previewMode,basePropName,defaults);var emptyColor='hover'===previewMode?'transparent':!isDesktop?'initial':'';var color=''!==newColorValues.value?newColorValues.value:emptyColor;var background_image=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,"".concat(basePropName,"_image").concat(responsiveSuffix),'');var declaration='';var images=[];var hasImage=false;var hasGradient=false;var hasImageAndGradient=false;var disableImage=false;var disableGradient=false;// B.2. Background Gradient - Generate background gradient color.
if(useGradientOptions&&'fields_only'!==useGradientOptions){// Background Gradient - Activation status.
var newUseGradientValues=getInheritanceBackgroundValue(args.attrs,getPropNameAlias("".concat(basePropName,"_use_color_gradient")),previewMode,basePropName,defaults);var useGradient=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(newUseGradientValues,'value');if(isOn(useGradient)){var gradientBackground=getGradient({type:getBackgroundValue("".concat(basePropName,"_color_gradient_type"),device,'',true),direction:getBackgroundValue("".concat(basePropName,"_color_gradient_direction"),device,'',true),radialDirection:getBackgroundValue("".concat(basePropName,"_color_gradient_direction_radial"),device,'',true),colorStart:getBackgroundValue("".concat(basePropName,"_color_gradient_start"),device,'',true),colorEnd:getBackgroundValue("".concat(basePropName,"_color_gradient_end"),device,'',true),startPosition:getBackgroundValue("".concat(basePropName,"_color_gradient_start_position"),device,'',true),endPosition:getBackgroundValue("".concat(basePropName,"_color_gradient_end_position"),device,'',true)});images.push(gradientBackground);// Flag to inform Background Color if current module has Gradient.
hasGradient=true;}else{disableGradient=true;}}// A.2. Background Image - Generate background image and CSS properties.
var imageParallax=getBackgroundValue('parallax',device,'',true);// Background image and parallax status.
var isImageActive=hasValue(background_image)&&!isOn(imageParallax);imageStatus[device]=isImageActive;if(useImageOptions&&'fields_only'!==useImageOptions&&isImageActive){hasImage=true;images.push("url(".concat(background_image,")"));// Check previous background image status. Needed to get the correct value.
var isPrevImageActive=true;if(!isDesktop&&!isHoverEnabled){isPrevImageActive='tablet'===device?imageStatus.desktop:imageStatus.tablet;}var imageSizeFieldDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(defaults,"".concat(basePropName,"_size"));var imageSizeDefault=isPrevImageActive?getBackgroundDefaultValue("".concat(basePropName,"_size"),device):'';var imageSize=getBackgroundValue("".concat(basePropName,"_size"),device,imageSizeFieldDefault,true,true);if(hasValue(imageSize)&&imageSize!==imageSizeDefault){updateStylesArray(selector,"background-size: ".concat(imageSize),device);}var imagePositionFieldDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(defaults,"".concat(basePropName,"_position"));var imagePositionDefault=isPrevImageActive?getBackgroundDefaultValue("".concat(basePropName,"_position"),device):'';var imagePosition=getBackgroundValue("".concat(basePropName,"_position"),device,imagePositionFieldDefault,true,true);if(hasValue(imagePosition)&&imagePosition!==imagePositionDefault){updateStylesArray(selector,"background-position: ".concat(imagePosition.replace('_',' ')),device);}var imageRepeatFieldDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(defaults,"".concat(basePropName,"_repeat"));var imageRepeatDefault=isPrevImageActive?getBackgroundDefaultValue("".concat(basePropName,"_repeat"),device):'';var imageRepeat=getBackgroundValue("".concat(basePropName,"_repeat"),device,imageRepeatFieldDefault,true,true);if(hasValue(imageRepeat)&&imageRepeat!==imageRepeatDefault){updateStylesArray(selector,"background-repeat: ".concat(imageRepeat),device);}var imageBlendFieldDefault=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(defaults,"".concat(basePropName,"_blend"));var imageBlend=getBackgroundValue("".concat(basePropName,"_blend"),device,imageBlendFieldDefault,!isPrevImageActive,true);var imageBlendInherit=getBackgroundValue("".concat(basePropName,"_blend"),device,'',true,true);if(hasValue(imageBlendInherit)){// Don't print the same image blend style.
if(hasValue(imageBlend)){updateStylesArray(selector,"background-blend-mode: ".concat(imageBlend),device);}// Reset - If background has image and gradient, force background-color: initial.
if(hasGradient&&hasImage&&'fields_only'!==useColorResetOptions&&imageBlendInherit!==imageBlendFieldDefault){hasImageAndGradient=true;updateStylesArray(selector,"background-color: initial".concat(important,";"),device);}prevImageBlend=imageBlendInherit;}}else if(!hasValue(background_image)){// Reset - If background image is disabled, ensure we reset prev background blend mode.
if(hasValue(prevImageBlend)){updateStylesArray(selector,'background-blend-mode: normal',device);prevImageBlend='';}disableImage=true;}// D.1. Print Styles - Background Gradient and Image.
if(images.length>0){var gradientOverlayImage=getBackgroundValue("".concat(basePropName,"_color_gradient_overlays_image"),device,'off',true);if(!isOn(gradientOverlayImage)){images.reverse();}images=images.join(', ');updateStylesArray(selector,"background-image: ".concat(images).concat(important,";"),device);}else if(disableGradient&&disableImage){// Reset - If background image and gradient are disabled, reset current background image.
updateStylesArray(selector,"background-image: initial".concat(important,";"),device);}// D.2. Print Styles - Background Color.
var isUseBackgroundColor=useColorOptions&&'fields_only'!==useColorOptions;var isPrintBackgroundColor=hasValue(color)&&!noColor&&!hasImageAndGradient;var isDisableBackgroundColor=hasColorToggle&&noColor&&!isDesktop;if(isUseBackgroundColor){if(isPrintBackgroundColor){// Print background color normally.
declaration="background-color:".concat(color).concat(important,";");updateStylesArray(selector,declaration,device);}else if(isDisableBackgroundColor){// Reset - If current module has background color toggle, it's off, and current
// mode it's not desktop, we should reset the background color.
declaration="background-color: initial".concat(important,";");updateStylesArray(selector,declaration,device);}}});// Return generated styles
return backgroundStyles;};
/***/ }),
/* 167 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseIsNaN.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
module.exports = baseIsNaN;
/***/ }),
/* 168 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_strictIndexOf.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = strictIndexOf;
/***/ }),
/* 169 */
/*!*****************************************!*\
!*** ./node_modules/lodash/toNumber.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 2),
isSymbol = __webpack_require__(/*! ./isSymbol */ 20);
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? other + '' : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
module.exports = toNumber;
/***/ }),
/* 170 */
/*!***************************************!*\
!*** ./node_modules/lodash/values.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseValues = __webpack_require__(/*! ./_baseValues */ 171),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
module.exports = values;
/***/ }),
/* 171 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseValues.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 21);
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function (key) {
return object[key];
});
}
module.exports = baseValues;
/***/ }),
/* 172 */
/*!*****************************************!*\
!*** ./node_modules/lodash/isNumber.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var numberTag = '[object Number]';
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' || isObjectLike(value) && baseGetTag(value) == numberTag;
}
module.exports = isNumber;
/***/ }),
/* 173 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_memoizeCapped.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(/*! ./memoize */ 96);
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function (key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ }),
/* 174 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_mapCacheClear.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(/*! ./_Hash */ 175),
ListCache = __webpack_require__(/*! ./_ListCache */ 34),
Map = __webpack_require__(/*! ./_Map */ 52);
/**
* 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()
};
}
module.exports = mapCacheClear;
/***/ }),
/* 175 */
/*!**************************************!*\
!*** ./node_modules/lodash/_Hash.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(/*! ./_hashClear */ 176),
hashDelete = __webpack_require__(/*! ./_hashDelete */ 177),
hashGet = __webpack_require__(/*! ./_hashGet */ 178),
hashHas = __webpack_require__(/*! ./_hashHas */ 179),
hashSet = __webpack_require__(/*! ./_hashSet */ 180);
/**
* 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]);
}
} // Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/* 176 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_hashClear.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 33);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/* 177 */
/*!********************************************!*\
!*** ./node_modules/lodash/_hashDelete.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = hashDelete;
/***/ }),
/* 178 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashGet.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 33);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = hashGet;
/***/ }),
/* 179 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashHas.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 33);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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);
}
module.exports = hashHas;
/***/ }),
/* 180 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashSet.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 33);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* 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;
}
module.exports = hashSet;
/***/ }),
/* 181 */
/*!************************************************!*\
!*** ./node_modules/lodash/_listCacheClear.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/* 182 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_listCacheDelete.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 35);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* 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;
}
module.exports = listCacheDelete;
/***/ }),
/* 183 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheGet.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 35);
/**
* 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];
}
module.exports = listCacheGet;
/***/ }),
/* 184 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheHas.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 35);
/**
* 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;
}
module.exports = listCacheHas;
/***/ }),
/* 185 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheSet.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 35);
/**
* 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;
}
module.exports = listCacheSet;
/***/ }),
/* 186 */
/*!************************************************!*\
!*** ./node_modules/lodash/_mapCacheDelete.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 37);
/**
* 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;
}
module.exports = mapCacheDelete;
/***/ }),
/* 187 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_isKeyable.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* 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;
}
module.exports = isKeyable;
/***/ }),
/* 188 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheGet.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 37);
/**
* 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);
}
module.exports = mapCacheGet;
/***/ }),
/* 189 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheHas.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 37);
/**
* 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);
}
module.exports = mapCacheHas;
/***/ }),
/* 190 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheSet.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 37);
/**
* 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;
}
module.exports = mapCacheSet;
/***/ }),
/* 191 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseFor.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ 192);
/**
* 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();
module.exports = baseFor;
/***/ }),
/* 192 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_createBaseFor.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
};
}
module.exports = createBaseFor;
/***/ }),
/* 193 */
/*!************************************************!*\
!*** ./node_modules/lodash/_createBaseEach.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5);
/**
* 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;
};
}
module.exports = createBaseEach;
/***/ }),
/* 194 */
/*!****************************************!*\
!*** ./node_modules/lodash/fp/prop.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./get */ 195);
/***/ }),
/* 195 */
/*!***************************************!*\
!*** ./node_modules/lodash/fp/get.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 40),
func = convert('get', __webpack_require__(/*! ../get */ 8));
func.placeholder = __webpack_require__(/*! ./placeholder */ 24);
module.exports = func;
/***/ }),
/* 196 */
/*!************************************************!*\
!*** ./node_modules/lodash/fp/_baseConvert.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var mapping = __webpack_require__(/*! ./_mapping */ 197),
fallbackHolder = __webpack_require__(/*! ./placeholder */ 24);
/** Built-in value reference. */
var push = Array.prototype.push;
/**
* Creates a function, with an arity of `n`, that invokes `func` with the
* arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} n The arity of the new function.
* @returns {Function} Returns the new function.
*/
function baseArity(func, n) {
return n == 2 ? function (a, b) {
return func.apply(undefined, arguments);
} : function (a) {
return func.apply(undefined, arguments);
};
}
/**
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
* any additional arguments.
*
* @private
* @param {Function} func The function to cap arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function baseAry(func, n) {
return n == 2 ? function (a, b) {
return func(a, b);
} : function (a) {
return func(a);
};
}
/**
* Creates a clone of `array`.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the cloned array.
*/
function cloneArray(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
}
/**
* Creates a function that clones a given object using the assignment `func`.
*
* @private
* @param {Function} func The assignment function.
* @returns {Function} Returns the new cloner function.
*/
function createCloner(func) {
return function (object) {
return func({}, object);
};
}
/**
* A specialized version of `_.spread` which flattens the spread array into
* the arguments of the invoked `func`.
*
* @private
* @param {Function} func The function to spread arguments over.
* @param {number} start The start position of the spread.
* @returns {Function} Returns the new function.
*/
function flatSpread(func, start) {
return function () {
var length = arguments.length,
lastIndex = length - 1,
args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var array = args[start],
otherArgs = args.slice(0, start);
if (array) {
push.apply(otherArgs, array);
}
if (start != lastIndex) {
push.apply(otherArgs, args.slice(start + 1));
}
return func.apply(this, otherArgs);
};
}
/**
* Creates a function that wraps `func` and uses `cloner` to clone the first
* argument it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function.
*/
function wrapImmutable(func, cloner) {
return function () {
var length = arguments.length;
if (!length) {
return;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner.apply(undefined, args);
func.apply(undefined, args);
return result;
};
}
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func, options) {
var setPlaceholder,
isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError();
}
options || (options = {});
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var forceCurry = 'curry' in options && options.curry,
forceFixed = 'fixed' in options && options.fixed,
forceRearg = 'rearg' in options && options.rearg,
placeholder = isLib ? func : fallbackHolder,
pristine = isLib ? func.runInContext() : undefined;
var helpers = isLib ? func : {
'ary': util.ary,
'assign': util.assign,
'clone': util.clone,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isError': util.isError,
'isFunction': util.isFunction,
'isWeakMap': util.isWeakMap,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'toInteger': util.toInteger,
'toPath': util.toPath
};
var ary = helpers.ary,
assign = helpers.assign,
clone = helpers.clone,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isError = helpers.isError,
isFunction = helpers.isFunction,
isWeakMap = helpers.isWeakMap,
keys = helpers.keys,
rearg = helpers.rearg,
toInteger = helpers.toInteger,
toPath = helpers.toPath;
var aryMethodKeys = keys(mapping.aryMethod);
var wrappers = {
'castArray': function castArray(_castArray) {
return function () {
var value = arguments[0];
return isArray(value) ? _castArray(cloneArray(value)) : _castArray.apply(undefined, arguments);
};
},
'iteratee': function iteratee(_iteratee) {
return function () {
var func = arguments[0],
arity = arguments[1],
result = _iteratee(func, arity),
length = result.length;
if (config.cap && typeof arity == 'number') {
arity = arity > 2 ? arity - 2 : 1;
return length && length <= arity ? result : baseAry(result, arity);
}
return result;
};
},
'mixin': function mixin(_mixin) {
return function (source) {
var func = this;
if (!isFunction(func)) {
return _mixin(func, Object(source));
}
var pairs = [];
each(keys(source), function (key) {
if (isFunction(source[key])) {
pairs.push([key, func.prototype[key]]);
}
});
_mixin(func, Object(source));
each(pairs, function (pair) {
var value = pair[1];
if (isFunction(value)) {
func.prototype[pair[0]] = value;
} else {
delete func.prototype[pair[0]];
}
});
return func;
};
},
'nthArg': function nthArg(_nthArg) {
return function (n) {
var arity = n < 0 ? 1 : toInteger(n) + 1;
return curry(_nthArg(n), arity);
};
},
'rearg': function rearg(_rearg) {
return function (func, indexes) {
var arity = indexes ? indexes.length : 0;
return curry(_rearg(func, indexes), arity);
};
},
'runInContext': function runInContext(_runInContext) {
return function (context) {
return baseConvert(util, _runInContext(context), options);
};
}
};
/*--------------------------------------------------------------------------*/
/**
* Casts `func` to a function with an arity capped iteratee if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @returns {Function} Returns the cast function.
*/
function castCap(name, func) {
if (config.cap) {
var indexes = mapping.iterateeRearg[name];
if (indexes) {
return iterateeRearg(func, indexes);
}
var n = !isLib && mapping.iterateeAry[name];
if (n) {
return iterateeAry(func, n);
}
}
return func;
}
/**
* Casts `func` to a curried function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castCurry(name, func, n) {
return forceCurry || config.curry && n > 1 ? curry(func, n) : func;
}
/**
* Casts `func` to a fixed arity function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity cap.
* @returns {Function} Returns the cast function.
*/
function castFixed(name, func, n) {
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
var data = mapping.methodSpread[name],
start = data && data.start;
return start === undefined ? ary(func, n) : flatSpread(func, start);
}
return func;
}
/**
* Casts `func` to an rearged function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castRearg(name, func, n) {
return config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]) ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) : func;
}
/**
* Creates a clone of `object` by `path`.
*
* @private
* @param {Object} object The object to clone.
* @param {Array|string} path The path to clone by.
* @returns {Object} Returns the cloned object.
*/
function cloneByPath(object, path) {
path = toPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
result = clone(Object(object)),
nested = result;
while (nested != null && ++index < length) {
var key = path[index],
value = nested[key];
if (value != null && !(isFunction(value) || isError(value) || isWeakMap(value))) {
nested[key] = clone(index == lastIndex ? value : Object(value));
}
nested = nested[key];
}
return result;
}
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied.
*
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function convertLib(options) {
return _.runInContext.convert(options)(undefined);
}
/**
* Create a converter function for `func` of `name`.
*
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @returns {Function} Returns the new converter function.
*/
function createConverter(name, func) {
var realName = mapping.aliasToReal[name] || name,
methodName = mapping.remap[realName] || realName,
oldOptions = options;
return function (options) {
var newUtil = isLib ? pristine : helpers,
newFunc = isLib ? pristine[methodName] : func,
newOptions = assign(assign({}, oldOptions), options);
return baseConvert(newUtil, realName, newFunc, newOptions);
};
}
/**
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
* arguments, ignoring any additional arguments.
*
* @private
* @param {Function} func The function to cap iteratee arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function iterateeAry(func, n) {
return overArg(func, function (func) {
return typeof func == 'function' ? baseAry(func, n) : func;
});
}
/**
* Creates a function that wraps `func` to invoke its iteratee with arguments
* arranged according to the specified `indexes` where the argument value at
* the first index is provided as the first argument, the argument value at
* the second index is provided as the second argument, and so on.
*
* @private
* @param {Function} func The function to rearrange iteratee arguments for.
* @param {number[]} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
*/
function iterateeRearg(func, indexes) {
return overArg(func, function (func) {
var n = indexes.length;
return baseArity(rearg(baseAry(func, n), indexes), n);
});
}
/**
* Creates a function that invokes `func` with its first 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 () {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : length - 1;
args[index] = transform(args[index]);
return func.apply(undefined, args);
};
}
/**
* Creates a function that wraps `func` and applys the conversions
* rules by `name`.
*
* @private
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @returns {Function} Returns the converted function.
*/
function wrap(name, func) {
var result,
realName = mapping.aliasToReal[name] || name,
wrapped = func,
wrapper = wrappers[realName];
if (wrapper) {
wrapped = wrapper(func);
} else if (config.immutable) {
if (mapping.mutate.array[realName]) {
wrapped = wrapImmutable(func, cloneArray);
} else if (mapping.mutate.object[realName]) {
wrapped = wrapImmutable(func, createCloner(func));
} else if (mapping.mutate.set[realName]) {
wrapped = wrapImmutable(func, cloneByPath);
}
}
each(aryMethodKeys, function (aryKey) {
each(mapping.aryMethod[aryKey], function (otherName) {
if (realName == otherName) {
var data = mapping.methodSpread[realName],
afterRearg = data && data.afterRearg;
result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
result = castCap(realName, result);
result = castCurry(realName, result, aryKey);
return false;
}
});
return !result;
});
result || (result = wrapped);
if (result == func) {
result = forceCurry ? curry(result, 1) : function () {
return func.apply(this, arguments);
};
}
result.convert = createConverter(realName, func);
if (mapping.placeholder[realName]) {
setPlaceholder = true;
result.placeholder = func.placeholder = placeholder;
}
return result;
}
/*--------------------------------------------------------------------------*/
if (!isObj) {
return wrap(name, func);
}
var _ = func; // Convert methods by ary cap.
var pairs = [];
each(aryMethodKeys, function (aryKey) {
each(mapping.aryMethod[aryKey], function (key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}
});
}); // Convert remaining methods.
each(keys(_), function (key) {
var func = _[key];
if (typeof func == 'function') {
var length = pairs.length;
while (length--) {
if (pairs[length][0] == key) {
return;
}
}
func.convert = createConverter(key, func);
pairs.push([key, func]);
}
}); // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function (pair) {
_[pair[0]] = pair[1];
});
_.convert = convertLib;
if (setPlaceholder) {
_.placeholder = placeholder;
} // Assign aliases.
each(keys(_), function (key) {
each(mapping.realToAlias[key] || [], function (alias) {
_[alias] = _[key];
});
});
return _;
}
module.exports = baseConvert;
/***/ }),
/* 197 */
/*!********************************************!*\
!*** ./node_modules/lodash/fp/_mapping.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every',
'allPass': 'overEvery',
'always': 'constant',
'any': 'some',
'anyPass': 'overSome',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'complement': 'negate',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual',
'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial',
'invertObj': 'invert',
'juxt': 'over',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'paths': 'at',
'pickAll': 'pick',
'pipe': 'flow',
'pluck': 'map',
'prop': 'get',
'propEq': 'matchesProperty',
'propOr': 'getOr',
'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': ['assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words', 'zipAll'],
'2': ['add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'],
'3': ['assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'],
'4': ['fill', 'setWith', 'updateWith']
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findFrom': 1,
'findIndex': 1,
'findIndexFrom': 1,
'findKey': 1,
'findLast': 1,
'findLastFrom': 1,
'findLastIndex': 1,
'findLastIndexFrom': 1,
'findLastKey': 1,
'flatMap': 1,
'flatMapDeep': 1,
'flatMapDepth': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1],
'reduceRight': [1, 0]
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInAllWith': [1, 0],
'assignInWith': [1, 2, 0],
'assignAllWith': [1, 0],
'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0],
'getOr': [2, 1, 0],
'intersectionBy': [1, 2, 0],
'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 0],
'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0],
'padCharsStart': [2, 1, 0],
'pullAllBy': [2, 1, 0],
'pullAllWith': [2, 1, 0],
'rangeStep': [1, 2, 0],
'rangeStepRight': [1, 2, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'unionBy': [1, 2, 0],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': {
'start': 0
},
'assignAllWith': {
'start': 0
},
'assignInAll': {
'start': 0
},
'assignInAllWith': {
'start': 0
},
'defaultsAll': {
'start': 0
},
'defaultsDeepAll': {
'start': 0
},
'invokeArgs': {
'start': 2
},
'invokeArgsMap': {
'start': 2
},
'mergeAll': {
'start': 0
},
'mergeAllWith': {
'start': 0
},
'partial': {
'start': 1
},
'partialRight': {
'start': 1
},
'without': {
'start': 1
},
'zipAll': {
'start': 0
}
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true,
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}();
/** Used to map method names to other names. */
exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry',
'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find',
'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast',
'findLastIndexFrom': 'findLastIndex',
'getOr': 'get',
'includesFrom': 'includes',
'indexOfFrom': 'indexOf',
'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad',
'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart',
'propertyOf': 'get',
'rangeStep': 'range',
'rangeStepRight': 'rangeRight',
'restFrom': 'rest',
'spreadFrom': 'spread',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart',
'zipAll': 'zip'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};
/***/ }),
/* 198 */
/*!*****************************************!*\
!*** ./node_modules/lodash/fp/_util.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
module.exports = {
'ary': __webpack_require__(/*! ../ary */ 199),
'assign': __webpack_require__(/*! ../_baseAssign */ 111),
'clone': __webpack_require__(/*! ../clone */ 112),
'curry': __webpack_require__(/*! ../curry */ 238),
'forEach': __webpack_require__(/*! ../_arrayEach */ 39),
'isArray': __webpack_require__(/*! ../isArray */ 0),
'isError': __webpack_require__(/*! ../isError */ 239),
'isFunction': __webpack_require__(/*! ../isFunction */ 26),
'isWeakMap': __webpack_require__(/*! ../isWeakMap */ 240),
'iteratee': __webpack_require__(/*! ../iteratee */ 241),
'keys': __webpack_require__(/*! ../_baseKeys */ 51),
'rearg': __webpack_require__(/*! ../rearg */ 260),
'toInteger': __webpack_require__(/*! ../toInteger */ 7),
'toPath': __webpack_require__(/*! ../toPath */ 264)
};
/***/ }),
/* 199 */
/*!************************************!*\
!*** ./node_modules/lodash/ary.js ***!
\************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 41);
/** Used to compose bitmasks for function metadata. */
var WRAP_ARY_FLAG = 128;
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = func && n == null ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
module.exports = ary;
/***/ }),
/* 200 */
/*!********************************************!*\
!*** ./node_modules/lodash/_createBind.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createCtor = __webpack_require__(/*! ./_createCtor */ 42),
root = __webpack_require__(/*! ./_root */ 1);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
module.exports = createBind;
/***/ }),
/* 201 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_createCurry.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 66),
createCtor = __webpack_require__(/*! ./_createCtor */ 42),
createHybrid = __webpack_require__(/*! ./_createHybrid */ 100),
createRecurry = __webpack_require__(/*! ./_createRecurry */ 103),
getHolder = __webpack_require__(/*! ./_getHolder */ 72),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 45),
root = __webpack_require__(/*! ./_root */ 1);
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length);
}
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
module.exports = createCurry;
/***/ }),
/* 202 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_countHolders.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
module.exports = countHolders;
/***/ }),
/* 203 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_realNames.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to lookup unminified function names. */
var realNames = {};
module.exports = realNames;
/***/ }),
/* 204 */
/*!**********************************************!*\
!*** ./node_modules/lodash/wrapperLodash.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 67),
LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 70),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 68),
isArray = __webpack_require__(/*! ./isArray */ 0),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3),
wrapperClone = __webpack_require__(/*! ./_wrapperClone */ 205);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
} // Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
module.exports = lodash;
/***/ }),
/* 205 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_wrapperClone.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 67),
LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 70),
copyArray = __webpack_require__(/*! ./_copyArray */ 44);
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
module.exports = wrapperClone;
/***/ }),
/* 206 */
/*!************************************************!*\
!*** ./node_modules/lodash/_getWrapDetails.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to match wrap detail comments. */
var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
module.exports = getWrapDetails;
/***/ }),
/* 207 */
/*!***************************************************!*\
!*** ./node_modules/lodash/_insertWrapDetails.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
module.exports = insertWrapDetails;
/***/ }),
/* 208 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseSetToString.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(/*! ./constant */ 209),
defineProperty = __webpack_require__(/*! ./_defineProperty */ 110),
identity = __webpack_require__(/*! ./identity */ 23);
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function (func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
/***/ }),
/* 209 */
/*!*****************************************!*\
!*** ./node_modules/lodash/constant.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function () {
return value;
};
}
module.exports = constant;
/***/ }),
/* 210 */
/*!***************************************************!*\
!*** ./node_modules/lodash/_updateWrapDetails.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ 39),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ 211);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG]];
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function (pair) {
var value = '_.' + pair[0];
if (bitmask & pair[1] && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
module.exports = updateWrapDetails;
/***/ }),
/* 211 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_arrayIncludes.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ 58);
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
/***/ }),
/* 212 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_reorder.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var copyArray = __webpack_require__(/*! ./_copyArray */ 44),
isIndex = __webpack_require__(/*! ./_isIndex */ 22);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
module.exports = reorder;
/***/ }),
/* 213 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_createPartial.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 66),
createCtor = __webpack_require__(/*! ./_createCtor */ 42),
root = __webpack_require__(/*! ./_root */ 1);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = this && this !== root && this instanceof wrapper ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
module.exports = createPartial;
/***/ }),
/* 214 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_mergeData.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var composeArgs = __webpack_require__(/*! ./_composeArgs */ 101),
composeArgsRight = __webpack_require__(/*! ./_composeArgsRight */ 102),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 45);
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; // Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
} // Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2]; // Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
} // Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
} // Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
} // Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
} // Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
} // Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
} // Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
module.exports = mergeData;
/***/ }),
/* 215 */
/*!********************************************!*\
!*** ./node_modules/lodash/_stackClear.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 34);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache();
this.size = 0;
}
module.exports = stackClear;
/***/ }),
/* 216 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_stackDelete.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = stackDelete;
/***/ }),
/* 217 */
/*!******************************************!*\
!*** ./node_modules/lodash/_stackGet.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = stackGet;
/***/ }),
/* 218 */
/*!******************************************!*\
!*** ./node_modules/lodash/_stackHas.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = stackHas;
/***/ }),
/* 219 */
/*!******************************************!*\
!*** ./node_modules/lodash/_stackSet.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 34),
Map = __webpack_require__(/*! ./_Map */ 52),
MapCache = __webpack_require__(/*! ./_MapCache */ 62);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* 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;
}
module.exports = stackSet;
/***/ }),
/* 220 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseAssignIn.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 13),
keysIn = __webpack_require__(/*! ./keysIn */ 75);
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
/***/ }),
/* 221 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseKeysIn.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 2),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 19),
nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ 222);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
/***/ }),
/* 222 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_nativeKeysIn.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
/***/ }),
/* 223 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneBuffer.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var root = __webpack_require__(/*! ./_root */ 1);
/** Detect free variable `exports`. */
var freeExports = ( false ? "undefined" : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && ( false ? "undefined" : _typeof(module)) == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* 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 length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/module.js */ 29)(module)))
/***/ }),
/* 224 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_copySymbols.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 13),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 76);
/**
* Copies own symbols 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);
}
module.exports = copySymbols;
/***/ }),
/* 225 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_arrayFilter.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arrayFilter;
/***/ }),
/* 226 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_copySymbolsIn.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 13),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ 114);
/**
* Copies own and inherited symbols 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 copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
/***/ }),
/* 227 */
/*!************************************************!*\
!*** ./node_modules/lodash/_initCloneArray.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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 = new 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;
}
module.exports = initCloneArray;
/***/ }),
/* 228 */
/*!************************************************!*\
!*** ./node_modules/lodash/_initCloneByTag.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 79),
cloneDataView = __webpack_require__(/*! ./_cloneDataView */ 229),
cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ 230),
cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ 231),
cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ 232);
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, 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 new Ctor();
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return new Ctor();
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
/***/ }),
/* 229 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_cloneDataView.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 79);
/**
* 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);
}
module.exports = cloneDataView;
/***/ }),
/* 230 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneRegExp.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* 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;
}
module.exports = cloneRegExp;
/***/ }),
/* 231 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneSymbol.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15);
/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* 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)) : {};
}
module.exports = cloneSymbol;
/***/ }),
/* 232 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_cloneTypedArray.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 79);
/**
* 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);
}
module.exports = cloneTypedArray;
/***/ }),
/* 233 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_initCloneObject.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 43),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 78),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 19);
/**
* 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)) : {};
}
module.exports = initCloneObject;
/***/ }),
/* 234 */
/*!**************************************!*\
!*** ./node_modules/lodash/isMap.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ 235),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 55),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ 56);
/* Node.js helper references. */
var nodeIsMap = nodeUtil && nodeUtil.isMap;
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
module.exports = isMap;
/***/ }),
/* 235 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseIsMap.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ 14),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
module.exports = baseIsMap;
/***/ }),
/* 236 */
/*!**************************************!*\
!*** ./node_modules/lodash/isSet.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ 237),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 55),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ 56);
/* Node.js helper references. */
var nodeIsSet = nodeUtil && nodeUtil.isSet;
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
module.exports = isSet;
/***/ }),
/* 237 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseIsSet.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ 14),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
module.exports = baseIsSet;
/***/ }),
/* 238 */
/*!**************************************!*\
!*** ./node_modules/lodash/curry.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 41);
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8;
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
} // Assign default placeholders.
curry.placeholder = {};
module.exports = curry;
/***/ }),
/* 239 */
/*!****************************************!*\
!*** ./node_modules/lodash/isError.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 4),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3),
isPlainObject = __webpack_require__(/*! ./isPlainObject */ 119);
/** `Object#toString` result references. */
var domExcTag = '[object DOMException]',
errorTag = '[object Error]';
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag || typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value);
}
module.exports = isError;
/***/ }),
/* 240 */
/*!******************************************!*\
!*** ./node_modules/lodash/isWeakMap.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ 14),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 3);
/** `Object#toString` result references. */
var weakMapTag = '[object WeakMap]';
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
module.exports = isWeakMap;
/***/ }),
/* 241 */
/*!*****************************************!*\
!*** ./node_modules/lodash/iteratee.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ 47),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
module.exports = iteratee;
/***/ }),
/* 242 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseMatches.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ 243),
getMatchData = __webpack_require__(/*! ./_getMatchData */ 254),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ 122);
/**
* 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);
};
}
module.exports = baseMatches;
/***/ }),
/* 243 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseIsMatch.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 74),
baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 80);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ }),
/* 244 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseIsEqualDeep.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 74),
equalArrays = __webpack_require__(/*! ./_equalArrays */ 120),
equalByTag = __webpack_require__(/*! ./_equalByTag */ 250),
equalObjects = __webpack_require__(/*! ./_equalObjects */ 253),
getTag = __webpack_require__(/*! ./_getTag */ 14),
isArray = __webpack_require__(/*! ./isArray */ 0),
isBuffer = __webpack_require__(/*! ./isBuffer */ 28),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 54);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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);
}
module.exports = baseIsEqualDeep;
/***/ }),
/* 245 */
/*!******************************************!*\
!*** ./node_modules/lodash/_SetCache.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ 62),
setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ 246),
setCacheHas = __webpack_require__(/*! ./_setCacheHas */ 247);
/**
*
* 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]);
}
} // Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/* 246 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_setCacheAdd.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* 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;
}
module.exports = setCacheAdd;
/***/ }),
/* 247 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_setCacheHas.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = setCacheHas;
/***/ }),
/* 248 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_arraySome.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = arraySome;
/***/ }),
/* 249 */
/*!******************************************!*\
!*** ./node_modules/lodash/_cacheHas.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = cacheHas;
/***/ }),
/* 250 */
/*!********************************************!*\
!*** ./node_modules/lodash/_equalByTag.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15),
Uint8Array = __webpack_require__(/*! ./_Uint8Array */ 118),
eq = __webpack_require__(/*! ./eq */ 36),
equalArrays = __webpack_require__(/*! ./_equalArrays */ 120),
mapToArray = __webpack_require__(/*! ./_mapToArray */ 251),
setToArray = __webpack_require__(/*! ./_setToArray */ 252);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == other + '';
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
} // Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ }),
/* 251 */
/*!********************************************!*\
!*** ./node_modules/lodash/_mapToArray.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = mapToArray;
/***/ }),
/* 252 */
/*!********************************************!*\
!*** ./node_modules/lodash/_setToArray.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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;
}
module.exports = setToArray;
/***/ }),
/* 253 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_equalObjects.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ 115);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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;
}
module.exports = equalObjects;
/***/ }),
/* 254 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_getMatchData.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ 121),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* 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;
}
module.exports = getMatchData;
/***/ }),
/* 255 */
/*!*****************************************************!*\
!*** ./node_modules/lodash/_baseMatchesProperty.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 80),
get = __webpack_require__(/*! ./get */ 8),
hasIn = __webpack_require__(/*! ./hasIn */ 123),
isKey = __webpack_require__(/*! ./_isKey */ 61),
isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ 121),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ 122),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* 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, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ }),
/* 256 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseHasIn.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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);
}
module.exports = baseHasIn;
/***/ }),
/* 257 */
/*!*****************************************!*\
!*** ./node_modules/lodash/property.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(/*! ./_baseProperty */ 258),
basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ 259),
isKey = __webpack_require__(/*! ./_isKey */ 61),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/**
* 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 = property;
/***/ }),
/* 258 */
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseProperty.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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];
};
}
module.exports = baseProperty;
/***/ }),
/* 259 */
/*!**************************************************!*\
!*** ./node_modules/lodash/_basePropertyDeep.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 32);
/**
* 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);
};
}
module.exports = basePropertyDeep;
/***/ }),
/* 260 */
/*!**************************************!*\
!*** ./node_modules/lodash/rearg.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 41),
flatRest = __webpack_require__(/*! ./_flatRest */ 48);
/** Used to compose bitmasks for function metadata. */
var WRAP_REARG_FLAG = 256;
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function (func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
module.exports = rearg;
/***/ }),
/* 261 */
/*!****************************************!*\
!*** ./node_modules/lodash/flatten.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ 262);
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
/***/ }),
/* 262 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseFlatten.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 77),
isFlattenable = __webpack_require__(/*! ./_isFlattenable */ 263);
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ }),
/* 263 */
/*!***********************************************!*\
!*** ./node_modules/lodash/_isFlattenable.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var _Symbol = __webpack_require__(/*! ./_Symbol */ 15),
isArguments = __webpack_require__(/*! ./isArguments */ 27),
isArray = __webpack_require__(/*! ./isArray */ 0);
/** Built-in value references. */
var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
/***/ }),
/* 264 */
/*!***************************************!*\
!*** ./node_modules/lodash/toPath.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 21),
copyArray = __webpack_require__(/*! ./_copyArray */ 44),
isArray = __webpack_require__(/*! ./isArray */ 0),
isSymbol = __webpack_require__(/*! ./isSymbol */ 20),
stringToPath = __webpack_require__(/*! ./_stringToPath */ 95),
toKey = __webpack_require__(/*! ./_toKey */ 12),
toString = __webpack_require__(/*! ./toString */ 17);
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
module.exports = toPath;
/***/ }),
/* 265 */
/*!*****************************************!*\
!*** ./node_modules/lodash/fp/times.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 40),
func = convert('times', __webpack_require__(/*! ../times */ 266));
func.placeholder = __webpack_require__(/*! ./placeholder */ 24);
module.exports = func;
/***/ }),
/* 266 */
/*!**************************************!*\
!*** ./node_modules/lodash/times.js ***!
\**************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ 93),
castFunction = __webpack_require__(/*! ./_castFunction */ 65),
toInteger = __webpack_require__(/*! ./toInteger */ 7);
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = castFunction(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
module.exports = times;
/***/ }),
/* 267 */
/*!******************************************!*\
!*** ./node_modules/lodash/fp/equals.js ***!
\******************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./isEqual */ 268);
/***/ }),
/* 268 */
/*!*******************************************!*\
!*** ./node_modules/lodash/fp/isEqual.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 40),
func = convert('isEqual', __webpack_require__(/*! ../isEqual */ 126));
func.placeholder = __webpack_require__(/*! ./placeholder */ 24);
module.exports = func;
/***/ }),
/* 269 */
/*!*********************************************!*\
!*** ./node_modules/lodash/fp/flowRight.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 40),
func = convert('flowRight', __webpack_require__(/*! ../flowRight */ 270));
func.placeholder = __webpack_require__(/*! ./placeholder */ 24);
module.exports = func;
/***/ }),
/* 270 */
/*!******************************************!*\
!*** ./node_modules/lodash/flowRight.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var createFlow = __webpack_require__(/*! ./_createFlow */ 271);
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
module.exports = flowRight;
/***/ }),
/* 271 */
/*!********************************************!*\
!*** ./node_modules/lodash/_createFlow.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 70),
flatRest = __webpack_require__(/*! ./_flatRest */ 48),
getData = __webpack_require__(/*! ./_getData */ 69),
getFuncName = __webpack_require__(/*! ./_getFuncName */ 106),
isArray = __webpack_require__(/*! ./isArray */ 0),
isLaziable = __webpack_require__(/*! ./_isLaziable */ 104);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function (funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
}
}
return function () {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
module.exports = createFlow;
/***/ }),
/* 272 */
/*!************************************************!*\
!*** ./includes/module_dependencies/styles.js ***!
\************************************************/
/*! exports provided: generateStyles, default */
/*! exports used: generateStyles */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generateStyles; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(/*! lodash */ 57);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(/*! ./utils */ 25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__hover_options__ = __webpack_require__(/*! ./hover-options */ 60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__responsive_options__ = __webpack_require__(/*! ./responsive-options */ 309);
function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ // External dependenciess
/**
* Format values by type.
*
* @since 4.6.0
*
* @param {object | Array | string} values
* @param {string} type
*/var formatValues=function formatValues(values,type){var formatValue=function formatValue(value){var val='';switch(type){case'range':val=__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].processRangeValue(value);break;case'margin':case'padding':if(value){value=value.split('|');val=(value[0]?value[0]:0)+' '+(value[1]?value[1]:0)+' '+(value[2]?value[2]:0)+' '+(value[3]?value[3]:0);}break;default:val=value;break;}return val;};if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isObject"])(values)){return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["mapValues"])(values,formatValue);}if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isArray"])(values)){return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["map"])(values,formatValue);}return formatValue(values);};/**
* Generate responsive + sticky state styles
* Use the `Responsive.generateResponsiveCSS`
* with addition to generating sticky state styles if module enable it.
*
* @since 4.6.0
* @param moduleArgs
* @param {object} {moduleArgs}
*/var generateStyles=function generateStyles(moduleArgs){var defaultArgs={address:'',attrs:{},name:'',defaultValue:'',type:'',forceReturn:false,selector:'%%order_class%%',cssProperty:'',important:false,hover:true,sticky:true,responsive:true,isStickyModule:null,stickyPseudoSelectorLocation:'order_class'};var args=_objectSpread2(_objectSpread2({},defaultArgs),moduleArgs);var address=args.address,attrs=args.attrs,name=args.name,defaultValue=args.defaultValue,type=args.type,forceReturn=args.forceReturn,selector=args.selector,cssProperty=args.cssProperty,important=args.important,hover=args.hover,sticky=args.sticky,responsive=args.responsive,isStickyModule=args.isStickyModule,stickyPseudoSelectorLocation=args.stickyPseudoSelectorLocation;var cssDeclarations=[];var additionalCSS=important?' !important':'';// Common styles
if(responsive){// Need to close the additionalCSS with the semicolon to prevent responsive css generation from generating invalid css
// when the cssProperty is an array
additionalCSS=''===additionalCSS?additionalCSS:"".concat(additionalCSS,";");var reponsiveValues=formatValues(__WEBPACK_IMPORTED_MODULE_3__responsive_options__["a" /* default */].getPropertyValues(attrs,name,defaultValue,hover,forceReturn),type);var reponsiveCss=__WEBPACK_IMPORTED_MODULE_3__responsive_options__["a" /* default */].generateResponsiveCSS(reponsiveValues,selector,cssProperty,additionalCSS);cssDeclarations=Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isEmpty"])(reponsiveCss)?cssDeclarations:reponsiveCss;}else{var cssValue=formatValues(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["get"])(attrs,name,defaultValue),type);if(hover){var hoverValue=__WEBPACK_IMPORTED_MODULE_2__hover_options__["a" /* default */].getHoverOrNormalOnHover(name,attrs);cssValue=__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].hasValue(hoverValue)?formatValues(hoverValue,type):formatValues(defaultValue,type);}if(__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* default */].hasValue(cssValue)){var declaration='';// Allow to use multiple properties in array for the same value.
if(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["isArray"])(cssProperty)){Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["forEach"])(cssProperty,function(cssProp){return declaration+="".concat(cssProp,": ").concat(cssValue).concat(additionalCSS,"; ");});}else{declaration="".concat(cssProperty,": ").concat(cssValue).concat(additionalCSS,";");}cssDeclarations.push({selector:selector,declaration:declaration.trim(),device:'desktop'});}}// Sticky styles
/*
const hasStickyStyles = Sticky.canHaveStickyStyle(address, attrs) && Sticky.isEnabled(name, attrs);
if (sticky && hasStickyStyles) {
const stickyValue = formatValues(Sticky.getValue(name, attrs, defaultValue));
const isSticky = null !== isStickyModule ? isStickyModule : Sticky.isStickyModule(address, attrs);
const stickySelector = 'order_class' === stickyPseudoSelectorLocation ? Sticky.addStickyToOrderClass(selector, isSticky) : Sticky.addStickyToSelectors(selector, isSticky);
if (Utils.hasValue(stickyValue)) {
let declaration = '';
// Allow to use multiple properties in array for the same value.
if (isArray(cssProperty)) {
forEach(cssProperty, cssProp => declaration += `${cssProp}: ${stickyValue}${additionalCSS}; `);
} else {
declaration = `${cssProperty}: ${stickyValue}${additionalCSS};`;
}
cssDeclarations.push({
selector: stickySelector,
declaration: declaration.trim(),
device: 'desktop',
});
}
}
*/return cssDeclarations;};/* unused harmony default export */ var _unused_webpack_default_export = ({generateStyles:generateStyles});
/***/ }),
/* 273 */
/*!***************************************!*\
!*** ./node_modules/lodash/assign.js ***!
\***************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 46),
copyObject = __webpack_require__(/*! ./_copyObject */ 13),
createAssigner = __webpack_require__(/*! ./_createAssigner */ 133),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 19),
keys = __webpack_require__(/*! ./keys */ 6);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* 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 (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
module.exports = assign;
/***/ }),
/* 274 */
/*!*************************************!*\
!*** ./node_modules/lodash/pick.js ***!
\*************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var basePick = __webpack_require__(/*! ./_basePick */ 275),
flatRest = __webpack_require__(/*! ./_flatRest */ 48);
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function (object, paths) {
return object == null ? {} : basePick(object, paths);
});
module.exports = pick;
/***/ }),
/* 275 */
/*!******************************************!*\
!*** ./node_modules/lodash/_basePick.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var basePickBy = __webpack_require__(/*! ./_basePickBy */ 276),
hasIn = __webpack_require__(/*! ./hasIn */ 123);
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function (value, path) {
return hasIn(object, path);
});
}
module.exports = basePick;
/***/ }),
/* 276 */
/*!********************************************!*\
!*** ./node_modules/lodash/_basePickBy.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 32),
baseSet = __webpack_require__(/*! ./_baseSet */ 277),
castPath = __webpack_require__(/*! ./_castPath */ 16);
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
module.exports = basePickBy;
/***/ }),
/* 277 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseSet.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 46),
castPath = __webpack_require__(/*! ./_castPath */ 16),
isIndex = __webpack_require__(/*! ./_isIndex */ 22),
isObject = __webpack_require__(/*! ./isObject */ 2),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
module.exports = baseSet;
/***/ }),
/* 278 */
/*!***************************************!*\
!*** ./node_modules/lodash/isNull.js ***!
\***************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
module.exports = isNull;
/***/ }),
/* 279 */
/*!*****************************************!*\
!*** ./node_modules/lodash/unescape.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var toString = __webpack_require__(/*! ./toString */ 17),
unescapeHtmlChar = __webpack_require__(/*! ./_unescapeHtmlChar */ 280);
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source);
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to
* their corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional
* HTML entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @since 0.6.0
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
}
module.exports = unescape;
/***/ }),
/* 280 */
/*!**************************************************!*\
!*** ./node_modules/lodash/_unescapeHtmlChar.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var basePropertyOf = __webpack_require__(/*! ./_basePropertyOf */ 281);
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'"
};
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
module.exports = unescapeHtmlChar;
/***/ }),
/* 281 */
/*!************************************************!*\
!*** ./node_modules/lodash/_basePropertyOf.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function (key) {
return object == null ? undefined : object[key];
};
}
module.exports = basePropertyOf;
/***/ }),
/* 282 */
/*!************************************!*\
!*** ./node_modules/lodash/now.js ***!
\************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 1);
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function now() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/* 283 */
/*!****************************************!*\
!*** ./node_modules/lodash/replace.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var toString = __webpack_require__(/*! ./toString */ 17);
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
module.exports = replace;
/***/ }),
/* 284 */
/*!************************************!*\
!*** ./node_modules/lodash/map.js ***!
\************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 21),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18),
baseMap = __webpack_require__(/*! ./_baseMap */ 285),
isArray = __webpack_require__(/*! ./isArray */ 0);
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, baseIteratee(iteratee, 3));
}
module.exports = map;
/***/ }),
/* 285 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseMap.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ 63),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5);
/**
* The base implementation of `_.map` 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} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function (value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
module.exports = baseMap;
/***/ }),
/* 286 */
/*!**************************************!*\
!*** ./node_modules/lodash/range.js ***!
\**************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var createRange = __webpack_require__(/*! ./_createRange */ 287);
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified,
* it's set to `start` with `start` then set to `0`.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.rangeRight
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
module.exports = range;
/***/ }),
/* 287 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_createRange.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseRange = __webpack_require__(/*! ./_baseRange */ 288),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 135),
toFinite = __webpack_require__(/*! ./toFinite */ 91);
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function (start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
} // Ensure the sign of `-0` is preserved.
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
step = step === undefined ? start < end ? 1 : -1 : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
module.exports = createRange;
/***/ }),
/* 288 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseRange.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeMax = Math.max;
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
module.exports = baseRange;
/***/ }),
/* 289 */
/*!*************************************!*\
!*** ./node_modules/lodash/find.js ***!
\*************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(/*! ./_createFind */ 290),
findIndex = __webpack_require__(/*! ./findIndex */ 132);
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
/***/ }),
/* 290 */
/*!********************************************!*\
!*** ./node_modules/lodash/_createFind.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 5),
keys = __webpack_require__(/*! ./keys */ 6);
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function (collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function predicate(key) {
return iteratee(iterable[key], key, iterable);
};
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
/***/ }),
/* 291 */
/*!*************************************!*\
!*** ./node_modules/lodash/take.js ***!
\*************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseSlice = __webpack_require__(/*! ./_baseSlice */ 136),
toInteger = __webpack_require__(/*! ./toInteger */ 7);
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = guard || n === undefined ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
module.exports = take;
/***/ }),
/* 292 */
/*!***************************************!*\
!*** ./node_modules/lodash/forOwn.js ***!
\***************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 64),
castFunction = __webpack_require__(/*! ./_castFunction */ 65);
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, castFunction(iteratee));
}
module.exports = forOwn;
/***/ }),
/* 293 */
/*!************************************!*\
!*** ./node_modules/lodash/has.js ***!
\************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(/*! ./_baseHas */ 294),
hasPath = __webpack_require__(/*! ./_hasPath */ 124);
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
module.exports = has;
/***/ }),
/* 294 */
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseHas.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
module.exports = baseHas;
/***/ }),
/* 295 */
/*!****************************************!*\
!*** ./node_modules/lodash/partial.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ 134),
createWrap = __webpack_require__(/*! ./_createWrap */ 41),
getHolder = __webpack_require__(/*! ./_getHolder */ 72),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 45);
/** Used to compose bitmasks for function metadata. */
var WRAP_PARTIAL_FLAG = 32;
/**
* Creates a function that invokes `func` with `partials` prepended to the
* arguments it receives. This method is like `_.bind` except it does **not**
* alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 0.2.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // Partially applied with placeholders.
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = baseRest(function (func, partials) {
var holders = replaceHolders(partials, getHolder(partial));
return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
}); // Assign default placeholders.
partial.placeholder = {};
module.exports = partial;
/***/ }),
/* 296 */
/*!******************************************!*\
!*** ./node_modules/lodash/cloneDeep.js ***!
\******************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ 47);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* 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, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;
/***/ }),
/* 297 */
/*!****************************************!*\
!*** ./node_modules/lodash/indexOf.js ***!
\****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ 58),
toInteger = __webpack_require__(/*! ./toInteger */ 7);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
module.exports = indexOf;
/***/ }),
/* 298 */
/*!*************************************!*\
!*** ./node_modules/lodash/omit.js ***!
\*************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 21),
baseClone = __webpack_require__(/*! ./_baseClone */ 47),
baseUnset = __webpack_require__(/*! ./_baseUnset */ 299),
castPath = __webpack_require__(/*! ./_castPath */ 16),
copyObject = __webpack_require__(/*! ./_copyObject */ 13),
customOmitClone = __webpack_require__(/*! ./_customOmitClone */ 301),
flatRest = __webpack_require__(/*! ./_flatRest */ 48),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ 117);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function (object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function (path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
/***/ }),
/* 299 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseUnset.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 16),
last = __webpack_require__(/*! ./last */ 49),
parent = __webpack_require__(/*! ./_parent */ 300),
toKey = __webpack_require__(/*! ./_toKey */ 12);
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
module.exports = baseUnset;
/***/ }),
/* 300 */
/*!****************************************!*\
!*** ./node_modules/lodash/_parent.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 32),
baseSlice = __webpack_require__(/*! ./_baseSlice */ 136);
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
module.exports = parent;
/***/ }),
/* 301 */
/*!*************************************************!*\
!*** ./node_modules/lodash/_customOmitClone.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
var isPlainObject = __webpack_require__(/*! ./isPlainObject */ 119);
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
module.exports = customOmitClone;
/***/ }),
/* 302 */
/*!******************************************!*\
!*** ./node_modules/lodash/fromPairs.js ***!
\******************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports) {
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['a', 1], ['b', 2]]);
* // => { 'a': 1, 'b': 2 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs == null ? 0 : pairs.length,
result = {};
while (++index < length) {
var pair = pairs[index];
result[pair[0]] = pair[1];
}
return result;
}
module.exports = fromPairs;
/***/ }),
/* 303 */
/*!***************************************!*\
!*** ./node_modules/lodash/reduce.js ***!
\***************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ 304),
baseEach = __webpack_require__(/*! ./_baseEach */ 63),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18),
baseReduce = __webpack_require__(/*! ./_baseReduce */ 305),
isArray = __webpack_require__(/*! ./isArray */ 0);
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
module.exports = reduce;
/***/ }),
/* 304 */
/*!*********************************************!*\
!*** ./node_modules/lodash/_arrayReduce.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* 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 == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
module.exports = arrayReduce;
/***/ }),
/* 305 */
/*!********************************************!*\
!*** ./node_modules/lodash/_baseReduce.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function (value, index, collection) {
accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);
});
return accumulator;
}
module.exports = baseReduce;
/***/ }),
/* 306 */
/*!******************************************!*\
!*** ./node_modules/lodash/mapValues.js ***!
\******************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 73),
baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 64),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 18);
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = baseIteratee(iteratee, 3);
baseForOwn(object, function (value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
module.exports = mapValues;
/***/ }),
/* 307 */
/*!*****************************************************!*\
!*** ./includes/module_dependencies/lib-sprintf.js ***!
\*****************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*//* harmony default export */ __webpack_exports__["a"] = (function(){// source : http://locutus.io/php/sprintf/
//
// example 1: sprintf("%01.2f", 123.1)
// returns 1: '123.10'
var regex=/%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g;var args=arguments;var i=0;var format=args[i++];var _pad=function _pad(str,len,chr,leftJustify){if(!chr){chr=' ';}var padding=str.length>=len?'':new Array(1+len-str.length>>>0).join(chr);return leftJustify?str+padding:padding+str;};var justify=function justify(value,prefix,leftJustify,minWidth,padChar){var diff=minWidth-value.length;if(diff>0){// when padding with zeros
// on the left side
// keep sign (+ or -) in front
if(!leftJustify&&'0'===padChar){value=[value.slice(0,prefix.length),_pad('',diff,'0',true),value.slice(prefix.length)].join('');}else{value=_pad(value,minWidth,padChar,leftJustify);}}return value;};var _formatBaseX=function _formatBaseX(value,base,leftJustify,minWidth,precision,padChar){// Note: casts negative numbers to positive ones
var number=value>>>0;value=_pad(number.toString(base),precision||0,'0',false);return justify(value,'',leftJustify,minWidth,padChar);};// _formatString()
var _formatString=function _formatString(value,leftJustify,minWidth,precision,customPadChar){if(precision!==null&&precision!==undefined){value=value.slice(0,precision);}return justify(value,'',leftJustify,minWidth,customPadChar);};// doFormat()
var doFormat=function doFormat(substring,argIndex,modifiers,minWidth,precision,specifier){var number;var prefix;var method;var textTransform;var value;if('%%'===substring){return'%';}// parse modifiers
var padChar=' ';// pad with spaces by default
var leftJustify=false;var positiveNumberPrefix='';var j;var l;for(j=0,l=modifiers.length;j<l;j++){switch(modifiers.charAt(j)){case' ':case'0':padChar=modifiers.charAt(j);break;case'+':positiveNumberPrefix='+';break;case'-':leftJustify=true;break;case"'":if(j+1<l){padChar=modifiers.charAt(j+1);j++;}break;}}if(!minWidth){minWidth=0;}else{minWidth=+minWidth;}if(!isFinite(minWidth)){throw new Error('Width must be finite');}if(!precision){precision='d'===specifier?0:'fFeE'.indexOf(specifier)>-1?6:undefined;}else{precision=+precision;}if(argIndex&&0===+argIndex){throw new Error('Argument number must be greater than zero');}if(argIndex&&+argIndex>=args.length){throw new Error('Too few arguments');}value=argIndex?args[+argIndex]:args[i++];switch(specifier){case'%':return'%';case's':return _formatString("".concat(value),leftJustify,minWidth,precision,padChar);case'c':return _formatString(String.fromCharCode(+value),leftJustify,minWidth,precision,padChar);case'b':return _formatBaseX(value,2,leftJustify,minWidth,precision,padChar);case'o':return _formatBaseX(value,8,leftJustify,minWidth,precision,padChar);case'x':return _formatBaseX(value,16,leftJustify,minWidth,precision,padChar);case'X':return _formatBaseX(value,16,leftJustify,minWidth,precision,padChar).toUpperCase();case'u':return _formatBaseX(value,10,leftJustify,minWidth,precision,padChar);case'i':case'd':number=+value||0;// Plain Math.round doesn't just truncate
number=Math.round(number-number%1);prefix=number<0?'-':positiveNumberPrefix;value=prefix+_pad(String(Math.abs(number)),precision,'0',false);if(leftJustify&&'0'===padChar){// can't right-pad 0s on integers
padChar=' ';}return justify(value,prefix,leftJustify,minWidth,padChar);case'e':case'E':case'f':// @todo: Should handle locales (as per setlocale)
case'F':case'g':case'G':number=+value;prefix=number<0?'-':positiveNumberPrefix;method=['toExponential','toFixed','toPrecision']['efg'.indexOf(specifier.toLowerCase())];textTransform=['toString','toUpperCase']['eEfFgG'.indexOf(specifier)%2];value=prefix+Math.abs(number)[method](precision);return justify(value,prefix,leftJustify,minWidth,padChar)[textTransform]();default:// unknown specifier, consume that char and return empty
return'';}};try{return format.replace(regex,doFormat);}catch(err){return false;}});
/***/ }),
/* 308 */
/*!**************************************************!*\
!*** ./includes/module_dependencies/lib-util.js ***!
\**************************************************/
/*! exports provided: isOn, isOff, isOnOff, isYes, isNo, isDefault, getScrollbarWidth, windowHasScrollbar, sanitizedPreviously */
/*! exports used: getScrollbarWidth, sanitizedPreviously */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export isOn */
/* unused harmony export isOff */
/* unused harmony export isOnOff */
/* unused harmony export isYes */
/* unused harmony export isNo */
/* unused harmony export isDefault */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollbarWidth; });
/* unused harmony export windowHasScrollbar */
/* harmony export (immutable) */ __webpack_exports__["b"] = sanitizedPreviously;
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ /**
* Check whether a value is "on".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isOn=function isOn(value){return'on'===value;};/**
* Check whether a value is "off".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isOff=function isOff(value){return'off'===value;};/**
* Check whether a value is "on" or "off".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isOnOff=function isOnOff(value){return'on'===value||'off'===value;};/**
* Check whether a value is "yes".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isYes=function isYes(value){return'yes'===value;};/**
* Check whether a value is "no".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isNo=function isNo(value){return'no'===value;};/**
* Check whether a value is "default".
*
* @since 4.0
*
* @param {*} value
*
* @returns {boolean}
*/var isDefault=function isDefault(value){return'default'===value;};/**
* Get scrollbar width even when there is no scrollbar right now.
*
* @since 4.0
*
* @returns {integer}
*/var scrollbarWidthCache=-1;var getScrollbarWidth=function getScrollbarWidth(){if(-1!==scrollbarWidthCache){return scrollbarWidthCache;}var outer=document.createElement('div');var inner=document.createElement('div');outer.style.visibility='hidden';outer.style.width='100px';inner.style.width='100%';// Set explicit height to inner to ensure inner has dimension which later creates scroll on outer;
// This is specifically needed on Safari
inner.style.height='100%';outer.appendChild(inner);document.body.appendChild(outer);var widthWithoutScrollbar=outer.offsetWidth;outer.style.overflow='scroll';var widthWithScrollbar=inner.offsetWidth;document.body.removeChild(outer);scrollbarWidthCache=widthWithoutScrollbar-widthWithScrollbar;return scrollbarWidthCache;};/**
* Get whether the window has a scrollbar visible right now.
*
* @param window
* @since 4.0
* @returns {boolean}
*/var windowHasScrollbar=function windowHasScrollbar(window){return window.document.body.scrollHeight>window.document.body.clientHeight;};/**
* Semantical previously sanitized acknowledgement.
*
* @param {*} value The value being passed-through.
*
* @returns {*}
*/function sanitizedPreviously(value){return value;}
/***/ }),
/* 309 */
/*!************************************************************!*\
!*** ./includes/module_dependencies/responsive-options.js ***!
\************************************************************/
/*! exports provided: isResponsiveEnabled, isAnyResponsiveEnabled, isMobileSettingsEnabled, isValueAcceptable, isOrHasValue, isMobile, isFieldBaseName, hasMobileOptions, getResponsiveStatus, getValue, getAnyValue, getAnyDefinedValue, getPropertyValue, getPropertyValues, getCheckedPropertyValue, getCompositePropertyValue, getCompositePropertyValues, getAnyResponsiveValues, getDefaultValue, getDefaultDefinedValue, getNonEmpty, getFieldName, getFieldNames, getFieldBaseName, getDeviceName, getActiveSettingName, getInheritedSettingName, getInitialActiveTabMode, getCalculatedPreviewMode, getDevicesList, getModeByWidth, getDevicesByLastEdited, getBreakpointByDevice, getTabByMode, getIconSize, getIconSizes, getLastEditedFieldName, getLastEditedFieldValue, generateResponsiveCSS, getPreviousDevice, default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export isResponsiveEnabled */
/* unused harmony export isAnyResponsiveEnabled */
/* unused harmony export isMobileSettingsEnabled */
/* unused harmony export isValueAcceptable */
/* unused harmony export isOrHasValue */
/* unused harmony export isMobile */
/* unused harmony export isFieldBaseName */
/* unused harmony export hasMobileOptions */
/* unused harmony export getResponsiveStatus */
/* unused harmony export getValue */
/* unused harmony export getAnyValue */
/* unused harmony export getAnyDefinedValue */
/* unused harmony export getPropertyValue */
/* unused harmony export getPropertyValues */
/* unused harmony export getCheckedPropertyValue */
/* unused harmony export getCompositePropertyValue */
/* unused harmony export getCompositePropertyValues */
/* unused harmony export getAnyResponsiveValues */
/* unused harmony export getDefaultValue */
/* unused harmony export getDefaultDefinedValue */
/* unused harmony export getNonEmpty */
/* unused harmony export getFieldName */
/* unused harmony export getFieldNames */
/* unused harmony export getFieldBaseName */
/* unused harmony export getDeviceName */
/* unused harmony export getActiveSettingName */
/* unused harmony export getInheritedSettingName */
/* unused harmony export getInitialActiveTabMode */
/* unused harmony export getCalculatedPreviewMode */
/* unused harmony export getDevicesList */
/* unused harmony export getModeByWidth */
/* unused harmony export getDevicesByLastEdited */
/* unused harmony export getBreakpointByDevice */
/* unused harmony export getTabByMode */
/* unused harmony export getIconSize */
/* unused harmony export getIconSizes */
/* unused harmony export getLastEditedFieldName */
/* unused harmony export getLastEditedFieldValue */
/* unused harmony export generateResponsiveCSS */
/* unused harmony export getPreviousDevice */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_forEach__ = __webpack_require__(/*! lodash/forEach */ 38);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_forEach__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_last__ = __webpack_require__(/*! lodash/last */ 49);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_last___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_last__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_endsWith__ = __webpack_require__(/*! lodash/endsWith */ 310);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_endsWith___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_endsWith__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_includes__ = __webpack_require__(/*! lodash/includes */ 30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_includes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_includes__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined__ = __webpack_require__(/*! lodash/isUndefined */ 59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_isString__ = __webpack_require__(/*! lodash/isString */ 31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_isString___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_isString__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_isArray__ = __webpack_require__(/*! lodash/isArray */ 0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_isArray__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash_isObject__ = __webpack_require__(/*! lodash/isObject */ 2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash_isObject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash_isObject__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__previewModes__ = __webpack_require__(/*! ./previewModes */ 312);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__et_builder_offsets__ = __webpack_require__(/*! ./et-builder-offsets */ 137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils__ = __webpack_require__(/*! ./utils */ 25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__hover_options__ = __webpack_require__(/*! ./hover-options */ 60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__ = __webpack_require__(/*! ./responsive-options-pure */ 129);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ // External dependencies
// Internal dependencies
/**
* Check if responsive settings is enabled or not on the option.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*/var isResponsiveEnabled=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].isResponsiveEnabled;/**
* Check if responsive settings are enabled on the list of options.
*
* @since 3.23
*
* @param {Array} attrs All module attributes.
* @param {Array} list Options list.
* @returns {boolean} Responsive styles status.
*/var isAnyResponsiveEnabled=function isAnyResponsiveEnabled(){var attrs=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var list=arguments.length>1?arguments[1]:undefined;// Ensure list is not empty and valid array.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(list)||!__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(list)){return false;}// Check the responsive status one by one.
var isAnyResponsiveActive=false;__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(list,function(name){if(isResponsiveEnabled(attrs,name)){isAnyResponsiveActive=true;return false;}});return isAnyResponsiveActive;};/**
* Check if current option is in tablet or phone mode and the responsive setting is enabled.
*
* @since 3.23
*
* @param {object} props Settings modal props.
* @param {object} attrs Module attrs.
* @param {string} name Field name.
*
* @returns {boolean} Status.
*/var isMobileSettingsEnabled=function isMobileSettingsEnabled(props,attrs,name){var isResponsive=isResponsiveEnabled(attrs,name);var activeTabMode=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(props,'activeTabMode','desktop');if(__WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(getDevicesList('desktop'),activeTabMode)&&isResponsive){return true;}return false;};/**
* Check if current value is acceptable or not. Why we don't use simple if (value) to check
* acceptability? Because we may save 0 value for the option, and even empty string or false.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*
* @param {Mixed} value Check if current.
* @returns {boolean} Value accepability status.
*/var isValueAcceptable=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].isValueAcceptable;/**
* Check if a field's selected value is OR has a value
* If responsive is active, field returns array of desktop, tablet and phone values.
*
* @since 4.6.0
*
* @param {string|object} fieldValue The field's value; if string, responsive mode isn't active.
* @param {string} value Value to be compared / contained.
*
* @returns {bool}
*/var isOrHasValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].isOrHasValue;/**
* Check if current state is responsive but desktop or not responsive at all.
*
* Basically, not responsive means we are on normal mode with non suffix value and name are used.
*
* @since 3.23
*
* @param {object} props Module, field, or control props.
* @param {object} needResponsive If need to check responsive status.
*
* @returns {boolean} Desktop status.
*/var isMobile=function isMobile(props){var needResponsive=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;// Module pros should not be empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(props)){return false;}var isResponsive=needResponsive?__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(props,'isResponsive',false):true;var activeTabMode=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(props,'activeTabMode','desktop');return isResponsive&&__WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(getDevicesList('desktop'),activeTabMode);};/**
* Check if current field name already contains responsive suffix.
*
* @since 3.23
*
* @param {string} name Field name.
* @returns {boolean} Responsive suffix status.
*/var isFieldBaseName=function isFieldBaseName(name){var isFieldBaseName=false;__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(getDevicesList('desktop'),function(device){if(__WEBPACK_IMPORTED_MODULE_3_lodash_endsWith___default()(name,"_".concat(device))){isFieldBaseName=true;}});return isFieldBaseName;};/**
* Check if current option has mobile_options and it's not false.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*
* @param {object} props Option props.
* @returns {boolean} Mobile options prop status.
*/var hasMobileOptions=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].hasMobileOptions;/**
* Check responsive value existence of responsive inputs (text/range/text margin) by passing its
* *_last_edited value.
*
* Copy of Utils.getResponsiveStatus(). Moved here to organize the code.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*/var getResponsiveStatus=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getResponsiveStatus;/**
* @inheritDoc
*/var getValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getValue;/**
* @inheritDoc
*/var getAnyValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getAnyValue;/**
* @inheritDoc
*/var getAnyDefinedValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getAnyDefinedValue;/**
* Get property's values for requested device.
*
* This function is added to summarize how we fetch desktop/hover/tablet/phone value. This
* function still uses getAnyValue to get current device values.
*
* @since 3.23
*
* @param {object} attrs List of all attributes and values.
* @param {string} name Property name.
* @param {Mixed} defaultValue Default value.
* @param {string} device Device name.
* @param {boolean} needHover Need hover value status.
* @param {boolean} forceReturn Force to return any values found.
*
* @returns {object} Pair of devices and the values.
*/var getPropertyValue=function getPropertyValue(attrs,name){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var device=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'dekstop';var needHover=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var forceReturn=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;// Default values.
var value=defaultValue;// Ensure device is not empty.
device=''===device?'desktop':device;// Ensure attrs (values list) and name (property name) are not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(attrs)||''===name){return value;}// Responsive and Hover status.
var isEnabled='desktop'!==device?isResponsiveEnabled(attrs,name):true;var isHover=needHover&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode()&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isEnabled(name,attrs);var suffix='desktop'!==device?"_".concat(device):'';value=isEnabled?getAnyValue(attrs,"".concat(name).concat(suffix),defaultValue,forceReturn):defaultValue;if(isHover){value=__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].getHoverOrNormalOnHover(name,attrs);}return value;};/**
* Get all properties values for all devices.
*
* This function is added to summarize how we fetch desktop/hover, tablet, and phone values. This
* function still use getAnyValue to get current device values.
*
* @since 3.23
*
* @param {object} attrs List of all attributes and values.
* @param {string} name Property name.
* @param {Mixed} defaultValue Default value.
* @param {boolean} needHover Need hover value status.
* @param {boolean} forceReturn Force to return any values found.
*
* @returns {object} Pair of devices and the values.
*/var getPropertyValues=function getPropertyValues(attrs,name){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var needHover=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var forceReturn=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;// Default values.
var values={desktop:defaultValue,tablet:defaultValue,phone:defaultValue};// Ensure attrs (values list) and name (property name) are not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(attrs)||''===name){return values;}var isResponsive=isResponsiveEnabled(attrs,name);var isHover=needHover&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode()&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isEnabled(name,attrs);// Get values for each devices.
values.desktop=isHover?__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].getHoverOrNormalOnHover(name,attrs):getAnyValue(attrs,name,defaultValue,forceReturn);values.tablet=isResponsive&&!isHover?getAnyValue(attrs,"".concat(name,"_tablet"),defaultValue,forceReturn):defaultValue;values.phone=isResponsive&&!isHover?getAnyValue(attrs,"".concat(name,"_phone"),defaultValue,forceReturn):defaultValue;return values;};/**
* Get property value after checking whether it uses responsive or not.
*
* If responsive is used, automatically return array of all devices value.
* If responsive is not used, return string of desktop value.
*
* @since 4.6.0
*
* @param {object} attrs List of all attributes and values.
* @param {string} name Property name.
* @param {Mixed} defaultValue Default value.
* @param {boolean} needHover Need hover value status.
* @param {boolean} forceReturn Force to return any values found.
*
* @returns {object|string}
*/var getCheckedPropertyValue=function getCheckedPropertyValue(attrs,name){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var needHover=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var forceReturn=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var isResponsive=isResponsiveEnabled(attrs,name);return isResponsive?getPropertyValues(attrs,name,defaultValue,needHover,forceReturn):getPropertyValue(attrs,name,defaultValue,'desktop',needHover,forceReturn);};/**
* Get composite property's value for requested device.
*
* This function is added to summarize how we fetch desktop/hover/tablet/phone value. This
* function still uses getAnyValue to get current device values.
*
* @since 3.27.4
*
* @param {object} attrs List of all attributes and values.
* @param {string} compositeName Composite property name.
* @param {string} name Property name.
* @param {mixed} defaultValue Default value.
* @param {string} device Device name.
* @param {boolean} needHover Need hover value status.
* @param {boolean} forceReturn Force to return any values found.
*
* @returns {object} Pair of devices and the values.
*/var getCompositePropertyValue=function getCompositePropertyValue(attrs,compositeName,name){var defaultValue=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'';var device=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'dekstop';var needHover=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;var forceReturn=arguments.length>6&&arguments[6]!==undefined?arguments[6]:false;// Default values.
var value=defaultValue;// Ensure device is not empty.
device=''===device?'desktop':device;// Ensure attrs, composite name (parent property name), name (property name) are not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(attrs)||''===compositeName||''===name){return value;}// Responsive and Hover status.
var isEnabled='desktop'!==device?isResponsiveEnabled(attrs,compositeName):true;var isHover=needHover&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode()&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isEnabled(compositeName,attrs);var suffix='desktop'!==device?"_".concat(device):'';value=isEnabled?getAnyValue(attrs,"".concat(name).concat(suffix),defaultValue,forceReturn):defaultValue;if(isHover){value=__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].getHoverOrNormalOnHover(name,attrs);}return value;};/**
* Get all composite properties values for all devices.
*
* This function is added to summarize how we fetch desktop/hover, tablet, and phone values. This
* function still use getAnyValue to get current device values.
*
* @since 3.27.4
*
* @param {object} attrs List of all attributes and values.
* @param {string} compositeName Composite field name.
* @param {string} name Property name.
* @param {mixed} defaultValue Default value.
* @param {boolean} needHover Need hover value status.
* @param {boolean} forceReturn Force to return any values found.
*
* @returns {object} Pair of devices and the values.
*/var getCompositePropertyValues=function getCompositePropertyValues(attrs,compositeName,name){var defaultValue=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'';var needHover=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var forceReturn=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;// Default values.
var values={desktop:defaultValue,tablet:defaultValue,phone:defaultValue};// Ensure attrs, composite name (parent property name), name (property name) are not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(attrs)||''===compositeName||''===name){return values;}var isResponsive=isResponsiveEnabled(attrs,compositeName);var isHover=needHover&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode()&&__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isEnabled(compositeName,attrs);// Get values for each devices.
values.desktop=isHover?__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].getCompositeValue(name,compositeName,attrs):getAnyValue(attrs,name,defaultValue,forceReturn);values.tablet=isResponsive&&!isHover?getAnyValue(attrs,"".concat(name,"_tablet"),defaultValue,forceReturn):defaultValue;values.phone=isResponsive&&!isHover?getAnyValue(attrs,"".concat(name,"_phone"),defaultValue,forceReturn):defaultValue;return values;};/**
* Get some current active device values from attributes.
*
* Basically, this function is combination of:
* - Get any value of attribute
* - Check attribute responsive status for tablet/phone
* - Only send non empty attributes, except you force to return any given value
* - Doing all of the process above for more than one fields.
*
* @since 3.23
*
* @param {Array} attrs All module attributes.
* @param {string} list List of options name. Name should be field base name.
* @param {boolean} forceReturn Force to return any value.
* @param {string} device Current device name.
*
* @returns {Array} All option values.
*/var getAnyResponsiveValues=function getAnyResponsiveValues(attrs,list){var forceReturn=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var device=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'desktop';// Ensure list is not empty and valid array.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(list)||!__WEBPACK_IMPORTED_MODULE_9_lodash_isObject___default()(list)){return{};}// Ensure device is not empty.
device=''===device?'desktop':device;// Fetch each attribute and store it in $values.
var values={};__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(list,function(defaultValue,name){// Check responsive status if current device is tablet or phone.
if('desktop'!==device&&!isResponsiveEnabled(attrs,name)){return;}// Get value.
var value=getAnyValue(attrs,name,defaultValue,forceReturn,device);// No need to save the value if it's empty and we don't force to return any value.
if(!forceReturn&&__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(value)){return;}values[name]=value;});return values;};/**
* @inheritDoc
*/var getDefaultValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getDefaultValue;/**
* @inheritDoc
*/var getDefaultDefinedValue=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getDefaultDefinedValue;/**
* @inheritDoc
*/var getNonEmpty=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getNonEmpty;/**
* Returns the field responsive name by adding the `_tablet` or `_phone` suffix if it exists.
*
* @since 3.24.1
* @since 3.26.7 Move it to responsive options pure library.
*
* @param {string} name Setting name.
* @param {string} device Device name.
*
* @returns {string} Responsive setting name.
*/var getFieldName=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getFieldName;/**
* Return all fields name with responsive suffix.
*
* @since 4.0
*
* @param {string} name
* @param {boolean} needBaseName
* @param {boolean} needLastEdited
* @returns {Array}
*/var getFieldNames=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getFieldNames;/**
* Returns the field original name by removing the `_tablet` or `_phone` suffix if it exists.
*
* Only remove desktop/tablet/phone string of the last setting name. Doesn't work for other format.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*
* @param {string} name Setting name.
*
* @returns {string} Base setting name.
*/var getFieldBaseName=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getFieldBaseName;/**
* Returns the device name by removing the `name` prefix.
*
* @since 3.23
*
* @param {string} name Setting name.
*
* @returns {string} Device name.
*/var getDeviceName=function getDeviceName(name){// Field name should be string and not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(name)||!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(name)){return'';}// Ensure namePieces length is enough. If only one, just return current setting name.
var namePieces=name.split('_');if(namePieces.length<=1){return'';}var device=__WEBPACK_IMPORTED_MODULE_2_lodash_last___default()(namePieces);var isSuffixExist=__WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(getDevicesList(),device);// Ensure device is valid.
if(!isSuffixExist||'desktop'===device){return'';}// Return device name.
return device;};/**
* Get active tab field name contains base name and current active tab as suffix.
*
* Should be used only under settings modal. Don't use this if you want to add the suffix manually.
*
* @since 3.23
*
* @param {string} baseName Field base name.
* @param {object} props Module props.
*
* @returns {string} Responsive field name.
*/var getActiveSettingName=function getActiveSettingName(baseName,props){// Module pros and field base name should not be empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(props)||__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(baseName)||!__WEBPACK_IMPORTED_MODULE_6_lodash_isString___default()(baseName)){return baseName;}// Ensure no suffix added previously.
var baseNamePieces=baseName.split('_');if(__WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(getDevicesList(),__WEBPACK_IMPORTED_MODULE_2_lodash_last___default()(baseNamePieces))){return baseName;}// Return base name with suffix only if it's not desktop.
var isResponsive=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(props,'isResponsive',false);var activeTabMode=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(props,'activeTabMode','desktop');if(isResponsive&&activeTabMode!=='desktop'){return"".concat(baseName,"_").concat(activeTabMode);}return baseName;};/**
* Get inherited field name if current field value is inherited from bigger device.
*
* For example:
* background_image_tablet current value is inherited from background_image, so this
* function will return background_image field name.
*
* @since 3.23
*
* @param {object} props Background field props.
* @param {object} attrs Module attrs.
* @param {string} fieldName Field name with suffix (_tablet, __hover, _phone).
* @param {string} defaultFieldName Field name without suffix.
*
* @returns {string} Inherited field name without suffix.
*/var getInheritedSettingName=function getInheritedSettingName(props,attrs,fieldName,defaultFieldName){// Just return default field name, if current device is desktop and not hover.
var device=props.activeTabMode;var isHover=__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode();if('desktop'===device&&!isHover){return defaultFieldName;}// Get pure field value (without inheritance) and inherited value.
var fieldValue=isHover?__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(attrs,fieldName,''):getAnyValue(attrs,fieldName);var inheritedValue=isHover?__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(attrs,fieldName.replace(__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].hoverSuffix(),''),''):getAnyValue(attrs,fieldName,'',true);// If original field value is empty and the value is inherited.
if(''===fieldValue&&inheritedValue){// Hover. Just return default field name.
if(isHover){return defaultFieldName;}var fieldBaseName=getFieldBaseName(fieldName);// If current device is tablet or phone and tablet value exists, return field name with tablet suffix.
var fieldValueTablet=getAnyValue(attrs,"".concat(fieldBaseName,"_tablet"));if(''!==fieldValueTablet){return"".concat(fieldBaseName,"_tablet");}// If current device is tablet or phone and desktop value exists, return field base name.
var fieldValueDesktop=getAnyValue(attrs,fieldBaseName);if(''!==fieldValueDesktop){return fieldBaseName;}}return fieldName;};/**
* Get initial active responsive tab.
* - Calculate current active preview mode on builder. The active mode will be one of desktop,
* tablet, phone, or wireframe. How about zoom? Zoom mode is basically desktop mode. It will
* be converted to desktop on getCalculatedPreviewMode().
* - Return calculated mode as the initial active tab.
* - However, if the calculated mode is not valid device, we have to return desktop value just
* to make sure it has valid device value (desktop, tablet, phone).
*
* - Don't use it for the actual action to get current active tab. Why? Because in settings
* modal we will save current active tab in the state. It will be actual and can be used
* on the field controls under settings modal. Be wise to use it only to get initial active
* tab during first rendering.
*
* Currently used by:
* - Settings modal.
*
* @since 3.23
*
* @returns {string} Reposive active tab.
*/var getInitialActiveTabMode=function getInitialActiveTabMode(){// Calculate current active preview mode.
var mode=getCalculatedPreviewMode();// Ensure calculated mode is one of valid devices.
var devices=getDevicesList();return __WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(devices,mode)?mode:'desktop';};/**
* Get calculated preview mode.
* - Get current preview mode first. We don't want to use it as active tab since the value is not
* really up to date. We need it to ensure if it's actual device or maybe desktop or wireframe.
* - If the current active mode is not zoom or wireframe, we need to calculate $appWindow widht
* to get the correct view mode.
*
* @since 3.23
*
* @returns {string} Calculated preview mode.
*/var getCalculatedPreviewMode=function getCalculatedPreviewMode(){// Get current preview mode.
// const previewMode = ETBuilderStore.getPreviewMode();
var previewMode=window.ET_Builder.Frames.app.ET_Builder.API.State.View_Mode.current;// Bail early if current preview mode is zoom of wireframe.
if('zoom'===previewMode){return'desktop';}if('wireframe'===previewMode){return'wireframe';}// Calculate current view mode based on $appWindow width. Desktop, Tablet, or Phone.
var ETPreviewModes=__WEBPACK_IMPORTED_MODULE_10__previewModes__["a" /* default */].instance();return ETPreviewModes.getViewModeByWidth(__WEBPACK_IMPORTED_MODULE_12__utils__["a" /* default */].$appWindow().width());};/**
* Get list of all or selected devices.
*
* Default devices are desktop, tablet, and phone. Just in case we want to extend it, we have to
* edit variable defaultDevices.
*
* @since 3.23
* @since 3.26.7 Move it to responsive options pure library.
*
* @param {Array | string} ignoredDevices Ignored devices. Can be string or array to pass multiple devices.
*
* @returns {Array} Selected devices.
*/var getDevicesList=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getDevicesList;/**
* Get view mode by width.
*
* Copy of ETPreviewModes.getViewModeByWidth.
*
* @param {string} value Preview width.
*
* @returns {string} Mode name.
*/var getModeByWidth=function getModeByWidth(value){var responsiveWidth=__WEBPACK_IMPORTED_MODULE_11__et_builder_offsets__["a" /* default */].responsive;var mode='desktop';if(value<=responsiveWidth.phone){mode='phone';}else if(value<=responsiveWidth.tablet){mode='tablet';}return mode;};/**
* Get responsive break points based on the options last_edited status.
*
* @since 3.23
*
* @param {object} allValues All advanced settings module value.
* @param {Array} properties Options group properties.
* @param {string} label Field option label.
* @param {string} element Element or options group label.
*
* @returns {Array} Correct responsive breakpoint.
*/var getDevicesByLastEdited=function getDevicesByLastEdited(allValues,properties,label,element){var isResponsive=false;// Check last_edited status for all properties.
__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(properties,function(property){// Build property name.
var prefix=label?"".concat(label,"_"):'';var propertyName="".concat(prefix).concat(element,"_").concat(property);// Get last edited value to clarify the responsive status.
var lastEdited=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(allValues,"".concat(propertyName,"_last_edited"),'');isResponsive=getResponsiveStatus(lastEdited);// Stop early if we already know responsive is enabled on one of the options.
if(isResponsive){return false;}});// Return all devices if responsive is enabled.
return isResponsive?['tablet','phone']:[];};/**
* Get breakpoint based on device name.
*
* @since 3.23
* @since 4.0 Introduces min_width_768 for desktop & tablet only.
*
* @param {string} device Device name.
*
* @returns {string} Device breakpoint.
*/var getBreakpointByDevice=function getBreakpointByDevice(device){switch(device){case'desktop_only':return'min_width_981';case'tablet':return'max_width_980';case'tablet_only':return'768_980';case'desktop_tablet_only':return'min_width_768';case'phone':return'max_width_767';default:return'general';}};/**
* Get tab name based on preview mode.
*
* @since 3.23
*
* @param {string} previewMode Current active preview mode.
*
* @returns {string} Active tab name.
*/var getTabByMode=function getTabByMode(previewMode){switch(previewMode){case'wireframe':case'zoom':case'desktop':return __WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode()?'hover':'desktop';break;case'tablet':case'phone':return previewMode;break;default:return'desktop';break;}};/**
* Get icon font size value or default.
*
* @since 3.23
*
* @param {object} attrs List of all attributes and values.
* @param {string} moduleName Module name.
* @param {string} size Original size either empty or valid string.
* @param {string} defaultSize Default icon size if any.
* @param {string} iconSizeName Property name.
* @param {string} useIconSize Parent property name.
*
* @returns {string} Default or valid font size.
*/var getIconSize=function getIconSize(attrs,moduleName,size){var defaultSize=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'16px';var iconSizeName=arguments.length>4&&arguments[4]!==undefined?arguments[4]:'icon_font_size';var useIconSize=arguments.length>5&&arguments[5]!==undefined?arguments[5]:'use_icon_font_size';// Default icon size on definition store.
// const defaultIconFontSize = get(ETBuilderComponentDefinitionStore.getComponentAdvancedField(moduleName, iconSizeName), 'default', defaultSize);
var defaultIconFontSize=0;// If undefined or not default size or custom setting off, return original value.
return __WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined___default()(size)||size!==defaultIconFontSize||__WEBPACK_IMPORTED_MODULE_12__utils__["a" /* default */].isOff(attrs[useIconSize])?size:defaultSize;};/**
* Get all icon sizes values for all devices.
*
* This function is added to summarize how we fetch desktop/hover, tablet, and phone icon size
* values. This function still use getIconSize to get device icon size values.
*
* @since 3.23
*
* @param {object} attrs List of all attributes and values.
* @param {string} moduleName Module name.
* @param {string} propertyName Property name.
* @param {boolean} needHover Need hover value status.
*
* @returns {object} Pair of devices and the values.
*/var getIconSizes=function getIconSizes(attrs,moduleName,propertyName){var needHover=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;// Default values.
var values={desktop:'',tablet:'',phone:''};// Ensure attrs (values list) and name (property & module) are not empty.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(attrs)||''===moduleName||''===propertyName){return values;}var isResponsive=isResponsiveEnabled(attrs,propertyName);var isHover=needHover?__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].isHoverMode():false;var desktopValue=getAnyValue(attrs,propertyName);var tabletValue=getAnyValue(attrs,"".concat(propertyName,"_tablet"));var phoneValue=getAnyValue(attrs,"".concat(propertyName,"_phone"));// Get icon size values for each devices.
values.desktop=getIconSize(attrs,moduleName,__WEBPACK_IMPORTED_MODULE_13__hover_options__["a" /* default */].getValueOnHover(propertyName,attrs,desktopValue));values.tablet=isResponsive&&!isHover?getIconSize(attrs,moduleName,tabletValue):'';values.phone=isResponsive&&!isHover?getIconSize(attrs,moduleName,phoneValue):'';return values;};/**
* Get main background value based on enabled status of current field. It's used to selectively
* get the correct color, gradient status, image, and video. It's introduced along with new
* enable fields to decide should we remove or inherit the value from larger device.
*
* @since 3.24.1
* @since 4.5.0 Set default for background color, image, gradient, and video to adapt Global Presets.
*
* @param {object} attrs All module attributes.
* @param {string} baseSetting Setting need to be checked.
* @param {string} mode Current preview mode.
* @param {string} backgroundBase Background base name (background, button_bg, etc.).
* @param {string} moduleName Module name.
* @param {string} value Active value.
* @param {string} defaultValue Active default value.
*
* @returns {object} Pair of new value and default value.
*/ // export const getInheritanceBackgroundValue = (attrs, baseSetting, mode, backgroundBase = 'background', moduleName = '', value = '', defaultValue = '') => {
// // Default new values is same with the generated one.
// const newValues = {
// default: defaultValue,
// value,
// };
//
// // Empty string slug for desktop.
// const mapSlugs = {
// desktop: [''],
// hover: ['__hover', ''],
// sticky: ['__sticky', ''],
// tablet: ['_tablet', ''],
// phone: ['_phone', '_tablet', ''],
// };
//
// // Bail early if setting name is not listed on.
// const enabledFields = [`${backgroundBase}_color`, 'use_background_color_gradient', `${backgroundBase}_use_color_gradient`, `${backgroundBase}_image`, `${backgroundBase}_video_mp4`, `${backgroundBase}_video_webm`, `${backgroundBase}_video_webm`, `__video_${backgroundBase}`];
// if (! includes(enabledFields, baseSetting) || isUndefined(mapSlugs[mode])) {
// return newValues;
// }
//
// // Need to set value and defaultValue for the initial new default and value.
// let newValue = value;
// let newDefault = defaultValue;
// const isGlobalPresetsMode = 'false';
// const fields = ETBuilderComponentDefinitionStore.getComponentFields({
// props: {
// type: moduleName,
// attrs,
// },
// }, isGlobalPresetsMode);
//
// let originMp4Enabled = '';
// let originMp4Data = '';
// let originWebmEnabled = '';
// let originWebmData = '';
//
// forEach(mapSlugs[mode], slug => {
// // Enabled Background Color and Image.
// if (includes([`${backgroundBase}_color`, `${backgroundBase}_image`, `${backgroundBase}_video_mp4`, `${backgroundBase}_video_webm`], baseSetting)) {
// const bgBaseType = baseSetting.replace(`${backgroundBase}_`, '');
// const enableDefault = get(fields, `${backgroundBase}_enable_${bgBaseType}${slug}.default`, '');
// const enableValue = get(attrs, `${backgroundBase}_enable_${bgBaseType}${slug}`, enableDefault);
// const bgDefault = get(fields, `${backgroundBase}_${bgBaseType}${slug}.default`, '');
// const bgValue = get(attrs, `${backgroundBase}_${bgBaseType}${slug}`, bgDefault);
// const isBgEnabled = ! Utils.isOff(enableValue);
//
// if ('' !== bgValue && isBgEnabled) {
// newValue = bgValue;
// newDefault = defaultValue;
// return false;
// } if (! isBgEnabled) {
// newValue = '';
// newDefault = '';
// return false;
// }
//
// // Enabled Background Gradient.
// } else if (includes(['use_background_color_gradient', `${backgroundBase}_use_color_gradient`], baseSetting)) {
// newValue = 'off';
//
// const grdientMap = {
// use_background_color_gradient: {
// value: `use_background_color_gradient${slug}`,
// start: `${backgroundBase}_color_gradient_start${slug}`,
// end: `${backgroundBase}_color_gradient_end${slug}`,
// },
// [`${backgroundBase}_use_color_gradient`]: {
// value: `${backgroundBase}_use_color_gradient${slug}`,
// start: `${backgroundBase}_color_gradient_start${slug}`,
// end: `${backgroundBase}_color_gradient_end${slug}`,
// },
// };
//
// const selectedField = ! isUndefined(grdientMap[baseSetting]) ? grdientMap[baseSetting] : {};
//
// // Enable Gradient Field.
// const useGradientField = get(fields, selectedField.value, {});
// const useGradientDefault = get(useGradientField, 'default', '');
// const useGradientValue = get(attrs, selectedField.value, useGradientDefault);
// const isGradientEnabled = ! Utils.isOff(useGradientValue);
//
// // Gradient Start Color Field.
// const gradientStartField = get(fields, selectedField.start, {});
// const gradientStartDefault = get(gradientStartField, 'default', '');
// const gradientStartValue = get(attrs, selectedField.start, gradientStartDefault);
//
// // Gradient End Color Field.
// const gradientEndField = get(fields, selectedField.end, {});
// const gradientEndDefault = get(gradientEndField, 'default', '');
// const gradientEndValue = get(attrs, selectedField.end, gradientEndDefault);
//
// if (('' !== gradientStartValue || '' !== gradientEndValue) && isGradientEnabled) {
// newValue = 'on';
// return false;
// } if (! isGradientEnabled) {
// newValue = 'off';
// return false;
// }
// } else if (`__video_${backgroundBase}` === baseSetting) {
// const baseSlug = slug.replace(/_/g, '');
// const currentMode = '' !== baseSlug ? baseSlug : 'desktop';
//
// // Video markup.
// const videoBackground = get(attrs, baseSetting, '');
// const videoBackgrounds = ! isObject(videoBackground) ? { desktop: videoBackground } : videoBackground;
// const videoValue = get(videoBackgrounds, currentMode, '');
//
// // MP4.
// const enableMp4Default = get(fields, `${backgroundBase}_enable_video_mp4${slug}.default`, '');
// const enableMp4Value = getAnyValue(attrs, `${backgroundBase}_enable_video_mp4${slug}`, enableMp4Default, true);
// const videoMp4Value = ! includes(['hover', 'sticky'], currentMode) ? getAnyValue(attrs, `${backgroundBase}_video_mp4${slug}`, '', true) : get(attrs, `${backgroundBase}_video_mp4${slug}`, get(attrs, `${backgroundBase}_video_mp4`, ''));
// const isMp4Enabled = ! Utils.isOff(enableMp4Value);
//
// if ('' === originMp4Enabled) {
// if ('' !== videoMp4Value && isMp4Enabled) {
// originMp4Enabled = 'enabled';
// originMp4Data = {
// mode: currentMode,
// videoValue: videoMp4Value,
// videoBackground: videoValue,
// };
// } else if (! isMp4Enabled) {
// originMp4Enabled = 'disabled';
// originMp4Data = {};
// }
// } else if ('enabled' === originMp4Enabled && ! Utils.hasValue(originMp4Data.videoBackground)) {
// originMp4Data.videoBackground = videoValue;
// }
//
// // Webm.
// const enableWebmDefault = get(fields, `${backgroundBase}_enable_video_webm${slug}.default`, '');
// const enableWebmValue = getAnyValue(attrs, `${backgroundBase}_enable_video_webm${slug}`, enableWebmDefault, '');
// const videoWebmValue = ! includes(['hover', 'sticky'], currentMode) ? getAnyValue(attrs, `${backgroundBase}_video_webm${slug}`, '', true) : get(attrs, `${backgroundBase}_video_webm${slug}`, get(attrs, `${backgroundBase}_video_webm`, ''));
// const isWebmEnabled = ! Utils.isOff(enableWebmValue);
//
// if ('' === originWebmEnabled) {
// if ('' !== videoWebmValue && isWebmEnabled) {
// originWebmEnabled = 'enabled';
// originWebmData = {
// mode: currentMode,
// videoValue: videoWebmValue,
// videoBackground: videoValue,
// };
// } else if (! isWebmEnabled) {
// originWebmEnabled = 'disabled';
// originWebmData = {};
// }
// } else if ('enabled' === originWebmEnabled && ! Utils.hasValue(originWebmData.videoBackground)) {
// originWebmData.videoBackground = videoValue;
// }
//
// // Decide to display the video or not.
// if ('' !== slug) {
// return;
// }
//
// if ('disabled' === originMp4Enabled && 'disabled' === originWebmEnabled) {
// newValue = '';
// } else {
// const mp4VideoBackground = get(originMp4Data, 'videoBackground', '');
// const webmVideoBackground = get(originWebmData, 'videoBackground', '');
// newValue = mp4VideoBackground || webmVideoBackground;
// }
// }
// });
//
// return { value: newValue, default: newDefault };
// };
/**
* Generate last edited field name. It contains the field name with last_edited suffix.
*
* @since 3.23
* @since 4.0 Move it to responsive options pure library.
*
* @param {string} name Field name.
* @returns {string} Last edited field name.
*/var getLastEditedFieldName=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getLastEditedFieldName;/**
* Generate last edited string. It contains the last device used and responsive status.
*
* @since 3.23
*
* @param {boolean} status Responsive status.
* @param {string} activeTabMode Current active tab.
* @returns {string} Last edited value.
*/var getLastEditedFieldValue=function getLastEditedFieldValue(status,activeTabMode){var statusString=status?'on':'off';activeTabMode=status?activeTabMode:'desktop';return"".concat(statusString,"|").concat(activeTabMode);};/**
* Generate responsive CSS.
*
* @since 3.23
*
* @param {object} values All values of all devices.
* @param {string | object} selector Main selector.
* @param {object} cssProperty CSS property.
* @param {string} additionalCSS Custom additional CSS if needed.
* @returns {Array} Processed CSS styles.
*/var generateResponsiveCSS=function generateResponsiveCSS(values,selector){var cssProperty=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';var additionalCSS=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'';// Ensure the values exists.
if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(values)){return'';}var deviceList=getDevicesList();// To save all processed styles.
var processedCSS=[];// Print each values.
__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(values,function(value,device){// Ensure device name is valid.
if(!__WEBPACK_IMPORTED_MODULE_4_lodash_includes___default()(deviceList,device)){return;}// Ensure the value is valid.
if(__WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined___default()(value)||__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(value)){return;}// 1. Selector.
// There are some cases where selector is an object contains specific selector for each devices.
var CSSselector=selector;if(__WEBPACK_IMPORTED_MODULE_9_lodash_isObject___default()(selector)){CSSselector=!__WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined___default()(selector[device])&&!__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(selector[device])?selector[device]:'';}if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(CSSselector)){return;}// 2. Append CSS.
// We can set important status from additionalCSS.
var appendCSS=!__WEBPACK_IMPORTED_MODULE_5_lodash_isUndefined___default()(additionalCSS)&&additionalCSS!==''?additionalCSS:';';// 3. Declare CSS style.
// There are some cases before we can declare the CSS style:
// 1. The value is an object contains pair of properties and values.
// 2. The value is single string but we have multiple properties exist.
// 3. The value is single string with only one property.
var declaration='';if(__WEBPACK_IMPORTED_MODULE_9_lodash_isObject___default()(value)){// Allow to use array or object for the pair of properties and values.
__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(value,function(currentValue,currentProperty){if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(currentProperty)||__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(currentValue)){return;}declaration+="".concat(currentProperty,": ").concat(currentValue).concat(appendCSS);});}else if(__WEBPACK_IMPORTED_MODULE_8_lodash_isArray___default()(cssProperty)){// Allow to use multiple properties in array for the same value.
__WEBPACK_IMPORTED_MODULE_0_lodash_forEach___default()(cssProperty,function(currentProperty){if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(currentProperty)){return;}declaration+="".concat(currentProperty,": ").concat(value).concat(appendCSS);});}else if(!__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(cssProperty)){declaration="".concat(cssProperty,": ").concat(value).concat(appendCSS);}if(__WEBPACK_IMPORTED_MODULE_7_lodash_isEmpty___default()(declaration)){return;}var currentCSS={selector:CSSselector,declaration:declaration,device:device};processedCSS.push(currentCSS);});return processedCSS;};/**
* @inheritDoc
*/var getPreviousDevice=__WEBPACK_IMPORTED_MODULE_14__responsive_options_pure__["a" /* default */].getPreviousDevice;/* harmony default export */ __webpack_exports__["a"] = ({isResponsiveEnabled:isResponsiveEnabled,isAnyResponsiveEnabled:isAnyResponsiveEnabled,isMobileSettingsEnabled:isMobileSettingsEnabled,isValueAcceptable:isValueAcceptable,isOrHasValue:isOrHasValue,isMobile:isMobile,isFieldBaseName:isFieldBaseName,hasMobileOptions:hasMobileOptions,getResponsiveStatus:getResponsiveStatus,getValue:getValue,getAnyValue:getAnyValue,getAnyDefinedValue:getAnyDefinedValue,getPropertyValue:getPropertyValue,getPropertyValues:getPropertyValues,getCompositePropertyValue:getCompositePropertyValue,getCompositePropertyValues:getCompositePropertyValues,getAnyResponsiveValues:getAnyResponsiveValues,getDefaultValue:getDefaultValue,getDefaultDefinedValue:getDefaultDefinedValue,getNonEmpty:getNonEmpty,getFieldName:getFieldName,getFieldNames:getFieldNames,getFieldBaseName:getFieldBaseName,getDeviceName:getDeviceName,getActiveSettingName:getActiveSettingName,getInheritedSettingName:getInheritedSettingName,getInitialActiveTabMode:getInitialActiveTabMode,getCalculatedPreviewMode:getCalculatedPreviewMode,getDevicesList:getDevicesList,getModeByWidth:getModeByWidth,getDevicesByLastEdited:getDevicesByLastEdited,getBreakpointByDevice:getBreakpointByDevice,getTabByMode:getTabByMode,getIconSize:getIconSize,getIconSizes:getIconSizes,//getInheritanceBackgroundValue,
getLastEditedFieldName:getLastEditedFieldName,getLastEditedFieldValue:getLastEditedFieldValue,generateResponsiveCSS:generateResponsiveCSS,getPreviousDevice:getPreviousDevice});
/***/ }),
/* 310 */
/*!*****************************************!*\
!*** ./node_modules/lodash/endsWith.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var baseClamp = __webpack_require__(/*! ./_baseClamp */ 311),
baseToString = __webpack_require__(/*! ./_baseToString */ 97),
toInteger = __webpack_require__(/*! ./toInteger */ 7),
toString = __webpack_require__(/*! ./toString */ 17);
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined ? length : baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
module.exports = endsWith;
/***/ }),
/* 311 */
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseClamp.js ***!
\*******************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports) {
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
module.exports = baseClamp;
/***/ }),
/* 312 */
/*!******************************************************!*\
!*** ./includes/module_dependencies/previewModes.js ***!
\******************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(/*! ./utils */ 25);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__et_builder_offsets__ = __webpack_require__(/*! ./et-builder-offsets */ 137);
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JS file) has been modified.
*/ // External Dependencies
/*
import {
easing,
tween,
} from 'popmotion';
import {
assign,
debounce,
find,
forEach,
get,
includes,
intersection,
isEmpty,
isUndefined,
noop,
pick,
} from 'lodash';
*/ // Internal Dependencies
//import ETBuilderStore from '../stores/et-builder-store';
//import ETBuilderBreakpoints from '../constants/et-builder-breakpoints';
/*
import {
getModalPreferredDimensions,
getModalPreferredSnapSettings,
} from '../components/modal/preferences';
const $app_body = Utils.$appWindow('body');
const $app_html = Utils.$appWindow('html');
const $bfb_metabox = Utils.$topWindow('#et_pb_layout');
const $html = Utils.$appWindow('html');
const $publish_metabox = Utils.$topWindow('.submitbox').closest('.postbox');
const $top_body = Utils.$topWindow('body');
const $top_html = Utils.$topWindow('html');
const $post_body = Utils.$topWindow('#post-body');
const isBFB = Utils.condition('is_bfb');
const isTB = Utils.isTB();
const isDBP = Utils.isLimitedMode();
const isRtl = Utils.condition('is_rtl') && ! Utils.condition('is_no_rtl');
const isSafari = Utils.$topWindow('body').hasClass('safari');
const sideLeft = isRtl ? 'right' : 'left';
const sideRight = isRtl ? 'left' : 'right';
const adminMenuWidth = 160;
const adminMenuWidthFolded = 36;
const adminMenuTextWidth = 124;
const isOneColumn = () => $post_body.hasClass('columns-1');
*/var responsive_widths=__WEBPACK_IMPORTED_MODULE_1__et_builder_offsets__["a" /* default */].responsive;var responsive_landscape_widths=__WEBPACK_IMPORTED_MODULE_1__et_builder_offsets__["a" /* default */].responsiveLandscape;/*
let $iframe;
let $iframe_body;
let _instance;
let _pmb_container = false;
let _pmb_container_index = false;
let _scroll_to_focus = false;
*/var ETBuilderPreviewModes=function ETBuilderPreviewModes(){_classCallCheck(this,ETBuilderPreviewModes);Object.defineProperty(this,"getViewModeByWidth",{configurable:true,enumerable:true,writable:true,value:function value(_value){var orientation=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ETBuilderPreviewModes.PORTRAIT;var widths=ETBuilderPreviewModes.LANDSCAPE===orientation?responsive_landscape_widths:responsive_widths;if(_value<=widths.phone){return'phone';}if(_value<=widths.tablet){return'tablet';}return'desktop';}});}/*
handleTopWindowResize = event => {
if (! this.$admin_content || 0 === this.$admin_content.length) {
return;
}
const top_window_width = Utils.$topWindow().width();
if (top_window_width > get(ETBuilderBreakpoints, 'wpAdmin.mobileAdminBar')) {
this.$admin_content.css('margin-left', this.$admin_menu.width());
} else {
this.$admin_content.css('margin-left', '');
}
const post_body_margin_reset = '0px' === $iframe.parents('#post-body').css(`margin-${sideRight}`);
if (this._isBFBMobile() && 'wireframe' === this.current_mode && ! post_body_margin_reset) {
$iframe.parents('#post-body').css(`margin-${sideRight}`, '');
}
};
handleTopDocumentColumnChange = event => {
if ('wireframe' === this.current_mode) {
// If mboxes use 1 column layout, move publish on top
this._repositionPublishMbox(isOneColumn() ? 'top' : 'original');
}
};
handleBFBAdminMenuManuallyFoldedChange = event => {
this.bfbAdminMenuManuallyFolded = Utils.$topWindow('body').hasClass('folded');
$top_body.toggleClass('et-manually-folded', this.bfbAdminMenuManuallyFolded);
};
initialize = preview_mode => {
this.preview_mode = preview_mode;
this._updateDOMForCurrentMode();
// Manually folded state must be checked before activating the preview mode.
if (isBFB) {
this.handleBFBAdminMenuManuallyFoldedChange();
}
// Do not animate (on first load) when 'wireframe' mode and sidebar already collapsed
this.activate(preview_mode, true, true, ! $top_body.hasClass('folded') || preview_mode !== 'wireframe');
if (isBFB) {
if ('wireframe' === preview_mode) {
this.handleTopDocumentColumnChange();
}
Utils.$topWindow().on('resize', this.handleTopWindowResize);
Utils.$topDocument().on('postboxes-columnchange', this.handleTopDocumentColumnChange);
Utils.$topWindow('#collapse-button').on('click', this.handleBFBAdminMenuManuallyFoldedChange);
}
Utils.$appWindow().off('wheel.ETBuilderPreviewModes');
Utils.$topWindow().off('wheel.ETBuilderPreviewModes');
Utils.$appWindow().on('wheel.ETBuilderPreviewModes', this.onWheel);
Utils.$topWindow().on('wheel.ETBuilderPreviewModes', this.onWheel);
return this;
};
static instance(preview_mode) {
if (! _instance) {
_instance = new ETBuilderPreviewModes(preview_mode);
}
return _instance;
}
isAnimating = (early = true) => (early ? this.is_animating : this._is_animating);
modeWidths() {
const windowWidth = Utils.topViewportWidth();
const isModalSnapped = this._isModalSnapped();
const modalPreferredDimensions = getModalPreferredDimensions();
const modalPreferredSnapSetting = getModalPreferredSnapSettings();
const { tablet } = responsive_widths;
const { phone } = responsive_widths;
let wireframe;
let zoom;
let desktop;
let modal = 0;
let scrollbar = 0;
if (isModalSnapped) {
if (includes(['left', 'right'], modalPreferredSnapSetting.snapLocation)) {
modal = modalPreferredDimensions.width;
}
}
if (isTB) {
scrollbar = Utils.maybeGetScrollbarWidth();
}
if (isBFB) {
const isDFM = 'wireframe' !== this.current_mode;
const adminMenu = () => {
if (windowWidth < get(ETBuilderBreakpoints, 'wpAdmin.mobileAdminBar')) {
return 0;
}
if (windowWidth < get(ETBuilderBreakpoints, 'wpAdmin.autoFoldAdminMenu')) {
return adminMenuWidthFolded;
}
return isDFM || this.bfbAdminMenuManuallyFolded ? adminMenuWidthFolded : adminMenuWidth;
};
const margin_padding = isDFM || isModalSnapped || this._isBFBMobile() ? (22 + 20) : (22 + 20 + 22);
const sidebar = isDFM || isModalSnapped || this._isBFBMobile() ? 0 : 278;
wireframe = zoom = desktop = (windowWidth - adminMenu() - margin_padding - sidebar - modal);
} else {
wireframe = zoom = desktop = (windowWidth - modal - scrollbar);
}
return { wireframe, zoom, desktop, tablet, phone, modal };
}
onWheel = event => this._is_using_wheel = true;
*/ /**
* Set the style of the provided element with the option to prevent resize handlers
* from firing on the window.
*
* @since 3.18
*
* @param {jQuery} $container Element for which to set the style.
* @param {object} style Style to set.
* @param {boolean} [final] Enable this to allow resize handlers to fire on the window.
*/ /*
setContainerStyle = ($container, style, final = false) => {
if (! final) {
this.is_animating = this._is_animating = true;
}
$container.css(style);
const breakpoint = 680 + $top_body.find('#adminmenu').width();
$top_body.toggleClass('et-bfb-small-screen', style.width && style.width <= breakpoint);
if (! final) {
this.is_animating = this._is_animating = false;
}
};
waitForAnimation = () => {
if (! this._is_animating) {
return Promise.resolve();
}
return new Promise(resolve => {
const waiting = setInterval(() => {
if (! this._is_animating) {
clearInterval(waiting);
resolve();
}
}, 100);
});
};*/;/* harmony default export */ __webpack_exports__["a"] = (ETBuilderPreviewModes);
/***/ }),
/* 313 */
/*!*****************************************!*\
!*** ./node_modules/lodash/assignIn.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! exports used: default */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 13),
createAssigner = __webpack_require__(/*! ./_createAssigner */ 133),
keysIn = __webpack_require__(/*! ./keysIn */ 75);
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function (object, source) {
copyObject(source, keysIn(source), object);
});
module.exports = assignIn;
/***/ }),
/* 314 */
/*!******************************************************************!*\
!*** ./includes/module_dependencies/et-builder-offsets-const.js ***!
\******************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*/var ETBuilderOffsetsConst={pageSettingsBar:100,responsive:{tablet:768,phone:479},responsiveLandscape:{tablet:980,phone:767},modal:{expanded:1200,footerHeight:40,headerHeight:56,headerDropdownHeight:20,headerDropdownVOffset:23},outerSpacing:200};/* harmony default export */ __webpack_exports__["a"] = (ETBuilderOffsetsConst);
/***/ }),
/* 315 */
/*!************************************************************************!*\
!*** ./includes/modules/TestifyCarouselChild/TestifyCarouselChild.jsx ***!
\************************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}// External Dependencies
var TestifyCarouselChild=/*#__PURE__*/function(_Component){_inherits(TestifyCarouselChild,_Component);function TestifyCarouselChild(){_classCallCheck(this,TestifyCarouselChild);return _possibleConstructorReturn(this,(TestifyCarouselChild.__proto__||Object.getPrototypeOf(TestifyCarouselChild)).apply(this,arguments));}_createClass(TestifyCarouselChild,[{key:"render",value:function render(){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{key:this.props.moduleInfo.order,className:"testify_item"},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("h1",null,this.props.item));}}],[{key:"css",value:function css(props){var additionalCss=[];return additionalCss;}}]);return TestifyCarouselChild;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);Object.defineProperty(TestifyCarouselChild,"slug",{configurable:true,enumerable:true,writable:true,value:'testify_carousel_child'});/* harmony default export */ __webpack_exports__["a"] = (TestifyCarouselChild);
/***/ }),
/* 316 */
/*!**********************************!*\
!*** ./includes/fields/index.js ***!
\**********************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ValueMapper_ValueMapper__ = __webpack_require__(/*! ./ValueMapper/ValueMapper */ 317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__PositionAbsolute_PositionAbsolute__ = __webpack_require__(/*! ./PositionAbsolute/PositionAbsolute */ 318);
/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt.
*//* harmony default export */ __webpack_exports__["a"] = ([__WEBPACK_IMPORTED_MODULE_0__ValueMapper_ValueMapper__["a" /* default */],__WEBPACK_IMPORTED_MODULE_1__PositionAbsolute_PositionAbsolute__["a" /* default */]]);
/***/ }),
/* 317 */
/*!*****************************************************!*\
!*** ./includes/fields/ValueMapper/ValueMapper.jsx ***!
\*****************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__style_css__ = __webpack_require__(/*! ./style.css */ 81);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__style_css__);
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to files in the scripts/ directory, the license.txt file is located at ../license.txt.
This file (or the corresponding source JSX file) has been modified.
*/ // External Dependencies
// Internal Dependencies
var Testify_Carousel_Value_Mapper=/*#__PURE__*/function(_Component){_inherits(Testify_Carousel_Value_Mapper,_Component);function Testify_Carousel_Value_Mapper(){_classCallCheck(this,Testify_Carousel_Value_Mapper);return _possibleConstructorReturn(this,(Testify_Carousel_Value_Mapper.__proto__||Object.getPrototypeOf(Testify_Carousel_Value_Mapper)).apply(this,arguments));}_createClass(Testify_Carousel_Value_Mapper,[{key:"maybeUpdateValue",value:function maybeUpdateValue(){var sourceField=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(this.props.fieldDefinition,'sourceField',null);var valueMap=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(this.props.fieldDefinition,'valueMap',null);if(sourceField!==null&&valueMap!==null){var sourceFieldValue=__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(this.props.moduleSettings,sourceField,null);var value=sourceFieldValue===null?'':__WEBPACK_IMPORTED_MODULE_1_lodash_get___default()(valueMap,sourceFieldValue,'');if(value!==this.props.value){this.props._onChange(this.props.name,value);}}}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(){return true;}},{key:"componentDidMount",value:function componentDidMount(){this.maybeUpdateValue();}},{key:"componentDidUpdate",value:function componentDidUpdate(){this.maybeUpdateValue();}},{key:"render",value:function render(){return'';}}]);return Testify_Carousel_Value_Mapper;}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);Object.defineProperty(Testify_Carousel_Value_Mapper,"slug",{configurable:true,enumerable:true,writable:true,value:'testify_carousel_value_mapper'});/* harmony default export */ __webpack_exports__["a"] = (Testify_Carousel_Value_Mapper);
/***/ }),
/* 318 */
/*!***************************************************************!*\
!*** ./includes/fields/PositionAbsolute/PositionAbsolute.jsx ***!
\***************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(/*! react */ 9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_includes__ = __webpack_require__(/*! lodash/includes */ 30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_includes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_includes__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get__ = __webpack_require__(/*! lodash/get */ 8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_noop__ = __webpack_require__(/*! lodash/noop */ 105);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_noop___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_noop__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isEmpty__ = __webpack_require__(/*! lodash/isEmpty */ 10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isEmpty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isEmpty__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__style_css__ = __webpack_require__(/*! ./style.css */ 82);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__style_css__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__module_dependencies_utils_js__ = __webpack_require__(/*! ../../module_dependencies/utils.js */ 25);
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}/*! @license
See the license.txt file for licensing information for third-party code that may be used in this file.
Relative to file(s) in the scripts/ directory, the license.txt file is located at ../license.txt..
*/ /* eslint key-spacing: ["error", { "align": "colon" }] */ /* eslint max-len: ["error", { "code": 250 }] */ /* eslint no-return-assign: ["off"] */ /* eslint no-multi-spaces: ["off"] */ /* eslint import/no-named-as-default-member: ["off"] */ /* eslint react/forbid-prop-types: ["off"] */ /* eslint key-spacing: ["off"] */ /* eslint jsx-a11y/no-static-element-interactions: ["off"] */ /* eslint yoda: ["error", "always", { "onlyEquality": true }] */ /* eslint no-underscore-dangle: ["off"] */ // External dependencies
// Internal dependencies
var colors={selectPositionGray:'#E6ECF2'};var base='dstc-settings-position';var getTypeArray=function getTypeArray(event){return __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(event,'currentTarget.dataset.origin_type','top_left').split('_');};var Testify_Carousel_PositionAbsolute=/*#__PURE__*/function(_React$Component){_inherits(Testify_Carousel_PositionAbsolute,_React$Component);// noinspection JSUnresolvedVariable
function Testify_Carousel_PositionAbsolute(props){var _this;_classCallCheck(this,Testify_Carousel_PositionAbsolute);_this=_possibleConstructorReturn(this,(Testify_Carousel_PositionAbsolute.__proto__||Object.getPrototypeOf(Testify_Carousel_PositionAbsolute)).call(this,props));Object.defineProperty(_assertThisInitialized(_this),"state",{configurable:true,enumerable:true,writable:true,value:{value:_this.props.value||_this.props.default}});Object.defineProperty(_assertThisInitialized(_this),"handleButtonOnClick",{configurable:true,enumerable:true,writable:true,value:function value(event){var typeArray=getTypeArray(event);var value=typeArray.join('_');if(!__WEBPACK_IMPORTED_MODULE_4_lodash_isEmpty___default()(_this.hRuler.current)){if('center'===typeArray[0]){_this.hRuler.current.style.backgroundColor=colors.selectPositionGray;}else{_this.hRuler.current.style.backgroundColor='transparent';}if('center'===typeArray[1]){_this.vRuler.current.style.backgroundColor=colors.selectPositionGray;}else{_this.vRuler.current.style.backgroundColor='transparent';}}_this.props._onChange(_this.props.name,value);_this.setState({value:value});}});Object.defineProperty(_assertThisInitialized(_this),"handleButtonOnMouseEnter",{configurable:true,enumerable:true,writable:true,value:function value(event){var typeArray=getTypeArray(event);if('center'===typeArray[0]){_this.hRuler.current.style.backgroundColor=colors.selectPositionGray;}if('center'===typeArray[1]){_this.vRuler.current.style.backgroundColor=colors.selectPositionGray;}}});Object.defineProperty(_assertThisInitialized(_this),"handleButtonOnMouseLeave",{configurable:true,enumerable:true,writable:true,value:function value(event){var typeArray=getTypeArray(event);var value=_this.state.value.split('_');if('center'===typeArray[0]&&'center'!==value[0]){_this.hRuler.current.style.backgroundColor='transparent';}if('center'===typeArray[1]&&'center'!==value[1]){_this.vRuler.current.style.backgroundColor='transparent';}}});_this.hRuler=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createRef();_this.vRuler=__WEBPACK_IMPORTED_MODULE_0_react___default.a.createRef();return _this;}_createClass(Testify_Carousel_PositionAbsolute,[{key:"shouldComponentUpdate",value:function shouldComponentUpdate(nextProps,nextState){return __WEBPACK_IMPORTED_MODULE_6__module_dependencies_utils_js__["a" /* default */].shouldComponentUpdate(this,nextProps,nextState);}},{key:"getButtonClass",value:function getButtonClass(value){return value===this.state.value?"".concat(base,"-button-active"):"".concat(base,"-button");}},{key:"renderButton",value:function renderButton(){var type=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';if(''!==type){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(this.getButtonClass(type)," ").concat(base,"-absolute"),"data-origin_type":type,onMouseDown:this.handleButtonOnClick,onMouseEnter:this.handleButtonOnMouseEnter,onMouseLeave:this.handleButtonOnMouseLeave});}return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-button-guide ").concat(base,"-absolute")});}},{key:"render",value:function render(){var valueArray=this.state.value.split('_');var hRulerBackground='transparent';var vRulerBackground='transparent';if('center'===valueArray[0]){hRulerBackground=colors.selectPositionGray;}if('center'===valueArray[1]){vRulerBackground=colors.selectPositionGray;}return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{id:"".concat(base,"-container"),className:"".concat(base,"-container")},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-hr"),ref:this.hRuler,style:{backgroundColor:hRulerBackground}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-vr"),ref:this.vRuler,style:{backgroundColor:vRulerBackground}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-guide ").concat(base,"-absolute")},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-top")},this.renderButton(),this.renderButton(),this.renderButton()),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-mid")},this.renderButton(),this.renderButton(),this.renderButton()),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-bottom")},this.renderButton(),this.renderButton(),this.renderButton())),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-frame ").concat(base,"-absolute")}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-guide ").concat(base,"-absolute")},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-top")},this.renderButton('top_left'),this.renderButton('top_center'),this.renderButton('top_right')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-mid")},this.renderButton('center_left'),this.renderButton('center_center'),this.renderButton('center_right')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div",{className:"".concat(base,"-control-inner-bottom")},this.renderButton('bottom_left'),this.renderButton('bottom_center'),this.renderButton('bottom_right'))));}}]);return Testify_Carousel_PositionAbsolute;}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);Object.defineProperty(Testify_Carousel_PositionAbsolute,"slug",{configurable:true,enumerable:true,writable:true,value:'dstc_absolute_position'});Object.defineProperty(Testify_Carousel_PositionAbsolute,"defaultProps",{configurable:true,enumerable:true,writable:true,value:{default:'top_left',name:'position',value:'top_left',_onChange:__WEBPACK_IMPORTED_MODULE_3_lodash_noop___default.a,readonly:false}});/* harmony default export */ __webpack_exports__["a"] = (Testify_Carousel_PositionAbsolute);
/***/ })
/******/ ]);