/******/ (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;
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/ // 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 = 178);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (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 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(49);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
/**
* 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 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(84),
getValue = __webpack_require__(118);
/**
* 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;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(29),
isLength = __webpack_require__(30);
/**
* 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;
/***/ }),
/* 5 */
/***/ (function(module, exports) {
/**
* 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;
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_indexOf__ = __webpack_require__(163);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_indexOf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash_indexOf__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_merge__ = __webpack_require__(167);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_merge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_merge__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_map__);
class JSHelper {
static cloneObject(object) {
return JSON.parse(JSON.stringify(object));
}
static objectToArray(anObject) {
let anArray = [];
for (let i in anObject) {
anArray.push(anObject[i]);
}
return anArray;
}
static withoutKeys(object, keysArray, copyObject = true) {
if (copyObject) {
object = this.cloneObject(object);
}
__WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(keysArray, key => delete object[key]);
return object;
}
static mergeObjects(object1, object2) {
if(object1 === null) {
return object2;
}
if(object2 === null) {
return object1;
}
for (prop in object2) {
object1[prop] = object2[prop];
}
return object1;
}
static inArray(haystack, needle, useWildCard = false) {
if (useWildCard) {
for (let i=0; i<haystack.length; i++) {
if (needle.search(new RegExp('^'+haystack[i].replace('*','.*')+'$')) !== -1) {
return true;
}
}
} else {
return __WEBPACK_IMPORTED_MODULE_0_lodash_indexOf___default()(haystack, needle) !== -1;
}
return false;
}
static find(haystack, needle) {
let i = __WEBPACK_IMPORTED_MODULE_0_lodash_indexOf___default()(haystack, needle);
if (i > -1) {
return haystack[i];
}
return false;
}
static get(url, credentials = false, customSettings = {}) {
let settings = {
method: 'get',
headers: {
'Accept': 'application/json',
},
};
if (credentials) {
settings.credentials = 'include';
}
return fetch(url, __WEBPACK_IMPORTED_MODULE_1_lodash_merge___default()(settings, customSettings))
.then(this.checkStatus)
.then(this.parseJSON);
}
static fetch(url, settings) {
return fetch(url, settings).then(this.checkStatus);
}
static post(url, body, credentials = false, customSettings = {}) {
let settings = {
method: 'post',
headers: {
'Accept': 'application/json',
},
body: JSON.stringify(body),
dataType: 'json',
};
if (credentials) {
settings.credentials = 'include';
}
return fetch(url, __WEBPACK_IMPORTED_MODULE_1_lodash_merge___default()(settings, customSettings))
.then(this.checkStatus)
.then(this.parseJSON);
}
static checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
}
}
static parseJSON(response) {
return response.json()
}
static loadCSS(url) {
let link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = url;
document.getElementsByTagName('head')[0].appendChild(link);
}
static objectValues(obj) {
let values = [];
for (let key in obj) {
if(obj.hasOwnProperty(key)) {
values.push(obj[key]);
}
}
return values;
}
static type(thing) {
return Object.prototype.toString.call(thing).slice(8, -1).toLowerCase();
}
static time() {
return Math.round((new Date()).getTime() / 1000);
}
static objGet(obj, objectStringOrArray) {
if (typeof objectStringOrArray === 'string') {
objectStringOrArray = objectStringOrArray.split('.');
}
return typeof obj !== 'undefined' && objectStringOrArray.length > 0
? this.objGet(obj[objectStringOrArray.shift()], objectStringOrArray)
: obj;
}
static objSet(obj, objectStringOrArray, setTo, overwrite = true) {
if (typeof objectStringOrArray === 'string') {
objectStringOrArray = objectStringOrArray.split('.');
}
let current = objectStringOrArray.shift();
if (objectStringOrArray.length > 0) {
obj[current] = typeof obj[current] === 'undefined' ? {} : obj[current];
this.objSet(obj[current], objectStringOrArray, setTo, overwrite);
} else {
if (overwrite) {
obj[current] = setTo;
} else {
obj[current] = typeof obj[current] === 'undefined' ? setTo : obj[current];
}
}
}
static objCall(obj, objectString, args = [], context = this) {
let fn = this.objGet(obj, objectString);
if (typeof fn === 'function') {
return fn.apply(context, args);
}
return undefined;
}
static objPush(obj, objectString, thing) {
let arrayInObj = this.objGet(obj, objectString);
if (typeof arrayInObj !== 'undefined') {
return arrayInObj.push(thing);
}
return undefined;
}
static windowGet(objectString) {
return this.objGet(window, objectString);
}
static windowSet(objectString, setTo, overwrite = true) {
this.objSet(window, objectString, setTo, overwrite);
}
static windowCall(objectString, args = [], context = this) {
return this.objCall(window, objectString, args, context);
}
static windowPush(objectString, thing) {
return this.objPush(window, objectString, thing);
}
}
/* harmony default export */ __webpack_exports__["default"] = JSHelper;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(10),
getRawTag = __webpack_require__(115),
objectToString = __webpack_require__(143);
/** `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;
/***/ }),
/* 8 */
/***/ (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;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(128),
listCacheDelete = __webpack_require__(129),
listCacheGet = __webpack_require__(130),
listCacheHas = __webpack_require__(131),
listCacheSet = __webpack_require__(132);
/**
* 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;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(1);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(8);
/**
* 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;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(89),
baseMatchesProperty = __webpack_require__(90),
identity = __webpack_require__(26),
isArray = __webpack_require__(0),
property = __webpack_require__(168);
/**
* 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;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(126);
/**
* 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;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(16);
/** 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;
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(7),
isObjectLike = __webpack_require__(5);
/** `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;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(38),
baseKeys = __webpack_require__(86),
isArrayLike = __webpack_require__(4);
/**
* 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;
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(171);
/**
* 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;
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3),
root = __webpack_require__(1);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(133),
mapCacheDelete = __webpack_require__(134),
mapCacheGet = __webpack_require__(135),
mapCacheHas = __webpack_require__(136),
mapCacheSet = __webpack_require__(137);
/**
* 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;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(9),
stackClear = __webpack_require__(150),
stackDelete = __webpack_require__(151),
stackGet = __webpack_require__(152),
stackHas = __webpack_require__(153),
stackSet = __webpack_require__(154);
/**
* 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;
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(47);
/**
* 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;
/***/ }),
/* 23 */
/***/ (function(module, exports) {
/** 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) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(0),
isSymbol = __webpack_require__(16);
/** 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;
/***/ }),
/* 25 */
/***/ (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;
/***/ }),
/* 26 */
/***/ (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;
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(80),
isObjectLike = __webpack_require__(5);
/** 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 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(1),
stubFalse = __webpack_require__(170);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* 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__(33)(module)))
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(7),
isObject = __webpack_require__(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;
/***/ }),
/* 30 */
/***/ (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;
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(85),
baseUnary = __webpack_require__(99),
nodeUtil = __webpack_require__(142);
/* 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;
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(39),
baseIteratee = __webpack_require__(12),
baseMap = __webpack_require__(88),
isArray = __webpack_require__(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;
/***/ }),
/* 33 */
/***/ (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() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__JSHelper__ = __webpack_require__(6);
class DOMHelper {
static getParentElementsByClassName(className) {
let parentElements = [];
let childElements = document.getElementsByClassName(className);
for(let i=0; i<childElements.length; i++) {
parentElements.push( childElements[i].parentNode );
}
return parentElements;
}
static getWrappingElement(html) {
let tmpDOM = document.createElement('div');
tmpDOM.innerHTML = html;
return tmpDOM.firstChild;
}
static hasClass(element, className) {
if (element.classList) {
return element.classList.contains(className);
} else {
return !!element.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
}
}
static addClass(element, className) {
if (element.classList) {
element.classList.add(className);
} else if (!this.hasClass(className)) {
element.className += ' ' + className;
}
}
static removeClass(element, className) {
if (element.classList) {
element.classList.remove(className);
} else if (this.hasClass(className)) {
var reg = new RegExp('(\\s|^)' + className + '(\\s|$)')
element.className = element.className.replace(reg, ' ');
}
}
static hide(element) {
element.style.display = 'none';
}
static empty(element) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
static data(element, key, value) {
if (typeof value === 'undefined') {
return this.getData(element, key);
} else {
return this.setData(element, key, value);
}
}
static getData(element, key) {
let data = element.getAttribute('data-' + key);
if (data === null) {
return undefined;
}
let dataInt = parseInt(data);
if (!isNaN(dataInt)) {
return dataInt;
}
return data;
}
static setData(element, key, value) {
if (typeof element.dataset !== 'undefined') {
key = key.replace(/-([a-z])/g, (i) => i[1].toUpperCase() );
return element.dataset[key] = value;
} else {
return element.setAttribute('data-' + key, value);
}
}
static removeData(element, key) {
if (typeof element.dataset !== 'undefined') {
key = key.replace(/-([a-z])/g, (i) => i[1].toUpperCase() );
if (typeof element.dataset[key] !== 'undefined') {
delete element.dataset[key];
}
} else {
return element.removeAttribute('data-' + key);
}
}
static createElement(tag, attributes = null) {
let element = document.createElement(tag);
if(attributes === null) {
return element;
}
for (let attr in attributes) {
let data = attributes[attr];
switch(attr) {
case 'innerHTML':
element.innerHTML = data;
break;
case 'text':
element.appendChild(document.createTextNode(data));
break;
case 'click':
case 'onClick':
element.addEventListener('click', data);
break;
case 'appendChild':
element.appendChild(data);
break;
case 'appendChildren':
for (let i=0; i<data.length; i++) {
element.appendChild(data[i]);
}
break;
default:
element[attr] = data;
}
}
return element;
}
static replaceElement(oldEle, newEle) {
oldEle.parentNode.insertBefore(newEle, oldEle);
return oldEle.parentNode.removeChild(oldEle);
}
static trigger(eventType, element) {
if (document.createEventObject) { // IE
let evt = document.createEventObject();
return element.fireEvent('on' + eventType, evt)
} else {
let evt = document.createEvent('HTMLEvents');
evt.initEvent(eventType, true, true);
return !element.dispatchEvent(evt);
}
}
static innerHTML(ele, html) {
if (typeof ele !== 'undefined') {
let eletype = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].type(ele);
if (eletype === 'array' || eletype === 'htmlcollection') {
for (let i=0; i<ele.length; i++) {
ele[i].innerHTML = html;
}
} else {
ele.innerHTML = html;
}
}
}
static stop() {
if(typeof window.stop === 'function') {
window.stop();
} else {
document.execCommand('Stop');
}
}
static remove(element) {
let parent = element.parentNode;
if (parent) {
return parent.removeChild(element);
}
return false;
}
static reload() {
window.location.reload();
}
static highlight(element, color = '#F00') {
element.style.border = '2px solid ' + color;
}
static getSelfOrFirstParentWithClass(element, className) {
if (this.hasClass(element, className)) {
return element;
}
return this.getFirstParentWithClass(element, className);
}
static getFirstParentWithClass(element, className) {
let parent = element.parentElement;
if (parent) {
if (this.hasClass(parent, className)) {
return parent;
} else {
return this.getFirstParentWithClass(parent, className);
}
}
return false;
}
static addCSS(cssRule, index = 0) {
let sheet = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('BOLD.common.injected_stylesheet');
if (typeof sheet === 'undefined') {
let styleElement = document.createElement('style');
styleElement.appendChild(document.createTextNode('')); // webkit fix
document.head.appendChild(styleElement);
sheet = styleElement.sheet;
__WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowSet('BOLD.common.injected_stylesheet', sheet);
}
sheet.insertRule(cssRule, index);
}
static removeCSS(index) {
let sheet = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('BOLD.common.injected_stylesheet');
if (typeof sheet !== 'undefined') {
sheet.deleteRule(index);
}
}
static removeClickEvent(element){
if (typeof jQuery !== 'undefined') {
typeof jQuery().unbind !== 'undefined' && jQuery(element).unbind('click');
typeof jQuery().off !== 'undefined' && jQuery(element).off('click');
}
if (typeof element.removeAttribute === 'function') {
element.removeAttribute('onclick');
}
if (typeof element.onclick !== 'undefined') {
element.onclick = null;
}
}
}
/* harmony default export */ __webpack_exports__["a"] = DOMHelper;
/***/ }),
/* 35 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__JSHelper__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_find__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_find___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_find__);
class ShopifyHelper {
static whatPageAmIOn() {
if(typeof window.BOLD.common !== 'undefined' && typeof window.BOLD.common.template === 'string') {
return window.BOLD.common.template;
}
let path = this.getUrlPath();
if(path[1] === '') {
return 'index';
}
if(path[1] === 'cart') {
return 'cart';
}
if((path[2] === 'orders' || path[2] === 'checkouts') && ShopifyHelper.getBaseUrl() === 'https://checkout.shopify.com'){
return 'thankyou';
}
if(typeof path[path.length-2] !== 'undefined' && path[path.length-2] === 'products') {
return 'product';
}
return 'other';
}
static onPage(page) {
return this.whatPageAmIOn() === page;
}
static getProductId(variant_id) {
if(typeof window.BOLD.common.Shopify.variants[variant_id] !== 'undefined') {
return window.BOLD.common.Shopify.variants[variant_id].product_id;
}
return false;
}
static getProductIdByHandle(handle) {
if (typeof window.BOLD.common.Shopify.products[handle] !== 'undefined') {
return window.BOLD.common.Shopify.products[handle].id;
}
return false;
}
static getShopUrl() {
return window.BOLD.common.Shopify.shop.permanent_domain;
}
static getUrlPath() {
let rawPath = window.location.pathname;
return rawPath.split("/");
}
static getBaseUrl() {
if (typeof window.location.origin === 'undefined') {
return window.location.href.match(/https?:\/\/[^\/]+/gi);
}
return window.location.origin;
}
static getProductHandle() {
if (this.whatPageAmIOn() === 'product') {
let path = this.getUrlPath();
let productPosInUrl = path.indexOf('products');
if (productPosInUrl > -1 && typeof path[productPosInUrl + 1] !== 'undefined') {
return path[productPosInUrl + 1];
}
}
return false;
}
static getCurrLocation() {
return window.location.pathname;
}
static isNoDecimals() {
return window.BOLD.common.Shopify.shop.money_format.indexOf('no_decimals') > -1;
}
static displayMoney(money, moneyFormat = null) {
if (typeof window.Currency !== 'undefined') {
[ money, moneyFormat ] = this.convertCurrencyFormat(money, moneyFormat);
}
return this.formatMoney(money, moneyFormat);
}
static formatMoney(money, moneyFormat = null) {
let formattedMoney;
if(moneyFormat === null) {
moneyFormat = window.BOLD.common.Shopify.shop.money_format;
}
if (typeof __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('Currency.formatMoney') === 'function') {
formattedMoney = window.Currency.formatMoney(money, moneyFormat);
} else if(typeof __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('Shopify.formatMoney') === 'function') {
formattedMoney = window.Shopify.formatMoney(money, moneyFormat);
} else if(typeof __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('theme.Currency.formatMoney') === 'function') {
formattedMoney = window.theme.Currency.formatMoney(money, moneyFormat);
} else if(typeof window.BOLD.common.Shopify.formatMoney === 'function') {
formattedMoney = window.BOLD.common.Shopify.formatMoney(money, moneyFormat);
} else {
formattedMoney = '$'+(money/100).toFixed(2);
}
return formattedMoney;
}
static convertCurrencyFormat(money, moneyFormat) {
let currentCurrency = window.Currency.currentCurrency;
if (typeof __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('Currency.convert') === 'function' && typeof currentCurrency === 'string') {
let newMoney = window.Currency.convert(money, window.BOLD.common.Shopify.shop.currency, currentCurrency);
let newMoneyFormat;
if (typeof window.Currency.money_format !== 'undefined') {
newMoneyFormat = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet(`Currency.${window.Currency.format}.${currentCurrency}`);
} else if (typeof window.Currency.moneyFormats !== 'undefined') {
newMoneyFormat = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet(`Currency.moneyFormats.${currentCurrency}.${window.Currency.format}`);
}
if (typeof newMoney !== 'undefined' && typeof newMoneyFormat === 'string') {
money = newMoney;
moneyFormat = `<span class=money>${newMoneyFormat}</span>`
}
}
return [ money, moneyFormat ];
}
static findForm() {
if (document.getElementsByName("id").length > 0) {
return this.findFormFromChild(document.getElementsByName("id")[0]);
}
if (document.getElementsByName("id[]").length > 0) {
return this.findFormFromChild(document.getElementsByName("id")[0]);
}
return false;
}
static getAddProductButtons(form) {
let addProductButtons = form.querySelectorAll('[type=submit],.addtocart');
if (addProductButtons.length === 0) {
let possibleIdentifiers = [
'[name=add]',
'.addToCart',
'.add',
'.ADDTOCART',
'.AddToCart',
'.add_to_cart',
'.add-to-cart',
'.Add-To-Cart',
'#AddToCart',
];
addProductButtons = form.querySelectorAll(possibleIdentifiers.join(','));
}
return addProductButtons;
}
static findFormFromChild(el) {
if (el.parentNode === null || el.parentNode.nodeName === null) {
return false;
}
if (el.parentNode.nodeName == 'FORM') {
return el.parentNode;
} else {
return this.findFormFromChild(el.parentNode);
}
}
static getCart() {
return __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].get('/cart.json', true);
}
static getVariant(productHandle, variantId, makeNewRequest = false) {
return this.getProduct(productHandle, makeNewRequest).then((product) => {
if (typeof product.variants !== 'undefined') {
return __WEBPACK_IMPORTED_MODULE_1_lodash_find___default()(product.variants, v => v.id === variantId);
} else {
throw new Error('Variant not found.');
}
});
}
static getProduct(productHandle, makeNewRequest = false) {
let productRequest = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowGet('BOLD.common.Shopify.products.'+productHandle+'.request');
if (makeNewRequest || typeof productRequest === 'undefined') {
productRequest = __WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].get(this.getBaseUrl() + '/products/' + productHandle + '.json', true);
__WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowSet('BOLD.common.Shopify.products.'+productHandle+'.request', productRequest);
}
return productRequest.then((resp) => {
if (typeof resp.product !== 'undefined') {
resp.product.request = productRequest;
__WEBPACK_IMPORTED_MODULE_0__JSHelper__["default"].windowSet('BOLD.common.Shopify.products.'+productHandle, resp.product);
return resp.product;
} else {
var error = new Error('Product not found.');
error.response = resp;
throw error;
}
});
}
static cartChange(line, quantity, properties = null) {
let params = {
line: line,
quantity: quantity,
};
if (properties !== null) {
params.properties = properties;
}
return fetch('/cart/change.js', {
method: 'post',
body: JSON.stringify(params),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
credentials: 'include',
}).then(this.checkStatus).then(this.parseJSON);
}
static cartAdd(id, quantity, properties = null) {
let params = {
id: id,
quantity: quantity,
};
if (properties !== null) {
params.properties = properties;
}
return fetch('/cart/add.js', {
method: 'post',
body: JSON.stringify(params),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
credentials: 'include',
}).then(this.checkStatus).then(this.parseJSON);
}
static cartUpdate(updates) {
return fetch('/cart/update.js', {
method: 'post',
body: JSON.stringify({
updates: updates,
}),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
credentials: 'include',
}).then(this.checkStatus).then(this.parseJSON);
}
}
/* harmony default export */ __webpack_exports__["a"] = ShopifyHelper;
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(1);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/* 37 */
/***/ (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;
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(97),
isArguments = __webpack_require__(27),
isArray = __webpack_require__(0),
isBuffer = __webpack_require__(28),
isIndex = __webpack_require__(23),
isTypedArray = __webpack_require__(31);
/** 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;
/***/ }),
/* 39 */
/***/ (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;
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(22),
eq = __webpack_require__(8);
/**
* 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);
}
}
module.exports = assignMergeValue;
/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(76),
createBaseEach = __webpack_require__(108);
/**
* 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;
/***/ }),
/* 42 */
/***/ (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;
/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(109);
/**
* 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;
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(46),
toKey = __webpack_require__(15);
/**
* 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;
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(81),
isObjectLike = __webpack_require__(5);
/**
* 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;
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(0),
isKey = __webpack_require__(24),
stringToPath = __webpack_require__(156),
toString = __webpack_require__(175);
/**
* 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;
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(66),
arraySome = __webpack_require__(70),
cacheHas = __webpack_require__(100);
/** 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;
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(177)))
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(54);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(8),
isArrayLike = __webpack_require__(4),
isIndex = __webpack_require__(23),
isObject = __webpack_require__(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;
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(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;
/***/ }),
/* 53 */
/***/ (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;
/***/ }),
/* 54 */
/***/ (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;
/***/ }),
/* 55 */
/***/ (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;
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(110),
findIndex = __webpack_require__(160);
/**
* 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;
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(38),
baseKeysIn = __webpack_require__(87),
isArrayLike = __webpack_require__(4);
/**
* 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;
/***/ }),
/* 58 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__BoldEventEmitter__ = __webpack_require__(60);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_mustache__ = __webpack_require__(176);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_mustache___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_mustache__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash_map__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_find__ = __webpack_require__(56);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash_find___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash_find__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_filter__ = __webpack_require__(159);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_filter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_filter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_fill__ = __webpack_require__(158);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash_fill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash_fill__);
class BoldCartDoctor {
constructor(rawCart, addShadowVariantsToNewCart = false) {
this.rawCart = rawCart;
this.cart = null;
this.ee = new __WEBPACK_IMPORTED_MODULE_3__BoldEventEmitter__["a" /* default */]('cart', 'COMMON');
this.addShadowVariantsToNewCart = addShadowVariantsToNewCart;
this.shadowVariants = {}; // all variants in the cart by id (standard and onetime)
this.shadowVariantsByLine = {}; // standard variants by line item
this.shadowVariantsOneTime = []; // one time variants
this.totalAdditions = {
byLine: {},
cart: 0,
cartWithoutOneTime: 0,
oneTime: 0
};
this.cartHookClasses = {
// these are the classes used by "cart hook" elements added by the robo installer
properties: 'bold_cart_item_properties',
price: 'bold_cart_item_price',
total: 'bold_cart_item_total',
cartTotal: 'bold_cart_total',
};
this.manualPropertiesClass = 'bold_load_cart_item_properties'; // line item properties will be loaded into elements with this class
this.variantTotalsDisplayClass = 'bold_option_variant_totals'; // "one time" variant prices will be displayed in elements with this class
// any bold properties that aren't underscored
this.boldProperties = [
'master_builder',
'builder_id',
'builder_info',
'frequency_type',
'frequency_type_text',
'frequency_num',
'group_id',
'discounted_price',
'total_recurrences',
];
// properties that should always be transferred to shadow variants
this.transferProperties = [
'_ro_discount_percentage',
'frequency_num',
'frequency_type',
'frequency_type_text',
'group_id',
'total_recurrences',
'_boldBuilderId',
];
this.expandCart();
this.ee.on('refresh', evt => this.refresh(evt.data));
__WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].whatPageAmIOn() === 'cart' && this.getCartCount() > 0 && this.ee.onDomLoaded(this.updateCart, this);
}
refresh(rawCart) {
if (typeof rawCart !== 'undefined' && rawCart.total_price !== 'undefined' && !this.isFixed(rawCart)) {
this.rawCart = rawCart;
this.cart = null;
this.shadowVariants = {};
this.shadowVariantsByLine = {};
this.shadowVariantsOneTime = [];
this.expandCart();
} else {
__WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].getCart().then((cart) => {
this.refresh(cart);
});
}
}
getCart() {
return this.cart;
}
getItem(lineIndex) {
if (typeof this.cart.items[lineIndex] !== 'undefined') {
return this.cart.items[lineIndex];
}
return false;
}
getShadowVariants() {
return this.shadowVariants;
}
getShadowVariantsByLine(lineIndex) {
if (typeof this.shadowVariantsByLine[lineIndex] !== 'undefined') {
return this.shadowVariantsByLine[lineIndex];
}
return [];
}
getShadowVariantById(variantId) {
return __WEBPACK_IMPORTED_MODULE_6_lodash_find___default()(this.shadowVariants, v => v.variant_id === variantId);
}
getVariantQuantity(variantId) {
let variant = this.getShadowVariantById(variantId);
if (typeof variant !== 'undefined') {
return variant.quantity;
}
return 0;
}
getOneTimeShadowVariants() {
return this.shadowVariantsOneTime;
}
getRawCartCount() {
return this.rawCart.items.length;
}
getCartCount() {
return this.cart.items.length;
}
getToken() {
return this.cart.token;
}
getPriceAdditionByLine(lineIndex) {
if (typeof this.totalAdditions.byLine[lineIndex] !== 'undefined') {
return this.totalAdditions.byLine[lineIndex].price;
}
return false;
}
getTotalAdditionByLine(lineIndex) {
if (typeof this.totalAdditions.byLine[lineIndex] !== 'undefined') {
return this.totalAdditions.byLine[lineIndex].total;
}
return false;
}
getPriceByLine(lineIndex) {
if (typeof this.cart.items[lineIndex] !== 'undefined') {
return this.cart.items[lineIndex].price;
}
return false;
}
getTotalByLine(lineIndex) {
if (typeof this.cart.items[lineIndex] !== 'undefined') {
return this.cart.items[lineIndex].line_price;
}
return false;
}
getCartTotalAddition() {
return this.totalAdditions.cart;
}
getCartTotal() {
return this.cart.total_price;
}
getCartTotalWithoutOneTime() {
return this.cart.total_price_before_onetime;
}
getOneTimeAdditions() {
return this.totalAdditions.oneTime;
}
getShadowVariantIds() {
return __WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(this.getShadowVariants(), variant => variant.variant_id);
}
expandCart() {
this.cart = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].cloneObject(this.rawCart);
for (let lineIndex = 0; lineIndex < this.cart.items.length; lineIndex++) {
this.expandCartItem(this.cart.items[lineIndex], lineIndex);
}
this.shadowVariants = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].objectToArray(this.shadowVariants);
__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(this.shadowVariants, variant => {
let qty_mode = variant.properties_all._qty_mode;
if (qty_mode === 'one_time_per_order' || qty_mode === 'one_time_per_product') {
this.shadowVariantsOneTime.push(variant);
}
if (this.addShadowVariantsToNewCart) {
this.cart.items.push(variant);
this.cart.item_count += variant.quantity;
}
});
this.calculateTotals();
this.cart.is_fixed = true;
this.storePrePriceModPrices();
this.applyPriceMods();
}
expandCartItem(cartItem, lineIndex) {
this.moveBoldProperties(cartItem);
this.applyRODiscounts(cartItem, lineIndex);
this.setRatio(cartItem);
this.expandShadowVariants(cartItem, lineIndex);
cartItem.is_fixed = true;
cartItem.line = lineIndex + 1;
}
moveBoldProperties(cartItem) {
cartItem.Bold = cartItem.BOLD || {};
cartItem.properties_all = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].cloneObject(cartItem.properties);
if (cartItem.properties !== null) {
for (let property in cartItem.properties) {
if (property[0] === '_' || __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].inArray(this.boldProperties, property)) {
let boldProperty = property;
if (boldProperty[0] === '_') {
boldProperty = boldProperty.substring(1);
}
cartItem.Bold[boldProperty] = cartItem.properties[property];
delete cartItem.properties[property];
}
}
}
cartItem.properties_formatted = this.getFormattedProperties(cartItem.properties);
}
addProperty(lineIndex, property, propertyValue) {
if (typeof this.cart.items[lineIndex] !== 'undefined') {
let cartItem = this.cart.items[lineIndex];
cartItem.Bold = cartItem.BOLD || {};
cartItem.properties_all = cartItem.properties_all || {};
if (property[0] === '_' || __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].inArray(this.boldProperties, property)) {
let boldProperty = property;
if (boldProperty[0] === '_') {
boldProperty = boldProperty.substring(1);
}
cartItem.Bold[boldProperty] = propertyValue;
} else {
cartItem.properties[property] = propertyValue;
}
cartItem.properties_all[property] = propertyValue;
cartItem.properties_formatted = this.getFormattedProperties(cartItem.properties);
}
}
updateProperty(lineIndex, property, propertyValue) {
this.addProperty(lineIndex, property, propertyValue);
}
expandShadowVariants(cartItem, lineIndex) {
let properties = cartItem.properties_all;
if (properties && typeof properties._boldVariantIds !== 'undefined') {
let variantNames = properties._boldVariantNames.split(',');
let variantIds = properties._boldVariantIds.split(',');
let productIds = properties._boldProductIds.split(',');
let variantPrices = properties._boldVariantPrices.split(',');
let variantQtys = typeof properties._boldVariantQtys === 'string' && properties._boldVariantQtys !== ''
? properties._boldVariantQtys.split(',')
: __WEBPACK_IMPORTED_MODULE_8_lodash_fill___default()(Array(variantIds.length), 1);
let productOneTime = (typeof properties._boldProductOneTime === 'string' ? properties._boldProductOneTime.split(',') : []);
let orderOneTime = (typeof properties._boldOrderOneTime === 'string' ? properties._boldOrderOneTime.split(',') : []);
for (let i = 0; i < variantIds.length; i++) {
let qtyMode = 'default';
if (productOneTime.indexOf(variantIds[i]) !== -1) {
qtyMode = 'one_time_per_product';
} else if (orderOneTime.indexOf(variantIds[i]) !== -1) {
qtyMode = 'one_time_per_order';
}
let product_id = parseInt(productIds[i]);
let variant_id = parseInt(variantIds[i]);
let price = parseInt(variantPrices[i]);
let qty = parseInt(variantQtys[i]);
let shadowVariant = {
id: variant_id,
title: variantNames[i],
product_title: variantNames[i],
variant_title: variantNames[i],
product_id: product_id,
variant_id: variant_id,
price: price,
line_price: price * qty,
quantity: qty,
product_description: '',
url: '',
image: '',
vendor: '',
sku: '',
grams: '',
properties: {
_parent_line_index: lineIndex,
_parent_id: parseInt(cartItem.product_id),
_is_shadow_variant: true,
_qty_mode: qtyMode,
},
};
__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(__WEBPACK_IMPORTED_MODULE_7_lodash_filter___default()(this.transferProperties, prop => typeof properties[prop] !== 'undefined'), prop => shadowVariant.properties[prop] = properties[prop]);
this.moveBoldProperties(shadowVariant);
this.addShadowVariant(shadowVariant);
}
}
}
addShadowVariant(shadowVariant) {
shadowVariant.original_quantity = shadowVariant.quantity;
if (shadowVariant.properties_all._qty_mode === 'default' || shadowVariant.properties_all._qty_mode === 'editable') {
let parent_line_index = shadowVariant.properties_all._parent_line_index;
shadowVariant.quantity *= this.rawCart.items[parent_line_index].quantity;
}
this.addShadowVariantById(shadowVariant);
if (shadowVariant.properties_all._qty_mode === 'default') {
this.addShadowVariantByLine(__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].cloneObject(shadowVariant));
}
}
addShadowVariantById(shadowVariant) {
let shadowVariantId = shadowVariant.id;
let shadowVariantParent = shadowVariant.properties_all._parent_id;
switch (shadowVariant.properties_all._qty_mode) {
case 'one_time_per_product':
this.shadowVariants[ shadowVariantParent + '_' + shadowVariantId ] = shadowVariant;
break;
case 'one_time_per_order':
this.shadowVariants[ 'one_time_per_order_' + shadowVariantId ] = shadowVariant;
break;
case 'default':
default:
if (typeof this.shadowVariants[shadowVariantId] === 'undefined') {
this.shadowVariants[ shadowVariantId ] = shadowVariant;
} else if(this.shadowVariants[shadowVariantId].price !== shadowVariant.price) {
this.shadowVariants[ shadowVariantParent + '_' + shadowVariantId ] = shadowVariant;
} else {
this.shadowVariants[ shadowVariantId ].quantity += shadowVariant.quantity;
this.shadowVariants[ shadowVariantId ].line_price = this.shadowVariants[ shadowVariantId ].price * this.shadowVariants[ shadowVariantId ].quantity;
}
}
}
addShadowVariantByLine(shadowVariant) {
let lineIndex = shadowVariant.properties_all._parent_line_index;
if (typeof this.shadowVariantsByLine[lineIndex] === 'undefined') {
this.shadowVariantsByLine[lineIndex] = [];
}
this.shadowVariantsByLine[lineIndex].push(shadowVariant);
}
applyRODiscounts(cartItem, lineIndex) {
if(!this.cart.is_recurring && !isNaN(parseInt(cartItem.Bold.frequency_num))) {
this.cart.is_recurring = true;
}
// get discount percentage multiplier
let priceMultiplier = 1;
if (typeof cartItem.Bold.ro_discount_percentage !== 'undefined') {
priceMultiplier = (100 - parseFloat(cartItem.Bold.ro_discount_percentage)) / 100;
let newLinePrice = this.cart.items[lineIndex].line_price * priceMultiplier;
let linePriceDifference = this.cart.items[lineIndex].line_price - newLinePrice;
this.cart.items[lineIndex].price *= priceMultiplier;
this.cart.items[lineIndex].line_price = newLinePrice;
this.cart.total_price -= linePriceDifference;
}
cartItem.discount_multiplier = priceMultiplier;
// apply discounts to shadow variants
if (priceMultiplier < 1 && typeof cartItem.properties_all._boldVariantPrices !== 'undefined') {
let variantPrices = cartItem.properties_all._boldVariantPrices.split(',');
for (let i=0; i < variantPrices.length; i++) {
variantPrices[i] = Math.round(variantPrices[i] * priceMultiplier);
}
this.updateProperty(lineIndex, '_boldVariantPrices', variantPrices.join(','));
}
}
setRatio(cartItem) {
cartItem.qty_ratio = cartItem.qty_ratio || 1;
cartItem.true_qty = cartItem.true_qty || cartItem.quantity;
if (cartItem.Bold.btm_ratio) {
cartItem.qty_ratio *= parseInt(cartItem.Bold.btm_ratio);
cartItem.is_btm = true;
}
if (cartItem.Bold.bold_ratio) {
cartItem.qty_ratio *= parseInt(cartItem.Bold.bold_ratio);
}
if (cartItem.qty_ratio !== 1) {
cartItem.quantity = cartItem.true_qty / cartItem.qty_ratio;
}
}
calculateTotals() {
this.totalAdditions = {
byLine: {},
cart: 0,
cartWithoutOneTime: 0,
oneTime: 0
};
// by line
for (let lineIndex in this.shadowVariantsByLine) {
this.totalAdditions.byLine[lineIndex] = { price: 0, total: 0 };
__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(this.shadowVariantsByLine[lineIndex], variant => {
let priceAddition = variant.price * variant.original_quantity;
let totalAddition = variant.price * variant.original_quantity * this.rawCart.items[lineIndex].quantity;
this.totalAdditions.byLine[lineIndex].price += priceAddition;
this.totalAdditions.byLine[lineIndex].total += totalAddition;
this.totalAdditions.cart += totalAddition;
this.totalAdditions.cartWithoutOneTime += totalAddition;
if( ! this.addShadowVariantsToNewCart) {
this.cart.items[lineIndex].price += priceAddition;
this.cart.items[lineIndex].original_price += priceAddition;
this.cart.items[lineIndex].discounted_price += priceAddition;
this.cart.items[lineIndex].line_price += totalAddition;
this.cart.items[lineIndex].original_line_price += totalAddition;
}
});
}
// one time
__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(this.shadowVariantsOneTime, variant => this.totalAdditions.oneTime += variant.price * variant.quantity);
// cart totals
this.cart.total_price += this.totalAdditions.cart;
this.cart.total_price_before_onetime = this.cart.total_price;
this.cart.total_price += this.totalAdditions.oneTime;
}
getFormattedProperties(properties) {
if (properties) {
let fields = {
properties: __WEBPACK_IMPORTED_MODULE_7_lodash_filter___default()(__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(properties, (v, p) => {
let property = { property: p, separator: ':' };
if (v === '') {
return '';
} else if (typeof v === 'string' && v.search(/\/uploads\//) > -1) {
property.upload_url = v;
if (typeof window.BOLD.language !== 'undefined' && window.BOLD.language.uploaded_file === 'string') {
property.upload = window.BOLD.language.uploaded_file;
} else {
property.upload = 'Uploaded file';
}
} else {
property.value = v;
}
return property;
}), p => p !== ''),
};
let template = `<div class="bold_line_properties">
{{#properties}}
<div>
<span class="bold_line_property">{{ property }}</span>
<span class="bold_line_separator">{{ separator }}</span>
{{#value}}<span class="bold_line_value">{{ value }}</span>{{/value}}
{{#upload}}<span class="bold_line_value bold_line_upload"><a href="{{ upload_url }}">{{ upload }}</a></span>{{/upload}}
</div>
{{/properties}}
</div>`;
if (typeof window.BOLD.options !== 'undefined'
&& typeof window.BOLD.options.templates !== 'undefined'
&& typeof window.BOLD.options.templates.cart_formatted_properties !== 'undefined') {
template = window.BOLD.options.templates.cart_formatted_properties;
}
__WEBPACK_IMPORTED_MODULE_4_mustache___default.a.parse(template);
return __WEBPACK_IMPORTED_MODULE_4_mustache___default.a.render(template, fields);
}
return '';
}
isFixed(rawThing) {
return typeof rawThing.is_fixed !== 'undefined' && rawThing.is_fixed;
}
fix(rawCart, addShadowVariantsToNewCart = false) {
if (this.isFixed(rawCart)) {
return rawCart;
}
let newDoctor = new BoldCartDoctor(rawCart, addShadowVariantsToNewCart);
this.ee.emit('refresh', rawCart);
return newDoctor.getCart();
}
fixItem(rawItem) {
if (this.isFixed(rawItem)) {
return rawItem;
}
let newDoctor = new BoldCartDoctor({
total_price: rawItem.line_price,
item_count: 1,
items: [rawItem],
});
let item = newDoctor.getItem(0);
if (item !== false) {
return item;
}
return rawItem;
}
storePrePriceModPrices() {
for (let lineIndex = 0; lineIndex < this.cart.items.length; lineIndex++) {
this.cart.items[lineIndex].premod_price = this.cart.items[lineIndex].price;
this.cart.items[lineIndex].premod_line_price = this.cart.items[lineIndex].line_price;
}
this.cart.premod_total_price = this.cart.total_price;
this.cart.premod_total_price_before_onetime = this.cart.total_price_before_onetime;
for (let lineIndex = 0; lineIndex < this.shadowVariantsOneTime.length; lineIndex++) {
this.shadowVariantsOneTime[lineIndex].premod_price = this.shadowVariantsOneTime[lineIndex].price;
this.shadowVariantsOneTime[lineIndex].premod_line_price = this.shadowVariantsOneTime[lineIndex].line_price;
}
this.totalAdditions.premod_oneTime = this.totalAdditions.oneTime;
}
revertToPremodPrices() {
for (let lineIndex = 0; lineIndex < this.cart.items.length; lineIndex++) {
this.cart.items[lineIndex].price = this.cart.items[lineIndex].premod_price;
this.cart.items[lineIndex].line_price = this.cart.items[lineIndex].premod_line_price;
}
this.cart.total_price = this.cart.premod_total_price;
this.cart.total_price_before_onetime = this.cart.premod_total_price_before_onetime;
for (let lineIndex = 0; lineIndex < this.shadowVariantsOneTime.length; lineIndex++) {
this.shadowVariantsOneTime[lineIndex].price = this.shadowVariantsOneTime[lineIndex].premod_price;
this.shadowVariantsOneTime[lineIndex].line_price = this.shadowVariantsOneTime[lineIndex].premod_line_price;
}
this.totalAdditions.oneTime = this.totalAdditions.premod_oneTime;
}
registerPriceMod(name, priceModFn, updateCart = true) {
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet(`BOLD.common.cartDoctorInput.priceMods.${name}`, priceModFn);
this.revertToPremodPrices();
this.applyPriceMods();
updateCart && document.readyState === 'complete' && this.updateCart();
}
applyPriceMods() {
let priceMods = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowGet('BOLD.common.cartDoctorInput.priceMods');
typeof priceMods === 'object' && __WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(priceMods, priceModFn => this.applyPriceMod(priceModFn));
}
applyPriceMod(priceModFn) {
// apply to standard line items
for (let lineIndex = 0; lineIndex < this.cart.items.length; lineIndex++) {
let preModPrice = this.cart.items[lineIndex].price;
this.cart.items[lineIndex].price = priceModFn(this.cart.items[lineIndex].price, lineIndex);
let priceAddition = this.cart.items[lineIndex].price - preModPrice;
let priceAdditionTotal = priceAddition * this.cart.items[lineIndex].quantity;
this.cart.items[lineIndex].line_price += priceAdditionTotal;
this.cart.total_price += priceAdditionTotal;
this.cart.total_price_before_onetime += priceAdditionTotal;
}
// apply to one time line items
for (let lineIndex = 0; lineIndex < this.shadowVariantsOneTime.length; lineIndex++) {
let preModPrice = this.shadowVariantsOneTime[lineIndex].price;
this.shadowVariantsOneTime[lineIndex].price = priceModFn(this.shadowVariantsOneTime[lineIndex].price, 'onetime_' + lineIndex);
let priceAddition = this.shadowVariantsOneTime[lineIndex].price - preModPrice;
let priceAdditionTotal = priceAddition * this.shadowVariantsOneTime[lineIndex].quantity;
this.shadowVariantsOneTime[lineIndex].line_price += priceAdditionTotal;
this.cart.total_price += priceAdditionTotal;
this.totalAdditions.oneTime += priceAdditionTotal;
}
}
correctCart() {
// backwards compatibility
this.updateCart();
}
updateCart() {
if (typeof this.linePriceElements === 'undefined') {
// get cart dom elements
this.linePriceElements = this.getHookParentsByIndex(this.cartHookClasses.price);
this.lineTotalElements = this.getHookParentsByIndex(this.cartHookClasses.total);
this.cartTotalElements = __WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].getParentElementsByClassName(this.cartHookClasses.cartTotal);
this.oneTimeVariantsElement = document.getElementsByClassName(this.variantTotalsDisplayClass); // optional one-time-variants-element install
}
this.manualPropertiesElements = document.getElementsByClassName(this.manualPropertiesClass);
this.updateCartLines();
this.updateCartTotal();
this.ee.emit('cart_prices_updated', { cart: this.getCart() });
this.ee.emitOut('BOLD_OPTIONS_cart_prices_updated', { cart: this.getCart() }); // For backwards compatibility
}
updateCartLines() {
let moneyFormat = '{{amount}}';
if(typeof window.BOLDCURRENCY !== 'undefined') {
moneyFormat = typeof window.BOLDCURRENCY.moneyFormats[window.BOLDCURRENCY.currentCurrency] !== 'undefined' ?
window.BOLDCURRENCY.moneyFormats[window.BOLDCURRENCY.currentCurrency].money_format : '{{amount}}';
}
for (let lineIndex = 0; lineIndex < this.getRawCartCount(); lineIndex++) {
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].innerHTML(this.linePriceElements[lineIndex], __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(this.getPriceByLine(lineIndex), moneyFormat));
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].innerHTML(this.lineTotalElements[lineIndex], __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(this.getTotalByLine(lineIndex), moneyFormat));
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].innerHTML(this.manualPropertiesElements[lineIndex], this.getItem(lineIndex).properties_formatted);
}
}
updateCartTotal() {
// have optional one-time-variants-element install?
if (typeof this.oneTimeVariantsElement[0] !== 'undefined') {
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].empty(this.oneTimeVariantsElement[0]);
__WEBPACK_IMPORTED_MODULE_5_lodash_map___default()(this.getOneTimeShadowVariants(), variant => {
let variantTotalMessage = variant.title.replace('%2C', ',') + ': ' + __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(variant.price * variant.quantity);
let variantTotalLine = __WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].createElement('div', { innerHTML: variantTotalMessage });
this.oneTimeVariantsElement[0].appendChild(variantTotalLine);
});
}
// update cart total element
if (typeof this.oneTimeVariantsElement[0] === 'undefined' && this.getOneTimeAdditions() > 0) {
let cartTotalWithExtras = __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(this.getCartTotalWithoutOneTime()) +
' + ' + __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(this.getOneTimeAdditions()) + ' of extras';
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].innerHTML(this.cartTotalElements, cartTotalWithExtras);
} else {
let moneyFormat = '{{amount}}';
if(typeof window.BOLDCURRENCY !== 'undefined') {
moneyFormat = typeof window.BOLDCURRENCY.moneyFormats[window.BOLDCURRENCY.currentCurrency] !== 'undefined' ?
window.BOLDCURRENCY.moneyFormats[window.BOLDCURRENCY.currentCurrency].money_format : '{{amount}}';
}
__WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].innerHTML(this.cartTotalElements, __WEBPACK_IMPORTED_MODULE_1__helpers_ShopifyHelper__["a" /* default */].displayMoney(this.getCartTotal(), moneyFormat));
}
}
getHookParentsByIndex(className, classCount = 1, hookParentsByIndex = []) {
let fullClassName = className;
if (classCount > 1) {
fullClassName = className + '_' + classCount;
}
let elements = __WEBPACK_IMPORTED_MODULE_2__helpers_DOMHelper__["a" /* default */].getParentElementsByClassName(fullClassName);
if (elements.length > 0) {
for (let i=0; i<elements.length; i++) {
if (typeof hookParentsByIndex[i] === 'undefined') {
hookParentsByIndex[i] = [];
}
hookParentsByIndex[i].push(elements[i]);
}
return this.getHookParentsByIndex(className, ++classCount, hookParentsByIndex);
}
return hookParentsByIndex;
}
}
/* harmony default export */ __webpack_exports__["default"] = BoldCartDoctor;
/***/ }),
/* 59 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helpers_DOMHelper__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__helpers_ShopifyHelper__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_map__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_map__);
class BoldHelpers {
static load() {
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers', {}, false);
window.BOLD.helpers.js = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"];
window.BOLD.helpers.dom = __WEBPACK_IMPORTED_MODULE_1__helpers_DOMHelper__["a" /* default */];
window.BOLD.helpers.shopify = __WEBPACK_IMPORTED_MODULE_2__helpers_ShopifyHelper__["a" /* default */];
window.BOLD.helpers.windowSet = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet.bind(__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"]);
window.BOLD.helpers.windowGet = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowGet.bind(__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"]);
window.BOLD.helpers.windowCall = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowCall.bind(__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"]);
window.BOLD.helpers.windowPush = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowPush.bind(__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"]);
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.addItemFromForm', this.addItemFromForm.bind(this), false);
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.selectCallbackAddEvent', this.selectCallbackAddEvent.bind(this), false);
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.currencyPickerAddEvent', this.currencyPickerAddEvent.bind(this), false);
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.changeItem', this.changeItem.bind(this), false);
return window.BOLD.helpers;
}
static bindHelperEvents() {
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowCall('BOLD.helpers.selectCallbackAddEvent');
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowCall('BOLD.helpers.currencyPickerAddEvent');
}
static selectCallbackAddEvent(callbackFunction = 'selectCallback') {
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.helperEventsBound.selectCallback', false, false);
let oldSelectCallback = typeof callbackFunction === 'string' ? window[callbackFunction] : callbackFunction;
if ( ! window.BOLD.helpers.helperEventsBound.selectCallback && typeof oldSelectCallback === 'function') {
window.BOLD.helpers.helperEventsBound.selectCallback = true;
let newSelectCallback = (variant, selector) => {
let ee = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowGet('BOLD.common.eventEmitter');
typeof ee !== 'undefined' && ee.emit('BOLD_COMMON_variant_changed_precallback', { variant: variant, selector: selector });
let result = oldSelectCallback(variant, selector);
typeof ee !== 'undefined' && ee.emit('BOLD_COMMON_variant_changed', { variant: variant, selector: selector });
return result;
};
if (typeof callbackFunction === 'string') {
window[callbackFunction] = newSelectCallback;
}
return newSelectCallback;
}
return oldSelectCallback;
}
static currencyPickerAddEvent(currencyPickerSelection = '.currency-picker,.currencies') {
__WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowSet('BOLD.helpers.helperEventsBound.currencyPicker', false, false);
if ( ! window.BOLD.helpers.helperEventsBound.currencyPicker) {
let currencyPickers = document.querySelectorAll(currencyPickerSelection);
if (currencyPickers.length > 0) {
window.BOLD.helpers.helperEventsBound.currencyPicker = true;
__WEBPACK_IMPORTED_MODULE_3_lodash_map___default()(currencyPickers, cp => {
cp.addEventListener('change', evt => {
let ee = __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].windowGet('BOLD.common.eventEmitter');
typeof ee !== 'undefined' && ee.emit('BOLD_COMMON_currency_changed', evt);
}, false);
});
}
}
}
static addItemFromForm(form, success_callback, error_callback, options) {
var options = options || {};
var url = options.endpoint || '/cart/add.js';
var formObj;
// Check what kind of object we were passed.
if (typeof form === 'string') {
if (form.indexOf('#') == 0) {
form = form.substr(1);
}
formObj = document.getElementById(form);
} else if (form.jquery) {
formObj = form[0];
} else {
formObj = form;
}
// Check to see if we need to abort to an old-fashioned form submit
var data;
var hasUsableFormData = (typeof FormData === 'function');
if (hasUsableFormData) {
data = new FormData(formObj);
if (typeof data.getAll !== 'function') {
hasUsableFormData = false;
}
}
if (!hasUsableFormData) {
var formElements = formObj.length;
data = '';
for (var i=0; i < formElements; i++) {
var fieldType = (typeof formObj[i].type === 'string' ? formObj[i].type.toLowerCase() : null);
if (fieldType === 'file') {
if ( ! formObj.getAttribute('enctype')) {
formObj.setAttribute('enctype', 'multipart/form-data');
}
//No usable FormData object - we will need to do a manual submit
formObj.submit();
return false;
}
var fieldValue = ((fieldType !== 'radio' && fieldType !== 'checkbox') || formObj[i].checked ? formObj[i].value : null);
var fieldName = formObj[i].name || '';
if (!fieldValue || !fieldName) continue;
data += (data.length ? '&' : '' ) + fieldName + '=' + fieldValue;
}
}
// Make the XHR post
var request = new XMLHttpRequest();
request.open('POST', url, true);
if (!hasUsableFormData) {
request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
}
request.onload = function (response) {
if (typeof success_callback === 'function') {
success_callback(response);
} else if (typeof Shopify === 'object' && typeof Shopify.onItemAdded ==='function') {
Shopify.onItemAdded(response);
} else if (typeof ShopifyAPI === 'object' && typeof ShopifyAPI.onItemAdded === 'function') {
ShopifyAPI.onItemAdded(response);
}
// Update inventory quantities if we set them up
if (typeof beforeBoldSelectCallback === 'function' && formObj.variant && formObj.variant.selector) {
var qty = (formObj.quantity ? parseInt(formObj.quantity.value) : 1);
var variant = formObj.variant;
if (typeof variant.inventory_in_cart !== 'undefined') {
variant.inventory_in_cart += qty;
}
if (typeof variant.inventory_remaining !== 'undefined' && variant.inventory_management) {
variant.inventory_remaining -= qty;
}
if (variant.inventory_remaining <= 0 && variant.inventory_management && variant.inventory_policy === 'deny') {
variant.available = false;
}
beforeBoldSelectCallback(variant, variant.selector);
}
};
if (typeof error_callback === 'function') {
request.onerror = error_callback;
}
request.send(data);
}
static changeItem(line, qty, reload = false) {
return __WEBPACK_IMPORTED_MODULE_0__helpers_JSHelper__["default"].post('/cart/change.js?line='+line+'&quantity='+qty, {}, true).then(() => {
if (reload) {
__WEBPACK_IMPORTED_MODULE_1__helpers_DOMHelper__["a" /* default */].reload();
}
});
}
}
/* harmony default export */ __webpack_exports__["default"] = BoldHelpers;
/***/ }),
/* 60 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_eventemitter3__ = __webpack_require__(61);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_eventemitter3___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_eventemitter3__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helpers_JSHelper__ = __webpack_require__(6);
class BoldEventEmitter {
constructor(namespace, app, vendor = 'BOLD') {
this.namespace = namespace;
this.app = app;
this.vendor = vendor;
__WEBPACK_IMPORTED_MODULE_1__helpers_JSHelper__["default"].windowSet('BOLD.common', {}, false);
window.BOLD.common.eventEmitter = window.BOLD.common.eventEmitter || new __WEBPACK_IMPORTED_MODULE_0_eventemitter3___default.a();
__WEBPACK_IMPORTED_MODULE_1__helpers_JSHelper__["default"].windowSet('BOLD.common.settings.log_events', false, false);
__WEBPACK_IMPORTED_MODULE_1__helpers_JSHelper__["default"].windowSet('BOLD.common.settings.log_event_data', false, false);
this.ee = window.BOLD.common.eventEmitter;
}
eventName(event) {
return this.vendor + '_' + this.app + '_' + event;
}
on(event, fn, context) {
this.ee.on(this.eventName(event), evt => {
if (typeof evt !== 'undefined' && typeof evt.data !== 'undefined' && typeof evt.data.target_namespace !== 'undefined') {
if (evt.data.target_namespace === this.namespace) {
fn.call(context, evt);
}
} else {
fn.call(context, evt);
}
});
}
onOut(event, fn, context) {
this.ee.on(event, fn, context);
}
emit(event, data) {
let longEventName = this.eventName(event);
let eventObject = {
vendor: this.vendor,
app: this.app,
namespace: this.namespace,
event: event
};
if(typeof data !== 'undefined') {
eventObject.data = data;
}
this.logEvent(event, eventObject);
this.ee.emit(longEventName, eventObject);
}
emitOut(event, data) {
this.logEvent(event, data);
this.ee.emit(event, data);
}
logEvent(event, data) {
if (window.BOLD.common.settings.log_events) {
if (window.BOLD.common.settings.log_event_data) {
console.debug(event, data);
} else {
console.debug(event);
}
}
}
removeListener(event) {
var longEventName = this.eventName(event);
this.ee.removeListener(longEventName);
}
setNamespace(namespace) {
this.namespace = namespace;
}
onDomLoaded(fn, context = this) {
if (document.readyState === 'complete') {
fn.call(context);
} else {
document.addEventListener('DOMContentLoaded', () => fn.call(context));
}
}
}
/* harmony default export */ __webpack_exports__["a"] = BoldEventEmitter;
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = Object.prototype.hasOwnProperty;
//
// We store our EE objects in a plain object whose properties are event names.
// If `Object.create(null)` is not supported we prefix the event names with a
// `~` to make sure that the built-in object properties are not overridden or
// used as an attack vector.
// We also assume that `Object.create(null)` is available when the event name
// is an ES6 Symbol.
//
var prefix = typeof Object.create !== 'function' ? '~' : false;
/**
* Representation of a single EventEmitter function.
*
* @param {Function} fn Event handler to be called.
* @param {Mixed} context Context for function execution.
* @param {Boolean} [once=false] Only emit once
* @api private
*/
function EE(fn, context, once) {
this.fn = fn;
this.context = context;
this.once = once || false;
}
/**
* Minimal EventEmitter interface that is molded against the Node.js
* EventEmitter interface.
*
* @constructor
* @api public
*/
function EventEmitter() { /* Nothing to set */ }
/**
* Hold the assigned EventEmitters by name.
*
* @type {Object}
* @private
*/
EventEmitter.prototype._events = undefined;
/**
* Return an array listing the events for which the emitter has registered
* listeners.
*
* @returns {Array}
* @api public
*/
EventEmitter.prototype.eventNames = function eventNames() {
var events = this._events
, names = []
, name;
if (!events) return names;
for (name in events) {
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
}
if (Object.getOwnPropertySymbols) {
return names.concat(Object.getOwnPropertySymbols(events));
}
return names;
};
/**
* Return a list of assigned event listeners.
*
* @param {String} event The events that should be listed.
* @param {Boolean} exists We only need to know if there are listeners.
* @returns {Array|Boolean}
* @api public
*/
EventEmitter.prototype.listeners = function listeners(event, exists) {
var evt = prefix ? prefix + event : event
, available = this._events && this._events[evt];
if (exists) return !!available;
if (!available) return [];
if (available.fn) return [available.fn];
for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
ee[i] = available[i].fn;
}
return ee;
};
/**
* Emit an event to all registered event listeners.
*
* @param {String} event The name of the event.
* @returns {Boolean} Indication if we've emitted an event.
* @api public
*/
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
var evt = prefix ? prefix + event : event;
if (!this._events || !this._events[evt]) return false;
var listeners = this._events[evt]
, len = arguments.length
, args
, i;
if ('function' === typeof listeners.fn) {
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
switch (len) {
case 1: return listeners.fn.call(listeners.context), true;
case 2: return listeners.fn.call(listeners.context, a1), true;
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
}
for (i = 1, args = new Array(len -1); i < len; i++) {
args[i - 1] = arguments[i];
}
listeners.fn.apply(listeners.context, args);
} else {
var length = listeners.length
, j;
for (i = 0; i < length; i++) {
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
switch (len) {
case 1: listeners[i].fn.call(listeners[i].context); break;
case 2: listeners[i].fn.call(listeners[i].context, a1); break;
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
default:
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
args[j - 1] = arguments[j];
}
listeners[i].fn.apply(listeners[i].context, args);
}
}
}
return true;
};
/**
* Register a new EventListener for the given event.
*
* @param {String} event Name of the event.
* @param {Function} fn Callback function.
* @param {Mixed} [context=this] The context of the function.
* @api public
*/
EventEmitter.prototype.on = function on(event, fn, context) {
var listener = new EE(fn, context || this)
, evt = prefix ? prefix + event : event;
if (!this._events) this._events = prefix ? {} : Object.create(null);
if (!this._events[evt]) this._events[evt] = listener;
else {
if (!this._events[evt].fn) this._events[evt].push(listener);
else this._events[evt] = [
this._events[evt], listener
];
}
return this;
};
/**
* Add an EventListener that's only called once.
*
* @param {String} event Name of the event.
* @param {Function} fn Callback function.
* @param {Mixed} [context=this] The context of the function.
* @api public
*/
EventEmitter.prototype.once = function once(event, fn, context) {
var listener = new EE(fn, context || this, true)
, evt = prefix ? prefix + event : event;
if (!this._events) this._events = prefix ? {} : Object.create(null);
if (!this._events[evt]) this._events[evt] = listener;
else {
if (!this._events[evt].fn) this._events[evt].push(listener);
else this._events[evt] = [
this._events[evt], listener
];
}
return this;
};
/**
* Remove event listeners.
*
* @param {String} event The event we want to remove.
* @param {Function} fn The listener that we need to find.
* @param {Mixed} context Only remove listeners matching this context.
* @param {Boolean} once Only remove once listeners.
* @api public
*/
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
var evt = prefix ? prefix + event : event;
if (!this._events || !this._events[evt]) return this;
var listeners = this._events[evt]
, events = [];
if (fn) {
if (listeners.fn) {
if (
listeners.fn !== fn
|| (once && !listeners.once)
|| (context && listeners.context !== context)
) {
events.push(listeners);
}
} else {
for (var i = 0, length = listeners.length; i < length; i++) {
if (
listeners[i].fn !== fn
|| (once && !listeners[i].once)
|| (context && listeners[i].context !== context)
) {
events.push(listeners[i]);
}
}
}
}
//
// Reset the array, or remove it completely if we have no more listeners.
//
if (events.length) {
this._events[evt] = events.length === 1 ? events[0] : events;
} else {
delete this._events[evt];
}
return this;
};
/**
* Remove all listeners or only the listeners for the specified event.
*
* @param {String} event The event want to remove all listeners for.
* @api public
*/
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
if (!this._events) return this;
if (event) delete this._events[prefix ? prefix + event : event];
else this._events = prefix ? {} : Object.create(null);
return this;
};
//
// Alias methods names because people roll like that.
//
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
//
// This function doesn't apply anymore.
//
EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
return this;
};
//
// Expose the prefix.
//
EventEmitter.prefixed = prefix;
//
// Expose the module.
//
if (true) {
module.exports = EventEmitter;
}
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3),
root = __webpack_require__(1);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(120),
hashDelete = __webpack_require__(121),
hashGet = __webpack_require__(122),
hashHas = __webpack_require__(123),
hashSet = __webpack_require__(124);
/**
* 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;
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3),
root = __webpack_require__(1);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3),
root = __webpack_require__(1);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(20),
setCacheAdd = __webpack_require__(145),
setCacheHas = __webpack_require__(146);
/**
*
* 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;
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(3),
root = __webpack_require__(1);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/* 68 */
/***/ (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;
/***/ }),
/* 69 */
/***/ (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;
/***/ }),
/* 70 */
/***/ (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;
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(22),
eq = __webpack_require__(8);
/** 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;
/***/ }),
/* 72 */
/***/ (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;
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(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;
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(18),
toLength = __webpack_require__(172);
/**
* 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;
}
module.exports = baseFill;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(41);
/**
* 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;
}
module.exports = baseFilter;
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(43),
keys = __webpack_require__(17);
/**
* 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;
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(69),
isArray = __webpack_require__(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;
/***/ }),
/* 78 */
/***/ (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;
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(42),
baseIsNaN = __webpack_require__(83),
strictIndexOf = __webpack_require__(155);
/**
* 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;
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(7),
isObjectLike = __webpack_require__(5);
/** `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;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(21),
equalArrays = __webpack_require__(48),
equalByTag = __webpack_require__(111),
equalObjects = __webpack_require__(112),
getTag = __webpack_require__(117),
isArray = __webpack_require__(0),
isBuffer = __webpack_require__(28),
isTypedArray = __webpack_require__(31);
/** 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;
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(21),
baseIsEqual = __webpack_require__(45);
/** 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;
/***/ }),
/* 83 */
/***/ (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;
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(29),
isMasked = __webpack_require__(127),
isObject = __webpack_require__(2),
toSource = __webpack_require__(55);
/**
* 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;
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(7),
isLength = __webpack_require__(30),
isObjectLike = __webpack_require__(5);
/** `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;
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(25),
nativeKeys = __webpack_require__(140);
/** 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;
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(2),
isPrototype = __webpack_require__(25),
nativeKeysIn = __webpack_require__(141);
/** 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;
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(41),
isArrayLike = __webpack_require__(4);
/**
* 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;
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(82),
getMatchData = __webpack_require__(114),
matchesStrictComparable = __webpack_require__(53);
/**
* 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;
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(45),
get = __webpack_require__(161),
hasIn = __webpack_require__(162),
isKey = __webpack_require__(24),
isStrictComparable = __webpack_require__(52),
matchesStrictComparable = __webpack_require__(53),
toKey = __webpack_require__(15);
/** 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;
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(21),
assignMergeValue = __webpack_require__(40),
baseFor = __webpack_require__(43),
baseMergeDeep = __webpack_require__(92),
isObject = __webpack_require__(2),
keysIn = __webpack_require__(57);
/**
* 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(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
module.exports = baseMerge;
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
var assignMergeValue = __webpack_require__(40),
cloneBuffer = __webpack_require__(102),
cloneTypedArray = __webpack_require__(103),
copyArray = __webpack_require__(104),
initCloneObject = __webpack_require__(125),
isArguments = __webpack_require__(27),
isArray = __webpack_require__(0),
isArrayLikeObject = __webpack_require__(164),
isBuffer = __webpack_require__(28),
isFunction = __webpack_require__(29),
isObject = __webpack_require__(2),
isPlainObject = __webpack_require__(165),
isTypedArray = __webpack_require__(31),
toPlainObject = __webpack_require__(174);
/**
* 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 = object[key],
srcValue = 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);
}
module.exports = baseMergeDeep;
/***/ }),
/* 93 */
/***/ (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;
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(44);
/**
* 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;
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(26),
overRest = __webpack_require__(144),
setToString = __webpack_require__(148);
/**
* 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;
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(157),
defineProperty = __webpack_require__(47),
identity = __webpack_require__(26);
/**
* 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;
/***/ }),
/* 97 */
/***/ (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;
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(10),
arrayMap = __webpack_require__(39),
isArray = __webpack_require__(0),
isSymbol = __webpack_require__(16);
/** 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;
/***/ }),
/* 99 */
/***/ (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;
/***/ }),
/* 100 */
/***/ (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;
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(36);
/**
* 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;
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(1);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
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__(33)(module)))
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(101);
/**
* 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;
/***/ }),
/* 104 */
/***/ (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;
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(71),
baseAssignValue = __webpack_require__(22);
/**
* 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;
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(1);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(95),
isIterateeCall = __webpack_require__(51);
/**
* 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;
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(4);
/**
* 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;
/***/ }),
/* 109 */
/***/ (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;
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(12),
isArrayLike = __webpack_require__(4),
keys = __webpack_require__(17);
/**
* 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(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;
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(10),
Uint8Array = __webpack_require__(36),
eq = __webpack_require__(8),
equalArrays = __webpack_require__(48),
mapToArray = __webpack_require__(138),
setToArray = __webpack_require__(147);
/** 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;
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(113);
/** 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;
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(77),
getSymbols = __webpack_require__(116),
keys = __webpack_require__(17);
/**
* 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;
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(52),
keys = __webpack_require__(17);
/**
* 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;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(10);
/** 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;
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(37),
stubArray = __webpack_require__(169);
/** 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;
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(62),
Map = __webpack_require__(19),
Promise = __webpack_require__(64),
Set = __webpack_require__(65),
WeakMap = __webpack_require__(67),
baseGetTag = __webpack_require__(7),
toSource = __webpack_require__(55);
/** `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(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;
/***/ }),
/* 118 */
/***/ (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;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(46),
isArguments = __webpack_require__(27),
isArray = __webpack_require__(0),
isIndex = __webpack_require__(23),
isLength = __webpack_require__(30),
toKey = __webpack_require__(15);
/**
* 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;
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(14);
/**
* 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;
/***/ }),
/* 121 */
/***/ (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;
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(14);
/** 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;
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(14);
/** 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;
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(14);
/** 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;
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(73),
getPrototype = __webpack_require__(50),
isPrototype = __webpack_require__(25);
/**
* 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;
/***/ }),
/* 126 */
/***/ (function(module, exports) {
/**
* 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;
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(106);
/** 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;
/***/ }),
/* 128 */
/***/ (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;
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(11);
/** 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;
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(11);
/**
* 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;
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(11);
/**
* 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;
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(11);
/**
* 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;
/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(63),
ListCache = __webpack_require__(9),
Map = __webpack_require__(19);
/**
* 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;
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(13);
/**
* 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;
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(13);
/**
* 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;
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(13);
/**
* 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;
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(13);
/**
* 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;
/***/ }),
/* 138 */
/***/ (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;
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(166);
/** 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;
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(54);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/* 141 */
/***/ (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;
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(49);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(33)(module)))
/***/ }),
/* 143 */
/***/ (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;
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(68);
/* 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;
/***/ }),
/* 145 */
/***/ (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;
/***/ }),
/* 146 */
/***/ (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;
/***/ }),
/* 147 */
/***/ (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;
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(96),
shortOut = __webpack_require__(149);
/**
* 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;
/***/ }),
/* 149 */
/***/ (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;
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(9);
/**
* 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;
/***/ }),
/* 151 */
/***/ (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;
/***/ }),
/* 152 */
/***/ (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;
/***/ }),
/* 153 */
/***/ (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;
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(9),
Map = __webpack_require__(19),
MapCache = __webpack_require__(20);
/** 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;
/***/ }),
/* 155 */
/***/ (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;
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(139);
/** Used to match property names within property paths. */
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ }),
/* 157 */
/***/ (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;
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
var baseFill = __webpack_require__(74),
isIterateeCall = __webpack_require__(51);
/**
* 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);
}
module.exports = fill;
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(37),
baseFilter = __webpack_require__(75),
baseIteratee = __webpack_require__(12),
isArray = __webpack_require__(0);
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.reject
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, { 'age': 36, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.filter(users, 'active');
* // => objects for ['barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, baseIteratee(predicate, 3));
}
module.exports = filter;
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(42),
baseIteratee = __webpack_require__(12),
toInteger = __webpack_require__(18);
/* 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;
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(44);
/**
* 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;
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(78),
hasPath = __webpack_require__(119);
/**
* 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;
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(79),
toInteger = __webpack_require__(18);
/* 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;
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(4),
isObjectLike = __webpack_require__(5);
/**
* 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);
}
module.exports = isArrayLikeObject;
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(7),
getPrototype = __webpack_require__(50),
isObjectLike = __webpack_require__(5);
/** `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;
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(20);
/** 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() {
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;
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
var baseMerge = __webpack_require__(91),
createAssigner = __webpack_require__(107);
/**
* 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);
});
module.exports = merge;
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(93),
basePropertyDeep = __webpack_require__(94),
isKey = __webpack_require__(24),
toKey = __webpack_require__(15);
/**
* 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;
/***/ }),
/* 169 */
/***/ (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;
/***/ }),
/* 170 */
/***/ (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;
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(173);
/** 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;
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
var baseClamp = __webpack_require__(72),
toInteger = __webpack_require__(18);
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/**
* 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;
}
module.exports = toLength;
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(2),
isSymbol = __webpack_require__(16);
/** 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;
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(105),
keysIn = __webpack_require__(57);
/**
* 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));
}
module.exports = toPlainObject;
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(98);
/**
* 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;
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
/*global define: false Mustache: true*/
(function defineMustache (global, factory) {
if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {
factory(exports); // CommonJS
} else if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); // AMD
} else {
global.Mustache = {};
factory(global.Mustache); // script, wsh, asp
}
}(this, function mustacheFactory (mustache) {
var objectToString = Object.prototype.toString;
var isArray = Array.isArray || function isArrayPolyfill (object) {
return objectToString.call(object) === '[object Array]';
};
function isFunction (object) {
return typeof object === 'function';
}
/**
* More correct typeof string handling array
* which normally returns typeof 'object'
*/
function typeStr (obj) {
return isArray(obj) ? 'array' : typeof obj;
}
function escapeRegExp (string) {
return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
}
/**
* Null safe way of checking whether or not an object,
* including its prototype, has a given property
*/
function hasProperty (obj, propName) {
return obj != null && typeof obj === 'object' && (propName in obj);
}
// Workaround for https://issues.apache.org/jira/browse/COUCHDB-577
// See https://github.com/janl/mustache.js/issues/189
var regExpTest = RegExp.prototype.test;
function testRegExp (re, string) {
return regExpTest.call(re, string);
}
var nonSpaceRe = /\S/;
function isWhitespace (string) {
return !testRegExp(nonSpaceRe, string);
}
var entityMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'/': '/',
'`': '`',
'=': '='
};
function escapeHtml (string) {
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap (s) {
return entityMap[s];
});
}
var whiteRe = /\s*/;
var spaceRe = /\s+/;
var equalsRe = /\s*=/;
var curlyRe = /\s*\}/;
var tagRe = /#|\^|\/|>|\{|&|=|!/;
/**
* Breaks up the given `template` string into a tree of tokens. If the `tags`
* argument is given here it must be an array with two string values: the
* opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of
* course, the default is to use mustaches (i.e. mustache.tags).
*
* A token is an array with at least 4 elements. The first element is the
* mustache symbol that was used inside the tag, e.g. "#" or "&". If the tag
* did not contain a symbol (i.e. {{myValue}}) this element is "name". For
* all text that appears outside a symbol this element is "text".
*
* The second element of a token is its "value". For mustache tags this is
* whatever else was inside the tag besides the opening symbol. For text tokens
* this is the text itself.
*
* The third and fourth elements of the token are the start and end indices,
* respectively, of the token in the original template.
*
* Tokens that are the root node of a subtree contain two more elements: 1) an
* array of tokens in the subtree and 2) the index in the original template at
* which the closing tag for that section begins.
*/
function parseTemplate (template, tags) {
if (!template)
return [];
var sections = []; // Stack to hold section tokens
var tokens = []; // Buffer to hold the tokens
var spaces = []; // Indices of whitespace tokens on the current line
var hasTag = false; // Is there a {{tag}} on the current line?
var nonSpace = false; // Is there a non-space char on the current line?
// Strips all whitespace tokens array for the current line
// if there was a {{#tag}} on it and otherwise only space.
function stripSpace () {
if (hasTag && !nonSpace) {
while (spaces.length)
delete tokens[spaces.pop()];
} else {
spaces = [];
}
hasTag = false;
nonSpace = false;
}
var openingTagRe, closingTagRe, closingCurlyRe;
function compileTags (tagsToCompile) {
if (typeof tagsToCompile === 'string')
tagsToCompile = tagsToCompile.split(spaceRe, 2);
if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
throw new Error('Invalid tags: ' + tagsToCompile);
openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\s*');
closingTagRe = new RegExp('\\s*' + escapeRegExp(tagsToCompile[1]));
closingCurlyRe = new RegExp('\\s*' + escapeRegExp('}' + tagsToCompile[1]));
}
compileTags(tags || mustache.tags);
var scanner = new Scanner(template);
var start, type, value, chr, token, openSection;
while (!scanner.eos()) {
start = scanner.pos;
// Match any text between tags.
value = scanner.scanUntil(openingTagRe);
if (value) {
for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
chr = value.charAt(i);
if (isWhitespace(chr)) {
spaces.push(tokens.length);
} else {
nonSpace = true;
}
tokens.push([ 'text', chr, start, start + 1 ]);
start += 1;
// Check for whitespace on the current line.
if (chr === '\n')
stripSpace();
}
}
// Match the opening tag.
if (!scanner.scan(openingTagRe))
break;
hasTag = true;
// Get the tag type.
type = scanner.scan(tagRe) || 'name';
scanner.scan(whiteRe);
// Get the tag value.
if (type === '=') {
value = scanner.scanUntil(equalsRe);
scanner.scan(equalsRe);
scanner.scanUntil(closingTagRe);
} else if (type === '{') {
value = scanner.scanUntil(closingCurlyRe);
scanner.scan(curlyRe);
scanner.scanUntil(closingTagRe);
type = '&';
} else {
value = scanner.scanUntil(closingTagRe);
}
// Match the closing tag.
if (!scanner.scan(closingTagRe))
throw new Error('Unclosed tag at ' + scanner.pos);
token = [ type, value, start, scanner.pos ];
tokens.push(token);
if (type === '#' || type === '^') {
sections.push(token);
} else if (type === '/') {
// Check section nesting.
openSection = sections.pop();
if (!openSection)
throw new Error('Unopened section "' + value + '" at ' + start);
if (openSection[1] !== value)
throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
} else if (type === 'name' || type === '{' || type === '&') {
nonSpace = true;
} else if (type === '=') {
// Set the tags for the next time around.
compileTags(value);
}
}
// Make sure there are no open sections when we're done.
openSection = sections.pop();
if (openSection)
throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
return nestTokens(squashTokens(tokens));
}
/**
* Combines the values of consecutive text tokens in the given `tokens` array
* to a single token.
*/
function squashTokens (tokens) {
var squashedTokens = [];
var token, lastToken;
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
token = tokens[i];
if (token) {
if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
lastToken[1] += token[1];
lastToken[3] = token[3];
} else {
squashedTokens.push(token);
lastToken = token;
}
}
}
return squashedTokens;
}
/**
* Forms the given array of `tokens` into a nested tree structure where
* tokens that represent a section have two additional items: 1) an array of
* all tokens that appear in that section and 2) the index in the original
* template that represents the end of that section.
*/
function nestTokens (tokens) {
var nestedTokens = [];
var collector = nestedTokens;
var sections = [];
var token, section;
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
token = tokens[i];
switch (token[0]) {
case '#':
case '^':
collector.push(token);
sections.push(token);
collector = token[4] = [];
break;
case '/':
section = sections.pop();
section[5] = token[2];
collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
break;
default:
collector.push(token);
}
}
return nestedTokens;
}
/**
* A simple string scanner that is used by the template parser to find
* tokens in template strings.
*/
function Scanner (string) {
this.string = string;
this.tail = string;
this.pos = 0;
}
/**
* Returns `true` if the tail is empty (end of string).
*/
Scanner.prototype.eos = function eos () {
return this.tail === '';
};
/**
* Tries to match the given regular expression at the current position.
* Returns the matched text if it can match, the empty string otherwise.
*/
Scanner.prototype.scan = function scan (re) {
var match = this.tail.match(re);
if (!match || match.index !== 0)
return '';
var string = match[0];
this.tail = this.tail.substring(string.length);
this.pos += string.length;
return string;
};
/**
* Skips all text until the given regular expression can be matched. Returns
* the skipped string, which is the entire tail if no match can be made.
*/
Scanner.prototype.scanUntil = function scanUntil (re) {
var index = this.tail.search(re), match;
switch (index) {
case -1:
match = this.tail;
this.tail = '';
break;
case 0:
match = '';
break;
default:
match = this.tail.substring(0, index);
this.tail = this.tail.substring(index);
}
this.pos += match.length;
return match;
};
/**
* Represents a rendering context by wrapping a view object and
* maintaining a reference to the parent context.
*/
function Context (view, parentContext) {
this.view = view;
this.cache = { '.': this.view };
this.parent = parentContext;
}
/**
* Creates a new context using the given view with this context
* as the parent.
*/
Context.prototype.push = function push (view) {
return new Context(view, this);
};
/**
* Returns the value of the given name in this context, traversing
* up the context hierarchy if the value is absent in this context's view.
*/
Context.prototype.lookup = function lookup (name) {
var cache = this.cache;
var value;
if (cache.hasOwnProperty(name)) {
value = cache[name];
} else {
var context = this, names, index, lookupHit = false;
while (context) {
if (name.indexOf('.') > 0) {
value = context.view;
names = name.split('.');
index = 0;
/**
* Using the dot notion path in `name`, we descend through the
* nested objects.
*
* To be certain that the lookup has been successful, we have to
* check if the last object in the path actually has the property
* we are looking for. We store the result in `lookupHit`.
*
* This is specially necessary for when the value has been set to
* `undefined` and we want to avoid looking up parent contexts.
**/
while (value != null && index < names.length) {
if (index === names.length - 1)
lookupHit = hasProperty(value, names[index]);
value = value[names[index++]];
}
} else {
value = context.view[name];
lookupHit = hasProperty(context.view, name);
}
if (lookupHit)
break;
context = context.parent;
}
cache[name] = value;
}
if (isFunction(value))
value = value.call(this.view);
return value;
};
/**
* A Writer knows how to take a stream of tokens and render them to a
* string, given a context. It also maintains a cache of templates to
* avoid the need to parse the same template twice.
*/
function Writer () {
this.cache = {};
}
/**
* Clears all cached templates in this writer.
*/
Writer.prototype.clearCache = function clearCache () {
this.cache = {};
};
/**
* Parses and caches the given `template` and returns the array of tokens
* that is generated from the parse.
*/
Writer.prototype.parse = function parse (template, tags) {
var cache = this.cache;
var tokens = cache[template];
if (tokens == null)
tokens = cache[template] = parseTemplate(template, tags);
return tokens;
};
/**
* High-level method that is used to render the given `template` with
* the given `view`.
*
* The optional `partials` argument may be an object that contains the
* names and templates of partials that are used in the template. It may
* also be a function that is used to load partial templates on the fly
* that takes a single argument: the name of the partial.
*/
Writer.prototype.render = function render (template, view, partials) {
var tokens = this.parse(template);
var context = (view instanceof Context) ? view : new Context(view);
return this.renderTokens(tokens, context, partials, template);
};
/**
* Low-level method that renders the given array of `tokens` using
* the given `context` and `partials`.
*
* Note: The `originalTemplate` is only ever used to extract the portion
* of the original template that was contained in a higher-order section.
* If the template doesn't use higher-order sections, this argument may
* be omitted.
*/
Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate) {
var buffer = '';
var token, symbol, value;
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
value = undefined;
token = tokens[i];
symbol = token[0];
if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate);
else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate);
else if (symbol === '>') value = this.renderPartial(token, context, partials, originalTemplate);
else if (symbol === '&') value = this.unescapedValue(token, context);
else if (symbol === 'name') value = this.escapedValue(token, context);
else if (symbol === 'text') value = this.rawValue(token);
if (value !== undefined)
buffer += value;
}
return buffer;
};
Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) {
var self = this;
var buffer = '';
var value = context.lookup(token[1]);
// This function is used to render an arbitrary template
// in the current context by higher-order sections.
function subRender (template) {
return self.render(template, context, partials);
}
if (!value) return;
if (isArray(value)) {
for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);
}
} else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {
buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);
} else if (isFunction(value)) {
if (typeof originalTemplate !== 'string')
throw new Error('Cannot use higher-order sections without the original template');
// Extract the portion of the original template that the section contains.
value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
if (value != null)
buffer += value;
} else {
buffer += this.renderTokens(token[4], context, partials, originalTemplate);
}
return buffer;
};
Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) {
var value = context.lookup(token[1]);
// Use JavaScript's definition of falsy. Include empty arrays.
// See https://github.com/janl/mustache.js/issues/186
if (!value || (isArray(value) && value.length === 0))
return this.renderTokens(token[4], context, partials, originalTemplate);
};
Writer.prototype.renderPartial = function renderPartial (token, context, partials) {
if (!partials) return;
var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
if (value != null)
return this.renderTokens(this.parse(value), context, partials, value);
};
Writer.prototype.unescapedValue = function unescapedValue (token, context) {
var value = context.lookup(token[1]);
if (value != null)
return value;
};
Writer.prototype.escapedValue = function escapedValue (token, context) {
var value = context.lookup(token[1]);
if (value != null)
return mustache.escape(value);
};
Writer.prototype.rawValue = function rawValue (token) {
return token[1];
};
mustache.name = 'mustache.js';
mustache.version = '2.3.0';
mustache.tags = [ '{{', '}}' ];
// All high-level mustache.* functions use this writer.
var defaultWriter = new Writer();
/**
* Clears all cached templates in the default writer.
*/
mustache.clearCache = function clearCache () {
return defaultWriter.clearCache();
};
/**
* Parses and caches the given template in the default writer and returns the
* array of tokens it contains. Doing this ahead of time avoids the need to
* parse templates on the fly as they are rendered.
*/
mustache.parse = function parse (template, tags) {
return defaultWriter.parse(template, tags);
};
/**
* Renders the `template` with the given `view` and `partials` using the
* default writer.
*/
mustache.render = function render (template, view, partials) {
if (typeof template !== 'string') {
throw new TypeError('Invalid template! Template should be a "string" ' +
'but "' + typeStr(template) + '" was given as the first ' +
'argument for mustache#render(template, view, partials)');
}
return defaultWriter.render(template, view, partials);
};
// This is here for backwards compatibility with 0.4.x.,
/*eslint-disable */ // eslint wants camel cased function name
mustache.to_html = function to_html (template, view, partials, send) {
/*eslint-enable*/
var result = mustache.render(template, view, partials);
if (isFunction(send)) {
send(result);
} else {
return result;
}
};
// Export the escaping function so that the user may override it.
// See https://github.com/janl/mustache.js/issues/244
mustache.escape = escapeHtml;
// Export these mainly for testing, but also for advanced usage.
mustache.Scanner = Scanner;
mustache.Context = Context;
mustache.Writer = Writer;
return mustache;
}));
/***/ }),
/* 177 */
/***/ (function(module, exports) {
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 === "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;
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _BoldCartDoctor = __webpack_require__(58);
var _BoldCartDoctor2 = _interopRequireDefault(_BoldCartDoctor);
var _BoldHelpers = __webpack_require__(59);
var _BoldHelpers2 = _interopRequireDefault(_BoldHelpers);
var _JSHelper = __webpack_require__(6);
var _JSHelper2 = _interopRequireDefault(_JSHelper);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_BoldHelpers2.default.load();
_JSHelper2.default.windowSet('BOLD.common.cartDoctor', new _BoldCartDoctor2.default(window.BOLD.common.Shopify.cart), true);
/***/ })
/******/ ]);