/*! * Webflow: Front-end site library * @license MIT * Inline scripts may access the api using an async handler: * var Webflow = Webflow || []; * Webflow.push(readyFunction); */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // 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 = 153); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var getOwnPropertyDescriptor = __webpack_require__(119).f; var hide = __webpack_require__(21); var redefine = __webpack_require__(120); var setGlobal = __webpack_require__(75); var copyConstructorProperties = __webpack_require__(229); var isForced = __webpack_require__(233); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { hide(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; /***/ }), /* 1 */ /***/ (function(module, exports) { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; /***/ }), /* 2 */ /***/ (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; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(26); var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // @wf-will-never-add-flow-to-this-file /* globals window, document, navigator, WEBFLOW_ENV_TEST */ /* eslint-disable no-var */ /** * Webflow: Core site library */ var Webflow = {}; var modules = {}; var primary = []; var secondary = window.Webflow || []; var $ = window.jQuery; var $win = $(window); var $doc = $(document); var isFunction = $.isFunction; var _ = Webflow._ = __webpack_require__(155); var tram = Webflow.tram = __webpack_require__(92) && $.tram; var domready = false; var destroyed = false; tram.config.hideBackface = false; tram.config.keepInherited = true; /** * Webflow.define - Define a named module * @param {string} name * @param {function} factory * @param {object} options * @return {object} */ Webflow.define = function (name, factory, options) { if (modules[name]) { unbindModule(modules[name]); } var instance = modules[name] = factory($, _, options) || {}; bindModule(instance); return instance; }; /** * Webflow.require - Require a named module * @param {string} name * @return {object} */ Webflow.require = function (name) { return modules[name]; }; function bindModule(module) { // If running in Webflow app, subscribe to design/preview events if (Webflow.env()) { isFunction(module.design) && $win.on('__wf_design', module.design); isFunction(module.preview) && $win.on('__wf_preview', module.preview); } // Subscribe to front-end destroy event isFunction(module.destroy) && $win.on('__wf_destroy', module.destroy); // Look for ready method on module if (module.ready && isFunction(module.ready)) { addReady(module); } } function addReady(module) { // If domready has already happened, run ready method if (domready) { module.ready(); return; } // Otherwise add ready method to the primary queue (only once) if (_.contains(primary, module.ready)) { return; } primary.push(module.ready); } function unbindModule(module) { // Unsubscribe module from window events isFunction(module.design) && $win.off('__wf_design', module.design); isFunction(module.preview) && $win.off('__wf_preview', module.preview); isFunction(module.destroy) && $win.off('__wf_destroy', module.destroy); // Remove ready method from primary queue if (module.ready && isFunction(module.ready)) { removeReady(module); } } function removeReady(module) { primary = _.filter(primary, function (readyFn) { return readyFn !== module.ready; }); } /** * Webflow.push - Add a ready handler into secondary queue * @param {function} ready Callback to invoke on domready */ Webflow.push = function (ready) { // If domready has already happened, invoke handler if (domready) { isFunction(ready) && ready(); return; } // Otherwise push into secondary queue secondary.push(ready); }; /** * Webflow.env - Get the state of the Webflow app * @param {string} mode [optional] * @return {boolean} */ Webflow.env = function (mode) { var designFlag = window.__wf_design; var inApp = typeof designFlag !== 'undefined'; if (!mode) { return inApp; } if (mode === 'design') { return inApp && designFlag; } if (mode === 'preview') { return inApp && !designFlag; } if (mode === 'slug') { return inApp && window.__wf_slug; } if (mode === 'editor') { return window.WebflowEditor; } if (mode === 'test') { return false || window.__wf_test; } if (mode === 'frame') { return window !== window.top; } }; // Feature detects + browser sniffs ಠ_ಠ var userAgent = navigator.userAgent.toLowerCase(); var touch = Webflow.env.touch = 'ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch; var chrome = Webflow.env.chrome = /chrome/.test(userAgent) && /Google/.test(navigator.vendor) && parseInt(userAgent.match(/chrome\/(\d+)\./)[1], 10); var ios = Webflow.env.ios = /(ipod|iphone|ipad)/.test(userAgent); Webflow.env.safari = /safari/.test(userAgent) && !chrome && !ios; // Maintain current touch target to prevent late clicks on touch devices var touchTarget; // Listen for both events to support touch/mouse hybrid devices touch && $doc.on('touchstart mousedown', function (evt) { touchTarget = evt.target; }); /** * Webflow.validClick - validate click target against current touch target * @param {HTMLElement} clickTarget Element being clicked * @return {Boolean} True if click target is valid (always true on non-touch) */ Webflow.validClick = touch ? function (clickTarget) { return clickTarget === touchTarget || $.contains(clickTarget, touchTarget); } : function () { return true; }; /** * Webflow.resize, Webflow.scroll - throttled event proxies */ var resizeEvents = 'resize.webflow orientationchange.webflow load.webflow'; var scrollEvents = 'scroll.webflow ' + resizeEvents; Webflow.resize = eventProxy($win, resizeEvents); Webflow.scroll = eventProxy($win, scrollEvents); Webflow.redraw = eventProxy(); // Create a proxy instance for throttled events function eventProxy(target, types) { // Set up throttled method (using custom frame-based _.throttle) var handlers = []; var proxy = {}; proxy.up = _.throttle(function (evt) { _.each(handlers, function (h) { h(evt); }); }); // Bind events to target if (target && types) { target.on(types, proxy.up); } /** * Add an event handler * @param {function} handler */ proxy.on = function (handler) { if (typeof handler !== 'function') { return; } if (_.contains(handlers, handler)) { return; } handlers.push(handler); }; /** * Remove an event handler * @param {function} handler */ proxy.off = function (handler) { // If no arguments supplied, clear all handlers if (!arguments.length) { handlers = []; return; } // Otherwise, remove handler from the list handlers = _.filter(handlers, function (h) { return h !== handler; }); }; return proxy; } // Webflow.location - Wrap window.location in api Webflow.location = function (url) { window.location = url; }; if (Webflow.env()) { // Ignore redirects inside a Webflow design/edit environment Webflow.location = function () {}; } // Webflow.ready - Call primary and secondary handlers Webflow.ready = function () { domready = true; // Restore modules after destroy if (destroyed) { restoreModules(); // Otherwise run primary ready methods } else { _.each(primary, callReady); } // Run secondary ready methods _.each(secondary, callReady); // Trigger resize Webflow.resize.up(); }; function callReady(readyFn) { isFunction(readyFn) && readyFn(); } function restoreModules() { destroyed = false; _.each(modules, bindModule); } /** * Webflow.load - Add a window load handler that will run even if load event has already happened * @param {function} handler */ var deferLoad; Webflow.load = function (handler) { deferLoad.then(handler); }; function bindLoad() { // Reject any previous deferred (to support destroy) if (deferLoad) { deferLoad.reject(); $win.off('load', deferLoad.resolve); } // Create deferred and bind window load event deferLoad = new $.Deferred(); $win.on('load', deferLoad.resolve); } // Webflow.destroy - Trigger a destroy event for all modules Webflow.destroy = function (options) { options = options || {}; destroyed = true; $win.triggerHandler('__wf_destroy'); // Allow domready reset for tests if (options.domready != null) { domready = options.domready; } // Unbind modules _.each(modules, unbindModule); // Clear any proxy event handlers Webflow.resize.off(); Webflow.scroll.off(); Webflow.redraw.off(); // Clear any queued ready methods primary = []; secondary = []; // If load event has not yet fired, replace the deferred if (deferLoad.state() === 'pending') { bindLoad(); } }; // Listen for domready $(Webflow.ready); // Listen for window.onload and resolve deferred bindLoad(); // Export commonjs module module.exports = window.Webflow = Webflow; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var requireObjectCoercible = __webpack_require__(73); // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var shared = __webpack_require__(53); var uid = __webpack_require__(117); var NATIVE_SYMBOL = __webpack_require__(236); var Symbol = global.Symbol; var store = shared('wks'); module.exports = function (name) { return store[name] || (store[name] = NATIVE_SYMBOL && Symbol[name] || (NATIVE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__(40); Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { IX2EngineActionTypes: true, IX2EngineConstants: true }; exports.IX2EngineConstants = exports.IX2EngineActionTypes = void 0; var _triggerEvents = __webpack_require__(302); Object.keys(_triggerEvents).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _triggerEvents[key]; } }); }); var _animationActions = __webpack_require__(303); Object.keys(_animationActions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _animationActions[key]; } }); }); var _triggerInteractions = __webpack_require__(304); Object.keys(_triggerInteractions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _triggerInteractions[key]; } }); }); var IX2EngineActionTypes = _interopRequireWildcard(__webpack_require__(305)); exports.IX2EngineActionTypes = IX2EngineActionTypes; var IX2EngineConstants = _interopRequireWildcard(__webpack_require__(306)); exports.IX2EngineConstants = IX2EngineConstants; /***/ }), /* 8 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(97); /** 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; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var O = 'object'; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global == O && global) || // eslint-disable-next-line no-new-func Function('return this')(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(45))) /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(6); var create = __webpack_require__(125); var hide = __webpack_require__(21); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { hide(ArrayPrototype, UNSCOPABLES, create(null)); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /* 12 */ /***/ (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; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(8); module.exports = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !method || !fails(function () { // eslint-disable-next-line no-useless-call,no-throw-literal method.call(null, argument || function () { throw 1; }, 1); }); }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); // Thank's IE8 for his funny defineProperty module.exports = !fails(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(14); var IE8_DOM_DEFINE = __webpack_require__(115); var anObject = __webpack_require__(27); var toPrimitive = __webpack_require__(76); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 16 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 17 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { var baseMatches = __webpack_require__(159), baseMatchesProperty = __webpack_require__(213), identity = __webpack_require__(70), isArray = __webpack_require__(2), property = __webpack_require__(220); /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } module.exports = baseIteratee; /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { var baseIsNative = __webpack_require__(171), getValue = __webpack_require__(176); /** * 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; /***/ }), /* 20 */ /***/ (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; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(14); var definePropertyModule = __webpack_require__(15); var createPropertyDescriptor = __webpack_require__(54); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(55); var requireObjectCoercible = __webpack_require__(73); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { var bind = __webpack_require__(84); var IndexedObject = __webpack_require__(55); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var arraySpeciesCreate = __webpack_require__(37); var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push.call(target, value); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; module.exports = { // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach forEach: createMethod(0), // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map map: createMethod(1), // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter filter: createMethod(2), // `Array.prototype.some` method // https://tc39.github.io/ecma262/#sec-array.prototype.some some: createMethod(3), // `Array.prototype.every` method // https://tc39.github.io/ecma262/#sec-array.prototype.every every: createMethod(4), // `Array.prototype.find` method // https://tc39.github.io/ecma262/#sec-array.prototype.find find: createMethod(5), // `Array.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex findIndex: createMethod(6) }; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(32), getRawTag = __webpack_require__(172), objectToString = __webpack_require__(173); /** `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; /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(96), isLength = __webpack_require__(64); /** * 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; /***/ }), /* 26 */ /***/ (function(module, exports) { var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(16); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(80); // `IsArray` abstract operation // https://tc39.github.io/ecma262/#sec-isarray module.exports = Array.isArray || function isArray(arg) { return classof(arg) == 'Array'; }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__(40); Object.defineProperty(exports, "__esModule", { value: true }); exports.IX2VanillaUtils = exports.IX2VanillaPlugins = exports.IX2ElementsReducer = exports.IX2EasingUtils = exports.IX2Easings = exports.IX2BrowserSupport = void 0; var IX2BrowserSupport = _interopRequireWildcard(__webpack_require__(87)); exports.IX2BrowserSupport = IX2BrowserSupport; var IX2Easings = _interopRequireWildcard(__webpack_require__(138)); exports.IX2Easings = IX2Easings; var IX2EasingUtils = _interopRequireWildcard(__webpack_require__(140)); exports.IX2EasingUtils = IX2EasingUtils; var IX2ElementsReducer = _interopRequireWildcard(__webpack_require__(312)); exports.IX2ElementsReducer = IX2ElementsReducer; var IX2VanillaPlugins = _interopRequireWildcard(__webpack_require__(142)); exports.IX2VanillaPlugins = IX2VanillaPlugins; var IX2VanillaUtils = _interopRequireWildcard(__webpack_require__(314)); exports.IX2VanillaUtils = IX2VanillaUtils; /***/ }), /* 30 */ /***/ (function(module, exports) { function _extends() { module.exports = _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } module.exports = _extends; /***/ }), /* 31 */ /***/ (function(module, exports) { function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } module.exports = _defineProperty; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(9); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(52); /** 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; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(26); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /* 35 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toPrimitive = __webpack_require__(76); var definePropertyModule = __webpack_require__(15); var createPropertyDescriptor = __webpack_require__(54); module.exports = function (object, key, value) { var propertyKey = toPrimitive(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(16); var isArray = __webpack_require__(28); var wellKnownSymbol = __webpack_require__(6); var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.github.io/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray, length) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); var wellKnownSymbol = __webpack_require__(6); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { return !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // @wf-will-never-add-flow-to-this-file /* globals window, document */ /* eslint-disable no-var */ // eslint-disable-next-line strict var IXEvents = __webpack_require__(286); function dispatchCustomEvent(element, eventName) { var event = document.createEvent('CustomEvent'); event.initCustomEvent(eventName, true, true, null); element.dispatchEvent(event); } /** * Webflow: IX Event triggers for other modules */ var $ = window.jQuery; var api = {}; var namespace = '.w-ix'; var eventTriggers = { reset: function reset(i, el) { IXEvents.triggers.reset(i, el); }, intro: function intro(i, el) { IXEvents.triggers.intro(i, el); dispatchCustomEvent(el, 'COMPONENT_ACTIVE'); }, outro: function outro(i, el) { IXEvents.triggers.outro(i, el); dispatchCustomEvent(el, 'COMPONENT_INACTIVE'); } }; api.triggers = {}; api.types = { INTRO: 'w-ix-intro' + namespace, OUTRO: 'w-ix-outro' + namespace }; $.extend(api.triggers, eventTriggers); module.exports = api; /***/ }), /* 40 */ /***/ (function(module, exports) { function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } module.exports = _interopRequireWildcard; /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.clone = clone; exports.addLast = addLast; exports.addFirst = addFirst; exports.removeLast = removeLast; exports.removeFirst = removeFirst; exports.insert = insert; exports.removeAt = removeAt; exports.replaceAt = replaceAt; exports.getIn = getIn; exports.set = set; exports.setIn = setIn; exports.update = update; exports.updateIn = updateIn; exports.merge = merge; exports.mergeDeep = mergeDeep; exports.mergeIn = mergeIn; exports.omit = omit; exports.addDefaults = addDefaults; /*! * Timm * * Immutability helpers with fast reads and acceptable writes. * * @copyright Guillermo Grau Panea 2016 * @license MIT */ var INVALID_ARGS = 'INVALID_ARGS'; // =============================================== // ### Helpers // =============================================== function throwStr(msg) { throw new Error(msg); } function getKeysAndSymbols(obj) { var keys = Object.keys(obj); if (Object.getOwnPropertySymbols) { return keys.concat(Object.getOwnPropertySymbols(obj)); } return keys; } var hasOwnProperty = {}.hasOwnProperty; function clone(obj) { if (Array.isArray(obj)) return obj.slice(); var keys = getKeysAndSymbols(obj); var out = {}; for (var i = 0; i < keys.length; i++) { var key = keys[i]; out[key] = obj[key]; } return out; } function doMerge(fAddDefaults, fDeep, first) { var out = first; !(out != null) && throwStr( false ? undefined : INVALID_ARGS); var fChanged = false; for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { rest[_key - 3] = arguments[_key]; } for (var idx = 0; idx < rest.length; idx++) { var obj = rest[idx]; if (obj == null) continue; var keys = getKeysAndSymbols(obj); if (!keys.length) continue; for (var j = 0; j <= keys.length; j++) { var key = keys[j]; if (fAddDefaults && out[key] !== undefined) continue; var nextVal = obj[key]; if (fDeep && isObject(out[key]) && isObject(nextVal)) { nextVal = doMerge(fAddDefaults, fDeep, out[key], nextVal); } if (nextVal === undefined || nextVal === out[key]) continue; if (!fChanged) { fChanged = true; out = clone(out); } out[key] = nextVal; } } return out; } function isObject(o) { var type = typeof o === 'undefined' ? 'undefined' : _typeof(o); return o != null && (type === 'object' || type === 'function'); } // _deepFreeze = (obj) -> // Object.freeze obj // for key in Object.getOwnPropertyNames obj // val = obj[key] // if isObject(val) and not Object.isFrozen val // _deepFreeze val // obj // =============================================== // -- ### Arrays // =============================================== // -- #### addLast() // -- Returns a new array with an appended item or items. // -- // -- Usage: `addLast(array: Array, val: Array|T): Array` // -- // -- ```js // -- arr = ['a', 'b'] // -- arr2 = addLast(arr, 'c') // -- // ['a', 'b', 'c'] // -- arr2 === arr // -- // false // -- arr3 = addLast(arr, ['c', 'd']) // -- // ['a', 'b', 'c', 'd'] // -- ``` // `array.concat(val)` also handles the scalar case, // but is apparently very slow function addLast(array, val) { if (Array.isArray(val)) return array.concat(val); return array.concat([val]); } // -- #### addFirst() // -- Returns a new array with a prepended item or items. // -- // -- Usage: `addFirst(array: Array, val: Array|T): Array` // -- // -- ```js // -- arr = ['a', 'b'] // -- arr2 = addFirst(arr, 'c') // -- // ['c', 'a', 'b'] // -- arr2 === arr // -- // false // -- arr3 = addFirst(arr, ['c', 'd']) // -- // ['c', 'd', 'a', 'b'] // -- ``` function addFirst(array, val) { if (Array.isArray(val)) return val.concat(array); return [val].concat(array); } // -- #### removeLast() // -- Returns a new array removing the last item. // -- // -- Usage: `removeLast(array: Array): Array` // -- // -- ```js // -- arr = ['a', 'b'] // -- arr2 = removeLast(arr) // -- // ['a'] // -- arr2 === arr // -- // false // -- // -- // The same array is returned if there are no changes: // -- arr3 = [] // -- removeLast(arr3) === arr3 // -- // true // -- ``` function removeLast(array) { if (!array.length) return array; return array.slice(0, array.length - 1); } // -- #### removeFirst() // -- Returns a new array removing the first item. // -- // -- Usage: `removeFirst(array: Array): Array` // -- // -- ```js // -- arr = ['a', 'b'] // -- arr2 = removeFirst(arr) // -- // ['b'] // -- arr2 === arr // -- // false // -- // -- // The same array is returned if there are no changes: // -- arr3 = [] // -- removeFirst(arr3) === arr3 // -- // true // -- ``` function removeFirst(array) { if (!array.length) return array; return array.slice(1); } // -- #### insert() // -- Returns a new array obtained by inserting an item or items // -- at a specified index. // -- // -- Usage: `insert(array: Array, idx: number, val: Array|T): Array` // -- // -- ```js // -- arr = ['a', 'b', 'c'] // -- arr2 = insert(arr, 1, 'd') // -- // ['a', 'd', 'b', 'c'] // -- arr2 === arr // -- // false // -- insert(arr, 1, ['d', 'e']) // -- // ['a', 'd', 'e', 'b', 'c'] // -- ``` function insert(array, idx, val) { return array.slice(0, idx).concat(Array.isArray(val) ? val : [val]).concat(array.slice(idx)); } // -- #### removeAt() // -- Returns a new array obtained by removing an item at // -- a specified index. // -- // -- Usage: `removeAt(array: Array, idx: number): Array` // -- // -- ```js // -- arr = ['a', 'b', 'c'] // -- arr2 = removeAt(arr, 1) // -- // ['a', 'c'] // -- arr2 === arr // -- // false // -- // -- // The same array is returned if there are no changes: // -- removeAt(arr, 4) === arr // -- // true // -- ``` function removeAt(array, idx) { if (idx >= array.length || idx < 0) return array; return array.slice(0, idx).concat(array.slice(idx + 1)); } // -- #### replaceAt() // -- Returns a new array obtained by replacing an item at // -- a specified index. If the provided item is the same as // -- (*referentially equal to*) the previous item at that position, // -- the original array is returned. // -- // -- Usage: `replaceAt(array: Array, idx: number, newItem: T): Array` // -- // -- ```js // -- arr = ['a', 'b', 'c'] // -- arr2 = replaceAt(arr, 1, 'd') // -- // ['a', 'd', 'c'] // -- arr2 === arr // -- // false // -- // -- // The same object is returned if there are no changes: // -- replaceAt(arr, 1, 'b') === arr // -- // true // -- ``` function replaceAt(array, idx, newItem) { if (array[idx] === newItem) return array; var len = array.length; var result = Array(len); for (var i = 0; i < len; i++) { result[i] = array[i]; } result[idx] = newItem; return result; } // =============================================== // -- ### Collections (objects and arrays) // =============================================== // -- The following types are used throughout this section // -- ```js // -- type ArrayOrObject = Array|Object; // -- type Key = number|string; // -- ``` // -- #### getIn() // -- Returns a value from an object at a given path. Works with // -- nested arrays and objects. If the path does not exist, it returns // -- `undefined`. // -- // -- Usage: `getIn(obj: ?ArrayOrObject, path: Array): any` // -- // -- ```js // -- obj = { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: ['a', 'b', 'c'] } // -- getIn(obj, ['d', 'd1']) // -- // 3 // -- getIn(obj, ['e', 1]) // -- // 'b' // -- ``` function getIn(obj, path) { !Array.isArray(path) && throwStr( false ? undefined : INVALID_ARGS); if (obj == null) return undefined; var ptr = obj; for (var i = 0; i < path.length; i++) { var key = path[i]; ptr = ptr != null ? ptr[key] : undefined; if (ptr === undefined) return ptr; } return ptr; } // -- #### set() // -- Returns a new object with a modified attribute. // -- If the provided value is the same as (*referentially equal to*) // -- the previous value, the original object is returned. // -- // -- Usage: `set(obj: ?T, key: Key, val: any): T` // -- // -- ```js // -- obj = { a: 1, b: 2, c: 3 } // -- obj2 = set(obj, 'b', 5) // -- // { a: 1, b: 5, c: 3 } // -- obj2 === obj // -- // false // -- // -- // The same object is returned if there are no changes: // -- set(obj, 'b', 2) === obj // -- // true // -- ``` function set(obj, key, val) { var fallback = typeof key === 'number' ? [] : {}; var finalObj = obj == null ? fallback : obj; if (finalObj[key] === val) return finalObj; var obj2 = clone(finalObj); obj2[key] = val; return obj2; } // -- #### setIn() // -- Returns a new object with a modified **nested** attribute. // -- // -- Notes: // -- // -- * If the provided value is the same as (*referentially equal to*) // -- the previous value, the original object is returned. // -- * If the path does not exist, it will be created before setting // -- the new value. // -- // -- Usage: `setIn(obj: T, path: Array, val: any): T` // -- // -- ```js // -- obj = { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: { e1: 'foo', e2: 'bar' } } // -- obj2 = setIn(obj, ['d', 'd1'], 4) // -- // { a: 1, b: 2, d: { d1: 4, d2: 4 }, e: { e1: 'foo', e2: 'bar' } } // -- obj2 === obj // -- // false // -- obj2.d === obj.d // -- // false // -- obj2.e === obj.e // -- // true // -- // -- // The same object is returned if there are no changes: // -- obj3 = setIn(obj, ['d', 'd1'], 3) // -- // { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: { e1: 'foo', e2: 'bar' } } // -- obj3 === obj // -- // true // -- obj3.d === obj.d // -- // true // -- obj3.e === obj.e // -- // true // -- // -- // ... unknown paths create intermediate keys. Numeric segments are treated as array indices: // -- setIn({ a: 3 }, ['unknown', 0, 'path'], 4) // -- // { a: 3, unknown: [{ path: 4 }] } // -- ``` function doSetIn(obj, path, val, idx) { var newValue = void 0; var key = path[idx]; if (idx === path.length - 1) { newValue = val; } else { var nestedObj = isObject(obj) && isObject(obj[key]) ? obj[key] : typeof path[idx + 1] === 'number' ? [] : {}; newValue = doSetIn(nestedObj, path, val, idx + 1); } return set(obj, key, newValue); } function setIn(obj, path, val) { if (!path.length) return val; return doSetIn(obj, path, val, 0); } // -- #### update() // -- Returns a new object with a modified attribute, // -- calculated via a user-provided callback based on the current value. // -- If the calculated value is the same as (*referentially equal to*) // -- the previous value, the original object is returned. // -- // -- Usage: `update(obj: T, key: Key, // -- fnUpdate: (prevValue: any) => any): T` // -- // -- ```js // -- obj = { a: 1, b: 2, c: 3 } // -- obj2 = update(obj, 'b', (val) => val + 1) // -- // { a: 1, b: 3, c: 3 } // -- obj2 === obj // -- // false // -- // -- // The same object is returned if there are no changes: // -- update(obj, 'b', (val) => val) === obj // -- // true // -- ``` function update(obj, key, fnUpdate) { var prevVal = obj == null ? undefined : obj[key]; var nextVal = fnUpdate(prevVal); return set(obj, key, nextVal); } // -- #### updateIn() // -- Returns a new object with a modified **nested** attribute, // -- calculated via a user-provided callback based on the current value. // -- If the calculated value is the same as (*referentially equal to*) // -- the previous value, the original object is returned. // -- // -- Usage: `updateIn(obj: T, path: Array, // -- fnUpdate: (prevValue: any) => any): T` // -- // -- ```js // -- obj = { a: 1, d: { d1: 3, d2: 4 } } // -- obj2 = updateIn(obj, ['d', 'd1'], (val) => val + 1) // -- // { a: 1, d: { d1: 4, d2: 4 } } // -- obj2 === obj // -- // false // -- // -- // The same object is returned if there are no changes: // -- obj3 = updateIn(obj, ['d', 'd1'], (val) => val) // -- // { a: 1, d: { d1: 3, d2: 4 } } // -- obj3 === obj // -- // true // -- ``` function updateIn(obj, path, fnUpdate) { var prevVal = getIn(obj, path); var nextVal = fnUpdate(prevVal); return setIn(obj, path, nextVal); } // -- #### merge() // -- Returns a new object built as follows: the overlapping keys from the // -- second one overwrite the corresponding entries from the first one. // -- Similar to `Object.assign()`, but immutable. // -- // -- Usage: // -- // -- * `merge(obj1: Object, obj2: ?Object): Object` // -- * `merge(obj1: Object, ...objects: Array): Object` // -- // -- The unmodified `obj1` is returned if `obj2` does not *provide something // -- new to* `obj1`, i.e. if either of the following // -- conditions are true: // -- // -- * `obj2` is `null` or `undefined` // -- * `obj2` is an object, but it is empty // -- * All attributes of `obj2` are `undefined` // -- * All attributes of `obj2` are referentially equal to the // -- corresponding attributes of `obj1` // -- // -- Note that `undefined` attributes in `obj2` do not modify the // -- corresponding attributes in `obj1`. // -- // -- ```js // -- obj1 = { a: 1, b: 2, c: 3 } // -- obj2 = { c: 4, d: 5 } // -- obj3 = merge(obj1, obj2) // -- // { a: 1, b: 2, c: 4, d: 5 } // -- obj3 === obj1 // -- // false // -- // -- // The same object is returned if there are no changes: // -- merge(obj1, { c: 3 }) === obj1 // -- // true // -- ``` function merge(a, b, c, d, e, f) { for (var _len2 = arguments.length, rest = Array(_len2 > 6 ? _len2 - 6 : 0), _key2 = 6; _key2 < _len2; _key2++) { rest[_key2 - 6] = arguments[_key2]; } return rest.length ? doMerge.call.apply(doMerge, [null, false, false, a, b, c, d, e, f].concat(rest)) : doMerge(false, false, a, b, c, d, e, f); } // -- #### mergeDeep() // -- Returns a new object built as follows: the overlapping keys from the // -- second one overwrite the corresponding entries from the first one. // -- If both the first and second entries are objects they are merged recursively. // -- Similar to `Object.assign()`, but immutable, and deeply merging. // -- // -- Usage: // -- // -- * `mergeDeep(obj1: Object, obj2: ?Object): Object` // -- * `mergeDeep(obj1: Object, ...objects: Array): Object` // -- // -- The unmodified `obj1` is returned if `obj2` does not *provide something // -- new to* `obj1`, i.e. if either of the following // -- conditions are true: // -- // -- * `obj2` is `null` or `undefined` // -- * `obj2` is an object, but it is empty // -- * All attributes of `obj2` are `undefined` // -- * All attributes of `obj2` are referentially equal to the // -- corresponding attributes of `obj1` // -- // -- Note that `undefined` attributes in `obj2` do not modify the // -- corresponding attributes in `obj1`. // -- // -- ```js // -- obj1 = { a: 1, b: 2, c: { a: 1 } } // -- obj2 = { b: 3, c: { b: 2 } } // -- obj3 = mergeDeep(obj1, obj2) // -- // { a: 1, b: 3, c: { a: 1, b: 2 } } // -- obj3 === obj1 // -- // false // -- // -- // The same object is returned if there are no changes: // -- mergeDeep(obj1, { c: { a: 1 } }) === obj1 // -- // true // -- ``` function mergeDeep(a, b, c, d, e, f) { for (var _len3 = arguments.length, rest = Array(_len3 > 6 ? _len3 - 6 : 0), _key3 = 6; _key3 < _len3; _key3++) { rest[_key3 - 6] = arguments[_key3]; } return rest.length ? doMerge.call.apply(doMerge, [null, false, true, a, b, c, d, e, f].concat(rest)) : doMerge(false, true, a, b, c, d, e, f); } // -- #### mergeIn() // -- Similar to `merge()`, but merging the value at a given nested path. // -- Note that the returned type is the same as that of the first argument. // -- // -- Usage: // -- // -- * `mergeIn(obj1: T, path: Array, obj2: ?Object): T` // -- * `mergeIn(obj1: T, path: Array, // -- ...objects: Array): T` // -- // -- ```js // -- obj1 = { a: 1, d: { b: { d1: 3, d2: 4 } } } // -- obj2 = { d3: 5 } // -- obj3 = mergeIn(obj1, ['d', 'b'], obj2) // -- // { a: 1, d: { b: { d1: 3, d2: 4, d3: 5 } } } // -- obj3 === obj1 // -- // false // -- // -- // The same object is returned if there are no changes: // -- mergeIn(obj1, ['d', 'b'], { d2: 4 }) === obj1 // -- // true // -- ``` function mergeIn(a, path, b, c, d, e, f) { var prevVal = getIn(a, path); if (prevVal == null) prevVal = {}; var nextVal = void 0; for (var _len4 = arguments.length, rest = Array(_len4 > 7 ? _len4 - 7 : 0), _key4 = 7; _key4 < _len4; _key4++) { rest[_key4 - 7] = arguments[_key4]; } if (rest.length) { nextVal = doMerge.call.apply(doMerge, [null, false, false, prevVal, b, c, d, e, f].concat(rest)); } else { nextVal = doMerge(false, false, prevVal, b, c, d, e, f); } return setIn(a, path, nextVal); } // -- #### omit() // -- Returns an object excluding one or several attributes. // -- // -- Usage: `omit(obj: Object, attrs: Array|string): Object` // // -- ```js // -- obj = { a: 1, b: 2, c: 3, d: 4 } // -- omit(obj, 'a') // -- // { b: 2, c: 3, d: 4 } // -- omit(obj, ['b', 'c']) // -- // { a: 1, d: 4 } // -- // -- // The same object is returned if there are no changes: // -- omit(obj, 'z') === obj1 // -- // true // -- ``` function omit(obj, attrs) { var omitList = Array.isArray(attrs) ? attrs : [attrs]; var fDoSomething = false; for (var i = 0; i < omitList.length; i++) { if (hasOwnProperty.call(obj, omitList[i])) { fDoSomething = true; break; } } if (!fDoSomething) return obj; var out = {}; var keys = getKeysAndSymbols(obj); for (var _i = 0; _i < keys.length; _i++) { var key = keys[_i]; if (omitList.indexOf(key) >= 0) continue; out[key] = obj[key]; } return out; } // -- #### addDefaults() // -- Returns a new object built as follows: `undefined` keys in the first one // -- are filled in with the corresponding values from the second one // -- (even if they are `null`). // -- // -- Usage: // -- // -- * `addDefaults(obj: Object, defaults: Object): Object` // -- * `addDefaults(obj: Object, ...defaultObjects: Array): Object` // -- // -- ```js // -- obj1 = { a: 1, b: 2, c: 3 } // -- obj2 = { c: 4, d: 5, e: null } // -- obj3 = addDefaults(obj1, obj2) // -- // { a: 1, b: 2, c: 3, d: 5, e: null } // -- obj3 === obj1 // -- // false // -- // -- // The same object is returned if there are no changes: // -- addDefaults(obj1, { c: 4 }) === obj1 // -- // true // -- ``` function addDefaults(a, b, c, d, e, f) { for (var _len5 = arguments.length, rest = Array(_len5 > 6 ? _len5 - 6 : 0), _key5 = 6; _key5 < _len5; _key5++) { rest[_key5 - 6] = arguments[_key5]; } return rest.length ? doMerge.call.apply(doMerge, [null, true, false, a, b, c, d, e, f].concat(rest)) : doMerge(true, false, a, b, c, d, e, f); } // =============================================== // ### Public API // =============================================== var timm = { clone: clone, addLast: addLast, addFirst: addFirst, removeLast: removeLast, removeFirst: removeFirst, insert: insert, removeAt: removeAt, replaceAt: replaceAt, getIn: getIn, // eslint-disable-next-line object-shorthand set: set, // so that flow doesn't complain setIn: setIn, update: update, updateIn: updateIn, merge: merge, mergeDeep: mergeDeep, mergeIn: mergeIn, omit: omit, addDefaults: addDefaults }; exports.default = timm; /***/ }), /* 42 */ /***/ (function(module, exports) { function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } function _typeof(obj) { if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { module.exports = _typeof = function _typeof(obj) { return _typeof2(obj); }; } else { module.exports = _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); }; } return _typeof(obj); } module.exports = _typeof; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__(161), listCacheDelete = __webpack_require__(162), listCacheGet = __webpack_require__(163), listCacheHas = __webpack_require__(164), listCacheSet = __webpack_require__(165); /** * 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; /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(57); /** * 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; /***/ }), /* 45 */ /***/ (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 || new Function("return 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; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(185); /** * 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; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { var arrayLikeKeys = __webpack_require__(104), baseKeys = __webpack_require__(65), isArrayLike = __webpack_require__(25); /** * 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; /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(203), isObjectLike = __webpack_require__(20); /** 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; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(68); /** * 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; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(2), isKey = __webpack_require__(69), stringToPath = __webpack_require__(214), toString = __webpack_require__(110); /** * 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; /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(24), isObjectLike = __webpack_require__(20); /** `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; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var setGlobal = __webpack_require__(75); var IS_PURE = __webpack_require__(77); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.1.3', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 54 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); var classof = __webpack_require__(80); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; /***/ }), /* 56 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; /***/ }), /* 57 */ /***/ (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; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19), root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { var mapCacheClear = __webpack_require__(177), mapCacheDelete = __webpack_require__(184), mapCacheGet = __webpack_require__(186), mapCacheHas = __webpack_require__(187), mapCacheSet = __webpack_require__(188); /** * 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; /***/ }), /* 60 */ /***/ (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; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(9), stubFalse = __webpack_require__(204); /** Detect free variable `exports`. */ var freeExports = true && 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(this, __webpack_require__(105)(module))) /***/ }), /* 62 */ /***/ (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) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } module.exports = isIndex; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { var baseIsTypedArray = __webpack_require__(205), baseUnary = __webpack_require__(206), nodeUtil = __webpack_require__(207); /* 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; /***/ }), /* 64 */ /***/ (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; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { var isPrototype = __webpack_require__(66), nativeKeys = __webpack_require__(208); /** 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; /***/ }), /* 66 */ /***/ (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; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var DataView = __webpack_require__(209), Map = __webpack_require__(58), Promise = __webpack_require__(210), Set = __webpack_require__(211), WeakMap = __webpack_require__(107), baseGetTag = __webpack_require__(24), toSource = __webpack_require__(98); /** `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; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(51), toKey = __webpack_require__(33); /** * 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; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(2), isSymbol = __webpack_require__(52); /** 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; /***/ }), /* 70 */ /***/ (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; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { var toFinite = __webpack_require__(222); /** * 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; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(12), isSymbol = __webpack_require__(52); /** 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; /***/ }), /* 73 */ /***/ (function(module, exports) { // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var NATIVE_WEAK_MAP = __webpack_require__(227); var global = __webpack_require__(10); var isObject = __webpack_require__(16); var hide = __webpack_require__(21); var objectHas = __webpack_require__(17); var sharedKey = __webpack_require__(78); var hiddenKeys = __webpack_require__(79); var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP) { var store = new WeakMap(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { hide(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function (it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var hide = __webpack_require__(21); module.exports = function (key, value) { try { hide(global, key, value); } catch (error) { global[key] = value; } return value; }; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(16); // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 77 */ /***/ (function(module, exports) { module.exports = false; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(53); var uid = __webpack_require__(117); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /* 79 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 80 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(121); var global = __webpack_require__(10); var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { var toIndexedObject = __webpack_require__(22); var toLength = __webpack_require__(3); var toAbsoluteIndex = __webpack_require__(34); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /* 83 */ /***/ (function(module, exports) { // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__(56); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createStore; }); /* harmony import */ var lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(130); /* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(297); /** * These are private action types reserved by Redux. * For any unknown actions, you must return the current state. * If the current state is undefined, you must return the initial state. * Do not reference these action types directly in your code. */ var ActionTypes = { INIT: '@@redux/INIT' }; /** * Creates a Redux store that holds the state tree. * The only way to change the data in the store is to call `dispatch()` on it. * * There should only be a single store in your app. To specify how different * parts of the state tree respond to actions, you may combine several reducers * into a single reducer function by using `combineReducers`. * * @param {Function} reducer A function that returns the next state tree, given * the current state tree and the action to handle. * * @param {any} [preloadedState] The initial state. You may optionally specify it * to hydrate the state from the server in universal apps, or to restore a * previously serialized user session. * If you use `combineReducers` to produce the root reducer function, this must be * an object with the same shape as `combineReducers` keys. * * @param {Function} enhancer The store enhancer. You may optionally specify it * to enhance the store with third-party capabilities such as middleware, * time travel, persistence, etc. The only store enhancer that ships with Redux * is `applyMiddleware()`. * * @returns {Store} A Redux store that lets you read the state, dispatch actions * and subscribe to changes. */ function createStore(reducer, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { enhancer = preloadedState; preloadedState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, preloadedState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = preloadedState; var currentListeners = []; var nextListeners = currentListeners; var isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = currentListeners.slice(); } } /** * Reads the state tree managed by the store. * * @returns {any} The current state tree of your application. */ function getState() { return currentState; } /** * Adds a change listener. It will be called any time an action is dispatched, * and some part of the state tree may potentially have changed. You may then * call `getState()` to read the current state tree inside the callback. * * You may call `dispatch()` from a change listener, with the following * caveats: * * 1. The subscriptions are snapshotted just before every `dispatch()` call. * If you subscribe or unsubscribe while the listeners are being invoked, this * will not have any effect on the `dispatch()` that is currently in progress. * However, the next `dispatch()` call, whether nested or not, will use a more * recent snapshot of the subscription list. * * 2. The listener should not expect to see all state changes, as the state * might have been updated multiple times during a nested `dispatch()` before * the listener is called. It is, however, guaranteed that all subscribers * registered before the `dispatch()` started will be called with the latest * state by the time it exits. * * @param {Function} listener A callback to be invoked on every dispatch. * @returns {Function} A function to remove this change listener. */ function subscribe(listener) { if (typeof listener !== 'function') { throw new Error('Expected listener to be a function.'); } var isSubscribed = true; ensureCanMutateNextListeners(); nextListeners.push(listener); return function unsubscribe() { if (!isSubscribed) { return; } isSubscribed = false; ensureCanMutateNextListeners(); var index = nextListeners.indexOf(listener); nextListeners.splice(index, 1); }; } /** * Dispatches an action. It is the only way to trigger a state change. * * The `reducer` function, used to create the store, will be called with the * current state tree and the given `action`. Its return value will * be considered the **next** state of the tree, and the change listeners * will be notified. * * The base implementation only supports plain object actions. If you want to * dispatch a Promise, an Observable, a thunk, or something else, you need to * wrap your store creating function into the corresponding middleware. For * example, see the documentation for the `redux-thunk` package. Even the * middleware will eventually dispatch plain object actions using this method. * * @param {Object} action A plain object representing “what changed”. It is * a good idea to keep actions serializable so you can record and replay user * sessions, or use the time travelling `redux-devtools`. An action must have * a `type` property which may not be `undefined`. It is a good idea to use * string constants for action types. * * @returns {Object} For convenience, the same action object you dispatched. * * Note that, if you use a custom middleware, it may wrap `dispatch()` to * return something else (for example, a Promise you can await). */ function dispatch(action) { if (!Object(lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_0__["default"])(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); } if (isDispatching) { throw new Error('Reducers may not dispatch actions.'); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } var listeners = currentListeners = nextListeners; for (var i = 0; i < listeners.length; i++) { listeners[i](); } return action; } /** * Replaces the reducer currently used by the store to calculate the state. * * You might need this if your app implements code splitting and you want to * load some of the reducers dynamically. You might also need this if you * implement a hot reloading mechanism for Redux. * * @param {Function} nextReducer The reducer for the store to use instead. * @returns {void} */ function replaceReducer(nextReducer) { if (typeof nextReducer !== 'function') { throw new Error('Expected the nextReducer to be a function.'); } currentReducer = nextReducer; dispatch({ type: ActionTypes.INIT }); } /** * Interoperability point for observable/reactive libraries. * @returns {observable} A minimal observable of state changes. * For more information, see the observable proposal: * https://github.com/zenparsing/es-observable */ function observable() { var _ref; var outerSubscribe = subscribe; return _ref = { /** * The minimal observable subscription method. * @param {Object} observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns {subscription} An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe: function subscribe(observer) { if (typeof observer !== 'object') { throw new TypeError('Expected the observer to be an object.'); } function observeState() { if (observer.next) { observer.next(getState()); } } observeState(); var unsubscribe = outerSubscribe(observeState); return { unsubscribe: unsubscribe }; } }, _ref[symbol_observable__WEBPACK_IMPORTED_MODULE_1__["default"]] = function () { return this; }, _ref; } // When a store is created, an "INIT" action is dispatched so that every // reducer returns their initial state. This effectively populates // the initial state tree. dispatch({ type: ActionTypes.INIT }); return _ref2 = { dispatch: dispatch, subscribe: subscribe, getState: getState, replaceReducer: replaceReducer }, _ref2[symbol_observable__WEBPACK_IMPORTED_MODULE_1__["default"]] = observable, _ref2; } /***/ }), /* 86 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compose; }); /** * Composes single-argument functions from right to left. The rightmost * function can take multiple arguments as it provides the signature for * the resulting composite function. * * @param {...Function} funcs The functions to compose. * @returns {Function} A function obtained by composing the argument functions * from right to left. For example, compose(f, g, h) is identical to doing * (...args) => f(g(h(...args))). */ function compose() { for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function (arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } var last = funcs[funcs.length - 1]; var rest = funcs.slice(0, -1); return function () { return rest.reduceRight(function (composed, f) { return f(composed); }, last.apply(undefined, arguments)); }; } /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1); Object.defineProperty(exports, "__esModule", { value: true }); exports.TRANSFORM_STYLE_PREFIXED = exports.TRANSFORM_PREFIXED = exports.FLEX_PREFIXED = exports.ELEMENT_MATCHES = exports.withBrowser = exports.IS_BROWSER_ENV = void 0; var _find = _interopRequireDefault(__webpack_require__(136)); /* eslint-env browser */ var IS_BROWSER_ENV = typeof window !== 'undefined'; // $FlowFixMe exports.IS_BROWSER_ENV = IS_BROWSER_ENV; var withBrowser = function withBrowser(fn, fallback) { if (IS_BROWSER_ENV) { return fn(); } return fallback; }; exports.withBrowser = withBrowser; var ELEMENT_MATCHES = withBrowser(function () { return (0, _find["default"])(['matches', 'matchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector', 'webkitMatchesSelector'], function (key) { return key in Element.prototype; }); }); exports.ELEMENT_MATCHES = ELEMENT_MATCHES; var FLEX_PREFIXED = withBrowser(function () { var el = document.createElement('i'); var values = ['flex', '-webkit-flex', '-ms-flexbox', '-moz-box', '-webkit-box']; var none = ''; try { var length = values.length; for (var i = 0; i < length; i++) { var value = values[i]; el.style.display = value; if (el.style.display === value) { return value; } } return none; } catch (err) { return none; } }, 'flex'); exports.FLEX_PREFIXED = FLEX_PREFIXED; var TRANSFORM_PREFIXED = withBrowser(function () { var el = document.createElement('i'); if (el.style.transform == null) { var prefixes = ['Webkit', 'Moz', 'ms']; var suffix = 'Transform'; var length = prefixes.length; for (var i = 0; i < length; i++) { var prop = prefixes[i] + suffix; // $FlowFixMe if (el.style[prop] !== undefined) { return prop; } } } return 'transform'; }, 'transform'); // $FlowFixMe exports.TRANSFORM_PREFIXED = TRANSFORM_PREFIXED; var TRANSFORM_PREFIX = TRANSFORM_PREFIXED.split('transform')[0]; var TRANSFORM_STYLE_PREFIXED = TRANSFORM_PREFIX ? TRANSFORM_PREFIX + 'TransformStyle' : 'transformStyle'; exports.TRANSFORM_STYLE_PREFIXED = TRANSFORM_STYLE_PREFIXED; /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1); Object.defineProperty(exports, "__esModule", { value: true }); exports.mediaQueriesDefined = exports.viewportWidthChanged = exports.actionListPlaybackChanged = exports.elementStateChanged = exports.instanceRemoved = exports.instanceStarted = exports.instanceAdded = exports.parameterChanged = exports.animationFrameChanged = exports.eventStateChanged = exports.testFrameRendered = exports.eventListenerAdded = exports.clearRequested = exports.stopRequested = exports.playbackRequested = exports.previewRequested = exports.sessionStopped = exports.sessionStarted = exports.sessionInitialized = exports.rawDataImported = void 0; var _extends2 = _interopRequireDefault(__webpack_require__(30)); var _constants = __webpack_require__(7); var _shared = __webpack_require__(29); var _constants$IX2EngineA = _constants.IX2EngineActionTypes, IX2_RAW_DATA_IMPORTED = _constants$IX2EngineA.IX2_RAW_DATA_IMPORTED, IX2_SESSION_INITIALIZED = _constants$IX2EngineA.IX2_SESSION_INITIALIZED, IX2_SESSION_STARTED = _constants$IX2EngineA.IX2_SESSION_STARTED, IX2_SESSION_STOPPED = _constants$IX2EngineA.IX2_SESSION_STOPPED, IX2_PREVIEW_REQUESTED = _constants$IX2EngineA.IX2_PREVIEW_REQUESTED, IX2_PLAYBACK_REQUESTED = _constants$IX2EngineA.IX2_PLAYBACK_REQUESTED, IX2_STOP_REQUESTED = _constants$IX2EngineA.IX2_STOP_REQUESTED, IX2_CLEAR_REQUESTED = _constants$IX2EngineA.IX2_CLEAR_REQUESTED, IX2_EVENT_LISTENER_ADDED = _constants$IX2EngineA.IX2_EVENT_LISTENER_ADDED, IX2_TEST_FRAME_RENDERED = _constants$IX2EngineA.IX2_TEST_FRAME_RENDERED, IX2_EVENT_STATE_CHANGED = _constants$IX2EngineA.IX2_EVENT_STATE_CHANGED, IX2_ANIMATION_FRAME_CHANGED = _constants$IX2EngineA.IX2_ANIMATION_FRAME_CHANGED, IX2_PARAMETER_CHANGED = _constants$IX2EngineA.IX2_PARAMETER_CHANGED, IX2_INSTANCE_ADDED = _constants$IX2EngineA.IX2_INSTANCE_ADDED, IX2_INSTANCE_STARTED = _constants$IX2EngineA.IX2_INSTANCE_STARTED, IX2_INSTANCE_REMOVED = _constants$IX2EngineA.IX2_INSTANCE_REMOVED, IX2_ELEMENT_STATE_CHANGED = _constants$IX2EngineA.IX2_ELEMENT_STATE_CHANGED, IX2_ACTION_LIST_PLAYBACK_CHANGED = _constants$IX2EngineA.IX2_ACTION_LIST_PLAYBACK_CHANGED, IX2_VIEWPORT_WIDTH_CHANGED = _constants$IX2EngineA.IX2_VIEWPORT_WIDTH_CHANGED, IX2_MEDIA_QUERIES_DEFINED = _constants$IX2EngineA.IX2_MEDIA_QUERIES_DEFINED; var reifyState = _shared.IX2VanillaUtils.reifyState; // TODO: Figure out what this is and elevate it var rawDataImported = function rawDataImported(rawData) { return { type: IX2_RAW_DATA_IMPORTED, payload: (0, _extends2["default"])({}, reifyState(rawData)) }; }; exports.rawDataImported = rawDataImported; var sessionInitialized = function sessionInitialized(_ref) { var hasBoundaryNodes = _ref.hasBoundaryNodes; return { type: IX2_SESSION_INITIALIZED, payload: { hasBoundaryNodes: hasBoundaryNodes } }; }; exports.sessionInitialized = sessionInitialized; var sessionStarted = function sessionStarted() { return { type: IX2_SESSION_STARTED }; }; exports.sessionStarted = sessionStarted; var sessionStopped = function sessionStopped() { return { type: IX2_SESSION_STOPPED }; }; exports.sessionStopped = sessionStopped; var previewRequested = function previewRequested(_ref2) { var rawData = _ref2.rawData, defer = _ref2.defer; return { type: IX2_PREVIEW_REQUESTED, payload: { defer: defer, rawData: rawData } }; }; exports.previewRequested = previewRequested; var playbackRequested = function playbackRequested(_ref3) { var _ref3$actionTypeId = _ref3.actionTypeId, actionTypeId = _ref3$actionTypeId === void 0 ? _constants.ActionTypeConsts.GENERAL_START_ACTION : _ref3$actionTypeId, actionListId = _ref3.actionListId, actionItemId = _ref3.actionItemId, eventId = _ref3.eventId, allowEvents = _ref3.allowEvents, immediate = _ref3.immediate, testManual = _ref3.testManual, verbose = _ref3.verbose, rawData = _ref3.rawData; return { type: IX2_PLAYBACK_REQUESTED, payload: { actionTypeId: actionTypeId, actionListId: actionListId, actionItemId: actionItemId, testManual: testManual, eventId: eventId, allowEvents: allowEvents, immediate: immediate, verbose: verbose, rawData: rawData } }; }; exports.playbackRequested = playbackRequested; var stopRequested = function stopRequested(actionListId) { return { type: IX2_STOP_REQUESTED, payload: { actionListId: actionListId } }; }; exports.stopRequested = stopRequested; var clearRequested = function clearRequested() { return { type: IX2_CLEAR_REQUESTED }; }; exports.clearRequested = clearRequested; var eventListenerAdded = function eventListenerAdded(target, listenerParams) { return { type: IX2_EVENT_LISTENER_ADDED, payload: { target: target, listenerParams: listenerParams } }; }; exports.eventListenerAdded = eventListenerAdded; var testFrameRendered = function testFrameRendered() { var step = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; return { type: IX2_TEST_FRAME_RENDERED, payload: { step: step } }; }; exports.testFrameRendered = testFrameRendered; var eventStateChanged = function eventStateChanged(stateKey, newState) { return { type: IX2_EVENT_STATE_CHANGED, payload: { stateKey: stateKey, newState: newState } }; }; exports.eventStateChanged = eventStateChanged; var animationFrameChanged = function animationFrameChanged(now, parameters) { return { type: IX2_ANIMATION_FRAME_CHANGED, payload: { now: now, parameters: parameters } }; }; exports.animationFrameChanged = animationFrameChanged; var parameterChanged = function parameterChanged(key, value) { return { type: IX2_PARAMETER_CHANGED, payload: { key: key, value: value } }; }; exports.parameterChanged = parameterChanged; var instanceAdded = function instanceAdded(options) { return { type: IX2_INSTANCE_ADDED, payload: (0, _extends2["default"])({}, options) }; }; exports.instanceAdded = instanceAdded; var instanceStarted = function instanceStarted(instanceId, time) { return { type: IX2_INSTANCE_STARTED, payload: { instanceId: instanceId, time: time } }; }; exports.instanceStarted = instanceStarted; var instanceRemoved = function instanceRemoved(instanceId) { return { type: IX2_INSTANCE_REMOVED, payload: { instanceId: instanceId } }; }; exports.instanceRemoved = instanceRemoved; var elementStateChanged = function elementStateChanged(elementId, actionTypeId, current, actionItem) { return { type: IX2_ELEMENT_STATE_CHANGED, payload: { elementId: elementId, actionTypeId: actionTypeId, current: current, actionItem: actionItem } }; }; exports.elementStateChanged = elementStateChanged; var actionListPlaybackChanged = function actionListPlaybackChanged(_ref4) { var actionListId = _ref4.actionListId, isPlaying = _ref4.isPlaying; return { type: IX2_ACTION_LIST_PLAYBACK_CHANGED, payload: { actionListId: actionListId, isPlaying: isPlaying } }; }; exports.actionListPlaybackChanged = actionListPlaybackChanged; var viewportWidthChanged = function viewportWidthChanged(_ref5) { var width = _ref5.width, mediaQueries = _ref5.mediaQueries; return { type: IX2_VIEWPORT_WIDTH_CHANGED, payload: { width: width, mediaQueries: mediaQueries } }; }; exports.viewportWidthChanged = viewportWidthChanged; var mediaQueriesDefined = function mediaQueriesDefined() { return { type: IX2_MEDIA_QUERIES_DEFINED }; }; exports.mediaQueriesDefined = mediaQueriesDefined; /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(150), baseLodash = __webpack_require__(90); /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; module.exports = LodashWrapper; /***/ }), /* 90 */ /***/ (function(module, exports) { /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } module.exports = baseLodash; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__(150), baseLodash = __webpack_require__(90); /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; module.exports = LazyWrapper; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // @wf-will-never-add-flow-to-this-file /* eslint-disable eslint-comments/no-unlimited-disable */ /* eslint-disable */ /*! * tram.js v0.8.2-global * Cross-browser CSS3 transitions in JavaScript * https://github.com/bkwld/tram * MIT License */ /* prettier-ignore */ var _interopRequireDefault = __webpack_require__(1); var _typeof2 = _interopRequireDefault(__webpack_require__(42)); window.tram = function (a) { function b(a, b) { var c = new M.Bare(); return c.init(a, b); } function c(a) { return a.replace(/[A-Z]/g, function (a) { return "-" + a.toLowerCase(); }); } function d(a) { var b = parseInt(a.slice(1), 16), c = b >> 16 & 255, d = b >> 8 & 255, e = 255 & b; return [c, d, e]; } function e(a, b, c) { return "#" + (1 << 24 | a << 16 | b << 8 | c).toString(16).slice(1); } function f() {} function g(a, b) { j("Type warning: Expected: [" + a + "] Got: [" + (0, _typeof2["default"])(b) + "] " + b); } function h(a, b, c) { j("Units do not match [" + a + "]: " + b + ", " + c); } function i(a, b, c) { if (void 0 !== b && (c = b), void 0 === a) return c; var d = c; return $.test(a) || !_.test(a) ? d = parseInt(a, 10) : _.test(a) && (d = 1e3 * parseFloat(a)), 0 > d && (d = 0), d === d ? d : c; } function j(a) { U.debug && window && window.console.warn(a); } function k(a) { for (var b = -1, c = a ? a.length : 0, d = []; ++b < c;) { var e = a[b]; e && d.push(e); } return d; } var l = function (a, b, c) { function d(a) { return "object" == (0, _typeof2["default"])(a); } function e(a) { return "function" == typeof a; } function f() {} function g(h, i) { function j() { var a = new k(); return e(a.init) && a.init.apply(a, arguments), a; } function k() {} i === c && (i = h, h = Object), j.Bare = k; var l, m = f[a] = h[a], n = k[a] = j[a] = new f(); return n.constructor = j, j.mixin = function (b) { return k[a] = j[a] = g(j, b)[a], j; }, j.open = function (a) { if (l = {}, e(a) ? l = a.call(j, n, m, j, h) : d(a) && (l = a), d(l)) for (var c in l) { b.call(l, c) && (n[c] = l[c]); } return e(n.init) || (n.init = h), j; }, j.open(i); } return g; }("prototype", {}.hasOwnProperty), m = { ease: ["ease", function (a, b, c, d) { var e = (a /= d) * a, f = e * a; return b + c * (-2.75 * f * e + 11 * e * e + -15.5 * f + 8 * e + .25 * a); }], "ease-in": ["ease-in", function (a, b, c, d) { var e = (a /= d) * a, f = e * a; return b + c * (-1 * f * e + 3 * e * e + -3 * f + 2 * e); }], "ease-out": ["ease-out", function (a, b, c, d) { var e = (a /= d) * a, f = e * a; return b + c * (.3 * f * e + -1.6 * e * e + 2.2 * f + -1.8 * e + 1.9 * a); }], "ease-in-out": ["ease-in-out", function (a, b, c, d) { var e = (a /= d) * a, f = e * a; return b + c * (2 * f * e + -5 * e * e + 2 * f + 2 * e); }], linear: ["linear", function (a, b, c, d) { return c * a / d + b; }], "ease-in-quad": ["cubic-bezier(0.550, 0.085, 0.680, 0.530)", function (a, b, c, d) { return c * (a /= d) * a + b; }], "ease-out-quad": ["cubic-bezier(0.250, 0.460, 0.450, 0.940)", function (a, b, c, d) { return -c * (a /= d) * (a - 2) + b; }], "ease-in-out-quad": ["cubic-bezier(0.455, 0.030, 0.515, 0.955)", function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b; }], "ease-in-cubic": ["cubic-bezier(0.550, 0.055, 0.675, 0.190)", function (a, b, c, d) { return c * (a /= d) * a * a + b; }], "ease-out-cubic": ["cubic-bezier(0.215, 0.610, 0.355, 1)", function (a, b, c, d) { return c * ((a = a / d - 1) * a * a + 1) + b; }], "ease-in-out-cubic": ["cubic-bezier(0.645, 0.045, 0.355, 1)", function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a * a + b : c / 2 * ((a -= 2) * a * a + 2) + b; }], "ease-in-quart": ["cubic-bezier(0.895, 0.030, 0.685, 0.220)", function (a, b, c, d) { return c * (a /= d) * a * a * a + b; }], "ease-out-quart": ["cubic-bezier(0.165, 0.840, 0.440, 1)", function (a, b, c, d) { return -c * ((a = a / d - 1) * a * a * a - 1) + b; }], "ease-in-out-quart": ["cubic-bezier(0.770, 0, 0.175, 1)", function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a * a * a + b : -c / 2 * ((a -= 2) * a * a * a - 2) + b; }], "ease-in-quint": ["cubic-bezier(0.755, 0.050, 0.855, 0.060)", function (a, b, c, d) { return c * (a /= d) * a * a * a * a + b; }], "ease-out-quint": ["cubic-bezier(0.230, 1, 0.320, 1)", function (a, b, c, d) { return c * ((a = a / d - 1) * a * a * a * a + 1) + b; }], "ease-in-out-quint": ["cubic-bezier(0.860, 0, 0.070, 1)", function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a * a * a * a + b : c / 2 * ((a -= 2) * a * a * a * a + 2) + b; }], "ease-in-sine": ["cubic-bezier(0.470, 0, 0.745, 0.715)", function (a, b, c, d) { return -c * Math.cos(a / d * (Math.PI / 2)) + c + b; }], "ease-out-sine": ["cubic-bezier(0.390, 0.575, 0.565, 1)", function (a, b, c, d) { return c * Math.sin(a / d * (Math.PI / 2)) + b; }], "ease-in-out-sine": ["cubic-bezier(0.445, 0.050, 0.550, 0.950)", function (a, b, c, d) { return -c / 2 * (Math.cos(Math.PI * a / d) - 1) + b; }], "ease-in-expo": ["cubic-bezier(0.950, 0.050, 0.795, 0.035)", function (a, b, c, d) { return 0 === a ? b : c * Math.pow(2, 10 * (a / d - 1)) + b; }], "ease-out-expo": ["cubic-bezier(0.190, 1, 0.220, 1)", function (a, b, c, d) { return a === d ? b + c : c * (-Math.pow(2, -10 * a / d) + 1) + b; }], "ease-in-out-expo": ["cubic-bezier(1, 0, 0, 1)", function (a, b, c, d) { return 0 === a ? b : a === d ? b + c : (a /= d / 2) < 1 ? c / 2 * Math.pow(2, 10 * (a - 1)) + b : c / 2 * (-Math.pow(2, -10 * --a) + 2) + b; }], "ease-in-circ": ["cubic-bezier(0.600, 0.040, 0.980, 0.335)", function (a, b, c, d) { return -c * (Math.sqrt(1 - (a /= d) * a) - 1) + b; }], "ease-out-circ": ["cubic-bezier(0.075, 0.820, 0.165, 1)", function (a, b, c, d) { return c * Math.sqrt(1 - (a = a / d - 1) * a) + b; }], "ease-in-out-circ": ["cubic-bezier(0.785, 0.135, 0.150, 0.860)", function (a, b, c, d) { return (a /= d / 2) < 1 ? -c / 2 * (Math.sqrt(1 - a * a) - 1) + b : c / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + b; }], "ease-in-back": ["cubic-bezier(0.600, -0.280, 0.735, 0.045)", function (a, b, c, d, e) { return void 0 === e && (e = 1.70158), c * (a /= d) * a * ((e + 1) * a - e) + b; }], "ease-out-back": ["cubic-bezier(0.175, 0.885, 0.320, 1.275)", function (a, b, c, d, e) { return void 0 === e && (e = 1.70158), c * ((a = a / d - 1) * a * ((e + 1) * a + e) + 1) + b; }], "ease-in-out-back": ["cubic-bezier(0.680, -0.550, 0.265, 1.550)", function (a, b, c, d, e) { return void 0 === e && (e = 1.70158), (a /= d / 2) < 1 ? c / 2 * a * a * (((e *= 1.525) + 1) * a - e) + b : c / 2 * ((a -= 2) * a * (((e *= 1.525) + 1) * a + e) + 2) + b; }] }, n = { "ease-in-back": "cubic-bezier(0.600, 0, 0.735, 0.045)", "ease-out-back": "cubic-bezier(0.175, 0.885, 0.320, 1)", "ease-in-out-back": "cubic-bezier(0.680, 0, 0.265, 1)" }, o = document, p = window, q = "bkwld-tram", r = /[\-\.0-9]/g, s = /[A-Z]/, t = "number", u = /^(rgb|#)/, v = /(em|cm|mm|in|pt|pc|px)$/, w = /(em|cm|mm|in|pt|pc|px|%)$/, x = /(deg|rad|turn)$/, y = "unitless", z = /(all|none) 0s ease 0s/, A = /^(width|height)$/, B = " ", C = o.createElement("a"), D = ["Webkit", "Moz", "O", "ms"], E = ["-webkit-", "-moz-", "-o-", "-ms-"], F = function F(a) { if (a in C.style) return { dom: a, css: a }; var b, c, d = "", e = a.split("-"); for (b = 0; b < e.length; b++) { d += e[b].charAt(0).toUpperCase() + e[b].slice(1); } for (b = 0; b < D.length; b++) { if (c = D[b] + d, c in C.style) return { dom: c, css: E[b] + a }; } }, G = b.support = { bind: Function.prototype.bind, transform: F("transform"), transition: F("transition"), backface: F("backface-visibility"), timing: F("transition-timing-function") }; if (G.transition) { var H = G.timing.dom; if (C.style[H] = m["ease-in-back"][0], !C.style[H]) for (var I in n) { m[I][0] = n[I]; } } var J = b.frame = function () { var a = p.requestAnimationFrame || p.webkitRequestAnimationFrame || p.mozRequestAnimationFrame || p.oRequestAnimationFrame || p.msRequestAnimationFrame; return a && G.bind ? a.bind(p) : function (a) { p.setTimeout(a, 16); }; }(), K = b.now = function () { var a = p.performance, b = a && (a.now || a.webkitNow || a.msNow || a.mozNow); return b && G.bind ? b.bind(a) : Date.now || function () { return +new Date(); }; }(), L = l(function (b) { function d(a, b) { var c = k(("" + a).split(B)), d = c[0]; b = b || {}; var e = Y[d]; if (!e) return j("Unsupported property: " + d); if (!b.weak || !this.props[d]) { var f = e[0], g = this.props[d]; return g || (g = this.props[d] = new f.Bare()), g.init(this.$el, c, e, b), g; } } function e(a, b, c) { if (a) { var e = (0, _typeof2["default"])(a); if (b || (this.timer && this.timer.destroy(), this.queue = [], this.active = !1), "number" == e && b) return this.timer = new S({ duration: a, context: this, complete: h }), void (this.active = !0); if ("string" == e && b) { switch (a) { case "hide": o.call(this); break; case "stop": l.call(this); break; case "redraw": p.call(this); break; default: d.call(this, a, c && c[1]); } return h.call(this); } if ("function" == e) return void a.call(this, this); if ("object" == e) { var f = 0; u.call(this, a, function (a, b) { a.span > f && (f = a.span), a.stop(), a.animate(b); }, function (a) { "wait" in a && (f = i(a.wait, 0)); }), t.call(this), f > 0 && (this.timer = new S({ duration: f, context: this }), this.active = !0, b && (this.timer.complete = h)); var g = this, j = !1, k = {}; J(function () { u.call(g, a, function (a) { a.active && (j = !0, k[a.name] = a.nextStyle); }), j && g.$el.css(k); }); } } } function f(a) { a = i(a, 0), this.active ? this.queue.push({ options: a }) : (this.timer = new S({ duration: a, context: this, complete: h }), this.active = !0); } function g(a) { return this.active ? (this.queue.push({ options: a, args: arguments }), void (this.timer.complete = h)) : j("No active transition timer. Use start() or wait() before then()."); } function h() { if (this.timer && this.timer.destroy(), this.active = !1, this.queue.length) { var a = this.queue.shift(); e.call(this, a.options, !0, a.args); } } function l(a) { this.timer && this.timer.destroy(), this.queue = [], this.active = !1; var b; "string" == typeof a ? (b = {}, b[a] = 1) : b = "object" == (0, _typeof2["default"])(a) && null != a ? a : this.props, u.call(this, b, v), t.call(this); } function m(a) { l.call(this, a), u.call(this, a, w, x); } function n(a) { "string" != typeof a && (a = "block"), this.el.style.display = a; } function o() { l.call(this), this.el.style.display = "none"; } function p() { this.el.offsetHeight; } function r() { l.call(this), a.removeData(this.el, q), this.$el = this.el = null; } function t() { var a, b, c = []; this.upstream && c.push(this.upstream); for (a in this.props) { b = this.props[a], b.active && c.push(b.string); } c = c.join(","), this.style !== c && (this.style = c, this.el.style[G.transition.dom] = c); } function u(a, b, e) { var f, g, h, i, j = b !== v, k = {}; for (f in a) { h = a[f], f in Z ? (k.transform || (k.transform = {}), k.transform[f] = h) : (s.test(f) && (f = c(f)), f in Y ? k[f] = h : (i || (i = {}), i[f] = h)); } for (f in k) { if (h = k[f], g = this.props[f], !g) { if (!j) continue; g = d.call(this, f); } b.call(this, g, h); } e && i && e.call(this, i); } function v(a) { a.stop(); } function w(a, b) { a.set(b); } function x(a) { this.$el.css(a); } function y(a, c) { b[a] = function () { return this.children ? A.call(this, c, arguments) : (this.el && c.apply(this, arguments), this); }; } function A(a, b) { var c, d = this.children.length; for (c = 0; d > c; c++) { a.apply(this.children[c], b); } return this; } b.init = function (b) { if (this.$el = a(b), this.el = this.$el[0], this.props = {}, this.queue = [], this.style = "", this.active = !1, U.keepInherited && !U.fallback) { var c = W(this.el, "transition"); c && !z.test(c) && (this.upstream = c); } G.backface && U.hideBackface && V(this.el, G.backface.css, "hidden"); }, y("add", d), y("start", e), y("wait", f), y("then", g), y("next", h), y("stop", l), y("set", m), y("show", n), y("hide", o), y("redraw", p), y("destroy", r); }), M = l(L, function (b) { function c(b, c) { var d = a.data(b, q) || a.data(b, q, new L.Bare()); return d.el || d.init(b), c ? d.start(c) : d; } b.init = function (b, d) { var e = a(b); if (!e.length) return this; if (1 === e.length) return c(e[0], d); var f = []; return e.each(function (a, b) { f.push(c(b, d)); }), this.children = f, this; }; }), N = l(function (a) { function b() { var a = this.get(); this.update("auto"); var b = this.get(); return this.update(a), b; } function c(a, b, c) { return void 0 !== b && (c = b), a in m ? a : c; } function d(a) { var b = /rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(a); return (b ? e(b[1], b[2], b[3]) : a).replace(/#(\w)(\w)(\w)$/, "#$1$1$2$2$3$3"); } var f = { duration: 500, ease: "ease", delay: 0 }; a.init = function (a, b, d, e) { this.$el = a, this.el = a[0]; var g = b[0]; d[2] && (g = d[2]), X[g] && (g = X[g]), this.name = g, this.type = d[1], this.duration = i(b[1], this.duration, f.duration), this.ease = c(b[2], this.ease, f.ease), this.delay = i(b[3], this.delay, f.delay), this.span = this.duration + this.delay, this.active = !1, this.nextStyle = null, this.auto = A.test(this.name), this.unit = e.unit || this.unit || U.defaultUnit, this.angle = e.angle || this.angle || U.defaultAngle, U.fallback || e.fallback ? this.animate = this.fallback : (this.animate = this.transition, this.string = this.name + B + this.duration + "ms" + ("ease" != this.ease ? B + m[this.ease][0] : "") + (this.delay ? B + this.delay + "ms" : "")); }, a.set = function (a) { a = this.convert(a, this.type), this.update(a), this.redraw(); }, a.transition = function (a) { this.active = !0, a = this.convert(a, this.type), this.auto && ("auto" == this.el.style[this.name] && (this.update(this.get()), this.redraw()), "auto" == a && (a = b.call(this))), this.nextStyle = a; }, a.fallback = function (a) { var c = this.el.style[this.name] || this.convert(this.get(), this.type); a = this.convert(a, this.type), this.auto && ("auto" == c && (c = this.convert(this.get(), this.type)), "auto" == a && (a = b.call(this))), this.tween = new R({ from: c, to: a, duration: this.duration, delay: this.delay, ease: this.ease, update: this.update, context: this }); }, a.get = function () { return W(this.el, this.name); }, a.update = function (a) { V(this.el, this.name, a); }, a.stop = function () { (this.active || this.nextStyle) && (this.active = !1, this.nextStyle = null, V(this.el, this.name, this.get())); var a = this.tween; a && a.context && a.destroy(); }, a.convert = function (a, b) { if ("auto" == a && this.auto) return a; var c, e = "number" == typeof a, f = "string" == typeof a; switch (b) { case t: if (e) return a; if (f && "" === a.replace(r, "")) return +a; c = "number(unitless)"; break; case u: if (f) { if ("" === a && this.original) return this.original; if (b.test(a)) return "#" == a.charAt(0) && 7 == a.length ? a : d(a); } c = "hex or rgb string"; break; case v: if (e) return a + this.unit; if (f && b.test(a)) return a; c = "number(px) or string(unit)"; break; case w: if (e) return a + this.unit; if (f && b.test(a)) return a; c = "number(px) or string(unit or %)"; break; case x: if (e) return a + this.angle; if (f && b.test(a)) return a; c = "number(deg) or string(angle)"; break; case y: if (e) return a; if (f && w.test(a)) return a; c = "number(unitless) or string(unit or %)"; } return g(c, a), a; }, a.redraw = function () { this.el.offsetHeight; }; }), O = l(N, function (a, b) { a.init = function () { b.init.apply(this, arguments), this.original || (this.original = this.convert(this.get(), u)); }; }), P = l(N, function (a, b) { a.init = function () { b.init.apply(this, arguments), this.animate = this.fallback; }, a.get = function () { return this.$el[this.name](); }, a.update = function (a) { this.$el[this.name](a); }; }), Q = l(N, function (a, b) { function c(a, b) { var c, d, e, f, g; for (c in a) { f = Z[c], e = f[0], d = f[1] || c, g = this.convert(a[c], e), b.call(this, d, g, e); } } a.init = function () { b.init.apply(this, arguments), this.current || (this.current = {}, Z.perspective && U.perspective && (this.current.perspective = U.perspective, V(this.el, this.name, this.style(this.current)), this.redraw())); }, a.set = function (a) { c.call(this, a, function (a, b) { this.current[a] = b; }), V(this.el, this.name, this.style(this.current)), this.redraw(); }, a.transition = function (a) { var b = this.values(a); this.tween = new T({ current: this.current, values: b, duration: this.duration, delay: this.delay, ease: this.ease }); var c, d = {}; for (c in this.current) { d[c] = c in b ? b[c] : this.current[c]; } this.active = !0, this.nextStyle = this.style(d); }, a.fallback = function (a) { var b = this.values(a); this.tween = new T({ current: this.current, values: b, duration: this.duration, delay: this.delay, ease: this.ease, update: this.update, context: this }); }, a.update = function () { V(this.el, this.name, this.style(this.current)); }, a.style = function (a) { var b, c = ""; for (b in a) { c += b + "(" + a[b] + ") "; } return c; }, a.values = function (a) { var b, d = {}; return c.call(this, a, function (a, c, e) { d[a] = c, void 0 === this.current[a] && (b = 0, ~a.indexOf("scale") && (b = 1), this.current[a] = this.convert(b, e)); }), d; }; }), R = l(function (b) { function c(a) { 1 === n.push(a) && J(g); } function g() { var a, b, c, d = n.length; if (d) for (J(g), b = K(), a = d; a--;) { c = n[a], c && c.render(b); } } function i(b) { var c, d = a.inArray(b, n); d >= 0 && (c = n.slice(d + 1), n.length = d, c.length && (n = n.concat(c))); } function j(a) { return Math.round(a * o) / o; } function k(a, b, c) { return e(a[0] + c * (b[0] - a[0]), a[1] + c * (b[1] - a[1]), a[2] + c * (b[2] - a[2])); } var l = { ease: m.ease[1], from: 0, to: 1 }; b.init = function (a) { this.duration = a.duration || 0, this.delay = a.delay || 0; var b = a.ease || l.ease; m[b] && (b = m[b][1]), "function" != typeof b && (b = l.ease), this.ease = b, this.update = a.update || f, this.complete = a.complete || f, this.context = a.context || this, this.name = a.name; var c = a.from, d = a.to; void 0 === c && (c = l.from), void 0 === d && (d = l.to), this.unit = a.unit || "", "number" == typeof c && "number" == typeof d ? (this.begin = c, this.change = d - c) : this.format(d, c), this.value = this.begin + this.unit, this.start = K(), a.autoplay !== !1 && this.play(); }, b.play = function () { this.active || (this.start || (this.start = K()), this.active = !0, c(this)); }, b.stop = function () { this.active && (this.active = !1, i(this)); }, b.render = function (a) { var b, c = a - this.start; if (this.delay) { if (c <= this.delay) return; c -= this.delay; } if (c < this.duration) { var d = this.ease(c, 0, 1, this.duration); return b = this.startRGB ? k(this.startRGB, this.endRGB, d) : j(this.begin + d * this.change), this.value = b + this.unit, void this.update.call(this.context, this.value); } b = this.endHex || this.begin + this.change, this.value = b + this.unit, this.update.call(this.context, this.value), this.complete.call(this.context), this.destroy(); }, b.format = function (a, b) { if (b += "", a += "", "#" == a.charAt(0)) return this.startRGB = d(b), this.endRGB = d(a), this.endHex = a, this.begin = 0, void (this.change = 1); if (!this.unit) { var c = b.replace(r, ""), e = a.replace(r, ""); c !== e && h("tween", b, a), this.unit = c; } b = parseFloat(b), a = parseFloat(a), this.begin = this.value = b, this.change = a - b; }, b.destroy = function () { this.stop(), this.context = null, this.ease = this.update = this.complete = f; }; var n = [], o = 1e3; }), S = l(R, function (a) { a.init = function (a) { this.duration = a.duration || 0, this.complete = a.complete || f, this.context = a.context, this.play(); }, a.render = function (a) { var b = a - this.start; b < this.duration || (this.complete.call(this.context), this.destroy()); }; }), T = l(R, function (a, b) { a.init = function (a) { this.context = a.context, this.update = a.update, this.tweens = [], this.current = a.current; var b, c; for (b in a.values) { c = a.values[b], this.current[b] !== c && this.tweens.push(new R({ name: b, from: this.current[b], to: c, duration: a.duration, delay: a.delay, ease: a.ease, autoplay: !1 })); } this.play(); }, a.render = function (a) { var b, c, d = this.tweens.length, e = !1; for (b = d; b--;) { c = this.tweens[b], c.context && (c.render(a), this.current[c.name] = c.value, e = !0); } return e ? void (this.update && this.update.call(this.context)) : this.destroy(); }, a.destroy = function () { if (b.destroy.call(this), this.tweens) { var a, c = this.tweens.length; for (a = c; a--;) { this.tweens[a].destroy(); } this.tweens = null, this.current = null; } }; }), U = b.config = { debug: !1, defaultUnit: "px", defaultAngle: "deg", keepInherited: !1, hideBackface: !1, perspective: "", fallback: !G.transition, agentTests: [] }; b.fallback = function (a) { if (!G.transition) return U.fallback = !0; U.agentTests.push("(" + a + ")"); var b = new RegExp(U.agentTests.join("|"), "i"); U.fallback = b.test(navigator.userAgent); }, b.fallback("6.0.[2-5] Safari"), b.tween = function (a) { return new R(a); }, b.delay = function (a, b, c) { return new S({ complete: b, duration: a, context: c }); }, a.fn.tram = function (a) { return b.call(null, this, a); }; var V = a.style, W = a.css, X = { transform: G.transform && G.transform.css }, Y = { color: [O, u], background: [O, u, "background-color"], "outline-color": [O, u], "border-color": [O, u], "border-top-color": [O, u], "border-right-color": [O, u], "border-bottom-color": [O, u], "border-left-color": [O, u], "border-width": [N, v], "border-top-width": [N, v], "border-right-width": [N, v], "border-bottom-width": [N, v], "border-left-width": [N, v], "border-spacing": [N, v], "letter-spacing": [N, v], margin: [N, v], "margin-top": [N, v], "margin-right": [N, v], "margin-bottom": [N, v], "margin-left": [N, v], padding: [N, v], "padding-top": [N, v], "padding-right": [N, v], "padding-bottom": [N, v], "padding-left": [N, v], "outline-width": [N, v], opacity: [N, t], top: [N, w], right: [N, w], bottom: [N, w], left: [N, w], "font-size": [N, w], "text-indent": [N, w], "word-spacing": [N, w], width: [N, w], "min-width": [N, w], "max-width": [N, w], height: [N, w], "min-height": [N, w], "max-height": [N, w], "line-height": [N, y], "scroll-top": [P, t, "scrollTop"], "scroll-left": [P, t, "scrollLeft"] }, Z = {}; G.transform && (Y.transform = [Q], Z = { x: [w, "translateX"], y: [w, "translateY"], rotate: [x], rotateX: [x], rotateY: [x], scale: [t], scaleX: [t], scaleY: [t], skew: [x], skewX: [x], skewY: [x] }), G.transform && G.backface && (Z.z = [w, "translateZ"], Z.rotateZ = [x], Z.scaleZ = [t], Z.perspective = [v]); var $ = /ms/, _ = /s|\./; return a.tram = b; }(window.jQuery); /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(94), baseIteratee = __webpack_require__(18), toInteger = __webpack_require__(71); /* 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; /***/ }), /* 94 */ /***/ (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; /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(43), stackClear = __webpack_require__(166), stackDelete = __webpack_require__(167), stackGet = __webpack_require__(168), stackHas = __webpack_require__(169), stackSet = __webpack_require__(170); /** * 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; /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(24), isObject = __webpack_require__(12); /** `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; /***/ }), /* 97 */ /***/ (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(this, __webpack_require__(45))) /***/ }), /* 98 */ /***/ (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; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqualDeep = __webpack_require__(189), isObjectLike = __webpack_require__(20); /** * 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; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(190), arraySome = __webpack_require__(193), cacheHas = __webpack_require__(194); /** 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; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { var arrayPush = __webpack_require__(60), isArray = __webpack_require__(2); /** * 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; /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { var arrayFilter = __webpack_require__(201), stubArray = __webpack_require__(103); /** 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; /***/ }), /* 103 */ /***/ (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; /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { var baseTimes = __webpack_require__(202), isArguments = __webpack_require__(49), isArray = __webpack_require__(2), isBuffer = __webpack_require__(61), isIndex = __webpack_require__(62), isTypedArray = __webpack_require__(63); /** 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; /***/ }), /* 105 */ /***/ (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; }; /***/ }), /* 106 */ /***/ (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; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19), root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); module.exports = WeakMap; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(12); /** * 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; /***/ }), /* 109 */ /***/ (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; /***/ }), /* 110 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(111); /** * 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; /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(32), arrayMap = __webpack_require__(112), isArray = __webpack_require__(2), isSymbol = __webpack_require__(52); /** 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; /***/ }), /* 112 */ /***/ (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; /***/ }), /* 113 */ /***/ (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; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(53); module.exports = shared('native-function-to-string', Function.toString); /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(14); var fails = __webpack_require__(8); var createElement = __webpack_require__(116); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var isObject = __webpack_require__(16); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /* 117 */ /***/ (function(module, exports) { var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; /***/ }), /* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var createIteratorConstructor = __webpack_require__(234); var getPrototypeOf = __webpack_require__(124); var setPrototypeOf = __webpack_require__(240); var setToStringTag = __webpack_require__(126); var hide = __webpack_require__(21); var redefine = __webpack_require__(120); var wellKnownSymbol = __webpack_require__(6); var IS_PURE = __webpack_require__(77); var Iterators = __webpack_require__(35); var IteratorsCore = __webpack_require__(123); var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { hide(CurrentIteratorPrototype, ITERATOR, returnThis); } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(this); }; } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { hide(IterablePrototype, ITERATOR, defaultIterator); } Iterators[NAME] = defaultIterator; // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } return methods; }; /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(14); var propertyIsEnumerableModule = __webpack_require__(228); var createPropertyDescriptor = __webpack_require__(54); var toIndexedObject = __webpack_require__(22); var toPrimitive = __webpack_require__(76); var has = __webpack_require__(17); var IE8_DOM_DEFINE = __webpack_require__(115); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var shared = __webpack_require__(53); var hide = __webpack_require__(21); var has = __webpack_require__(17); var setGlobal = __webpack_require__(75); var nativeFunctionToString = __webpack_require__(114); var InternalStateModule = __webpack_require__(74); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(nativeFunctionToString).split('toString'); shared('inspectSource', function (it) { return nativeFunctionToString.call(it); }); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key); enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); } if (O === global) { if (simple) O[key] = value; else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else hide(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || nativeFunctionToString.call(this); }); /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(10); /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(17); var toIndexedObject = __webpack_require__(22); var indexOf = __webpack_require__(82).indexOf; var hiddenKeys = __webpack_require__(79); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getPrototypeOf = __webpack_require__(124); var hide = __webpack_require__(21); var has = __webpack_require__(17); var wellKnownSymbol = __webpack_require__(6); var IS_PURE = __webpack_require__(77); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; var returnThis = function () { return this; }; // `%IteratorPrototype%` object // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(17); var toObject = __webpack_require__(5); var sharedKey = __webpack_require__(78); var CORRECT_PROTOTYPE_GETTER = __webpack_require__(235); var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.getprototypeof module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype : null; }; /***/ }), /* 125 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(27); var defineProperties = __webpack_require__(237); var enumBugKeys = __webpack_require__(83); var hiddenKeys = __webpack_require__(79); var html = __webpack_require__(239); var documentCreateElement = __webpack_require__(116); var sharedKey = __webpack_require__(78); var IE_PROTO = sharedKey('IE_PROTO'); var PROTOTYPE = 'prototype'; var Empty = function () { /* empty */ }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var length = enumBugKeys.length; var lt = '<'; var script = 'script'; var gt = '>'; var js = 'java' + script + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = String(js); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); iframeDocument.close(); createDict = iframeDocument.F; while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; return createDict(); }; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }; hiddenKeys[IE_PROTO] = true; /***/ }), /* 126 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(15).f; var has = __webpack_require__(17); var wellKnownSymbol = __webpack_require__(6); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (it, TAG, STATIC) { if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); } }; /***/ }), /* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isArray = __webpack_require__(28); var toLength = __webpack_require__(3); var bind = __webpack_require__(84); // `FlattenIntoArray` abstract operation // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { var targetIndex = start; var sourceIndex = 0; var mapFn = mapper ? bind(mapper, thisArg, 3) : false; var element; while (sourceIndex < sourceLen) { if (sourceIndex in source) { element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; if (depth > 0 && isArray(element)) { targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; } else { if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length'); target[targetIndex] = element; } targetIndex++; } sourceIndex++; } return targetIndex; }; module.exports = flattenIntoArray; /***/ }), /* 128 */ /***/ (function(module, exports, __webpack_require__) { var aFunction = __webpack_require__(56); var toObject = __webpack_require__(5); var IndexedObject = __webpack_require__(55); var toLength = __webpack_require__(3); // `Array.prototype.{ reduce, reduceRight }` methods implementation var createMethod = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aFunction(callbackfn); var O = toObject(that); var self = IndexedObject(O); var length = toLength(O.length); var index = IS_RIGHT ? length - 1 : 0; var i = IS_RIGHT ? -1 : 1; if (argumentsLength < 2) while (true) { if (index in self) { memo = self[index]; index += i; break; } index += i; if (IS_RIGHT ? index < 0 : length <= index) { throw TypeError('Reduce of empty array with no initial value'); } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } return memo; }; }; module.exports = { // `Array.prototype.reduce` method // https://tc39.github.io/ecma262/#sec-array.prototype.reduce left: createMethod(false), // `Array.prototype.reduceRight` method // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright right: createMethod(true) }; /***/ }), /* 129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _createStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return _createStore__WEBPACK_IMPORTED_MODULE_0__["default"]; }); /* harmony import */ var _combineReducers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(132); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return _combineReducers__WEBPACK_IMPORTED_MODULE_1__["default"]; }); /* harmony import */ var _bindActionCreators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(134); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return _bindActionCreators__WEBPACK_IMPORTED_MODULE_2__["default"]; }); /* harmony import */ var _applyMiddleware__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return _applyMiddleware__WEBPACK_IMPORTED_MODULE_3__["default"]; }); /* harmony import */ var _compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return _compose__WEBPACK_IMPORTED_MODULE_4__["default"]; }); /* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(133); /* * This is a dummy function to check if the function name has been altered by minification. * If the function has been minified and NODE_ENV !== 'production', warn the user. */ function isCrushed() {} if (false) {} /***/ }), /* 130 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(289); /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(294); /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(296); /** `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 (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) { return false; } var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(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; } /* harmony default export */ __webpack_exports__["default"] = (isPlainObject); /***/ }), /* 131 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(290); /** Built-in value references. */ var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol; /* harmony default export */ __webpack_exports__["default"] = (Symbol); /***/ }), /* 132 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return combineReducers; }); /* harmony import */ var _createStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85); /* harmony import */ var lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(130); /* harmony import */ var _utils_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(133); function getUndefinedStateErrorMessage(key, action) { var actionType = action && action.type; var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.'; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; if (reducerKeys.length === 0) { return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; } if (!Object(lodash_es_isPlainObject__WEBPACK_IMPORTED_MODULE_1__["default"])(inputState)) { return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); } var unexpectedKeys = Object.keys(inputState).filter(function (key) { return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function (key) { unexpectedKeyCache[key] = true; }); if (unexpectedKeys.length > 0) { return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); } } function assertReducerSanity(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT }); if (typeof initialState === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.'); } var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); if (typeof reducer(undefined, { type: type }) === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore__WEBPACK_IMPORTED_MODULE_0__["ActionTypes"].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.'); } }); } /** * Turns an object whose values are different reducer functions, into a single * reducer function. It will call every child reducer, and gather their results * into a single state object, whose keys correspond to the keys of the passed * reducer functions. * * @param {Object} reducers An object whose values correspond to different * reducer functions that need to be combined into one. One handy way to obtain * it is to use ES6 `import * as reducers` syntax. The reducers may never return * undefined for any action. Instead, they should return their initial state * if the state passed to them was undefined, and the current state for any * unrecognized action. * * @returns {Function} A reducer function that invokes every reducer inside the * passed object, and builds a state object with the same shape. */ function combineReducers(reducers) { var reducerKeys = Object.keys(reducers); var finalReducers = {}; for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; if (false) {} if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); if (false) { var unexpectedKeyCache; } var sanityError; try { assertReducerSanity(finalReducers); } catch (e) { sanityError = e; } return function combination() { var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var action = arguments[1]; if (sanityError) { throw sanityError; } if (false) { var warningMessage; } var hasChanged = false; var nextState = {}; for (var i = 0; i < finalReducerKeys.length; i++) { var key = finalReducerKeys[i]; var reducer = finalReducers[key]; var previousStateForKey = state[key]; var nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === 'undefined') { var errorMessage = getUndefinedStateErrorMessage(key, action); throw new Error(errorMessage); } nextState[key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } return hasChanged ? nextState : state; }; } /***/ }), /* 133 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return warning; }); /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } /***/ }), /* 134 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return bindActionCreators; }); function bindActionCreator(actionCreator, dispatch) { return function () { return dispatch(actionCreator.apply(undefined, arguments)); }; } /** * Turns an object whose values are action creators, into an object with the * same keys, but with every function wrapped into a `dispatch` call so they * may be invoked directly. This is just a convenience method, as you can call * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. * * For convenience, you can also pass a single function as the first argument, * and get a function in return. * * @param {Function|Object} actionCreators An object whose values are action * creator functions. One handy way to obtain it is to use ES6 `import * as` * syntax. You may also pass a single function. * * @param {Function} dispatch The `dispatch` function available on your Redux * store. * * @returns {Function|Object} The object mimicking the original object, but with * every action creator wrapped into the `dispatch` call. If you passed a * function as `actionCreators`, the return value will also be a single * function. */ function bindActionCreators(actionCreators, dispatch) { if (typeof actionCreators === 'function') { return bindActionCreator(actionCreators, dispatch); } if (typeof actionCreators !== 'object' || actionCreators === null) { throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); } var keys = Object.keys(actionCreators); var boundActionCreators = {}; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var actionCreator = actionCreators[key]; if (typeof actionCreator === 'function') { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } return boundActionCreators; } /***/ }), /* 135 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return applyMiddleware; }); /* harmony import */ var _compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Creates a store enhancer that applies middleware to the dispatch method * of the Redux store. This is handy for a variety of tasks, such as expressing * asynchronous actions in a concise manner, or logging every action payload. * * See `redux-thunk` package as an example of the Redux middleware. * * Because middleware is potentially asynchronous, this should be the first * store enhancer in the composition chain. * * Note that each middleware will be given the `dispatch` and `getState` functions * as named arguments. * * @param {...Function} middlewares The middleware chain to be applied. * @returns {Function} A store enhancer applying the middleware. */ function applyMiddleware() { for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { middlewares[_key] = arguments[_key]; } return function (createStore) { return function (reducer, preloadedState, enhancer) { var store = createStore(reducer, preloadedState, enhancer); var _dispatch = store.dispatch; var chain = []; var middlewareAPI = { getState: store.getState, dispatch: function dispatch(action) { return _dispatch(action); } }; chain = middlewares.map(function (middleware) { return middleware(middlewareAPI); }); _dispatch = _compose__WEBPACK_IMPORTED_MODULE_0__["default"].apply(undefined, chain)(store.dispatch); return _extends({}, store, { dispatch: _dispatch }); }; }; } /***/ }), /* 136 */ /***/ (function(module, exports, __webpack_require__) { var createFind = __webpack_require__(137), findIndex = __webpack_require__(93); /** * 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; /***/ }), /* 137 */ /***/ (function(module, exports, __webpack_require__) { var baseIteratee = __webpack_require__(18), isArrayLike = __webpack_require__(25), keys = __webpack_require__(48); /** * 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; /***/ }), /* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1); Object.defineProperty(exports, "__esModule", { value: true }); exports.inQuad = inQuad; exports.outQuad = outQuad; exports.inOutQuad = inOutQuad; exports.inCubic = inCubic; exports.outCubic = outCubic; exports.inOutCubic = inOutCubic; exports.inQuart = inQuart; exports.outQuart = outQuart; exports.inOutQuart = inOutQuart; exports.inQuint = inQuint; exports.outQuint = outQuint; exports.inOutQuint = inOutQuint; exports.inSine = inSine; exports.outSine = outSine; exports.inOutSine = inOutSine; exports.inExpo = inExpo; exports.outExpo = outExpo; exports.inOutExpo = inOutExpo; exports.inCirc = inCirc; exports.outCirc = outCirc; exports.inOutCirc = inOutCirc; exports.outBounce = outBounce; exports.inBack = inBack; exports.outBack = outBack; exports.inOutBack = inOutBack; exports.inElastic = inElastic; exports.outElastic = outElastic; exports.inOutElastic = inOutElastic; exports.swingFromTo = swingFromTo; exports.swingFrom = swingFrom; exports.swingTo = swingTo; exports.bounce = bounce; exports.bouncePast = bouncePast; exports.easeInOut = exports.easeOut = exports.easeIn = exports.ease = void 0; var _bezierEasing = _interopRequireDefault(__webpack_require__(139)); // Easing functions adapted from Thomas Fuchs & Jeremy Kahn // Easing Equations (c) 2003 Robert Penner, BSD license // https://raw.github.com/danro/easing-js/master/LICENSE var magicSwing = 1.70158; var ease = (0, _bezierEasing["default"])(0.25, 0.1, 0.25, 1.0); exports.ease = ease; var easeIn = (0, _bezierEasing["default"])(0.42, 0.0, 1.0, 1.0); exports.easeIn = easeIn; var easeOut = (0, _bezierEasing["default"])(0.0, 0.0, 0.58, 1.0); exports.easeOut = easeOut; var easeInOut = (0, _bezierEasing["default"])(0.42, 0.0, 0.58, 1.0); exports.easeInOut = easeInOut; function inQuad(pos) { return Math.pow(pos, 2); } function outQuad(pos) { return -(Math.pow(pos - 1, 2) - 1); } function inOutQuad(pos) { if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 2); } return -0.5 * ((pos -= 2) * pos - 2); } function inCubic(pos) { return Math.pow(pos, 3); } function outCubic(pos) { return Math.pow(pos - 1, 3) + 1; } function inOutCubic(pos) { if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 3); } return 0.5 * (Math.pow(pos - 2, 3) + 2); } function inQuart(pos) { return Math.pow(pos, 4); } function outQuart(pos) { return -(Math.pow(pos - 1, 4) - 1); } function inOutQuart(pos) { if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 4); } return -0.5 * ((pos -= 2) * Math.pow(pos, 3) - 2); } function inQuint(pos) { return Math.pow(pos, 5); } function outQuint(pos) { return Math.pow(pos - 1, 5) + 1; } function inOutQuint(pos) { if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 5); } return 0.5 * (Math.pow(pos - 2, 5) + 2); } function inSine(pos) { return -Math.cos(pos * (Math.PI / 2)) + 1; } function outSine(pos) { return Math.sin(pos * (Math.PI / 2)); } function inOutSine(pos) { return -0.5 * (Math.cos(Math.PI * pos) - 1); } function inExpo(pos) { return pos === 0 ? 0 : Math.pow(2, 10 * (pos - 1)); } function outExpo(pos) { return pos === 1 ? 1 : -Math.pow(2, -10 * pos) + 1; } function inOutExpo(pos) { if (pos === 0) { return 0; } if (pos === 1) { return 1; } if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(2, 10 * (pos - 1)); } return 0.5 * (-Math.pow(2, -10 * --pos) + 2); } function inCirc(pos) { return -(Math.sqrt(1 - pos * pos) - 1); } function outCirc(pos) { return Math.sqrt(1 - Math.pow(pos - 1, 2)); } function inOutCirc(pos) { if ((pos /= 0.5) < 1) { return -0.5 * (Math.sqrt(1 - pos * pos) - 1); } return 0.5 * (Math.sqrt(1 - (pos -= 2) * pos) + 1); } function outBounce(pos) { if (pos < 1 / 2.75) { return 7.5625 * pos * pos; } else if (pos < 2 / 2.75) { return 7.5625 * (pos -= 1.5 / 2.75) * pos + 0.75; } else if (pos < 2.5 / 2.75) { return 7.5625 * (pos -= 2.25 / 2.75) * pos + 0.9375; } else { return 7.5625 * (pos -= 2.625 / 2.75) * pos + 0.984375; } } function inBack(pos) { var s = magicSwing; return pos * pos * ((s + 1) * pos - s); } function outBack(pos) { var s = magicSwing; return (pos -= 1) * pos * ((s + 1) * pos + s) + 1; } function inOutBack(pos) { var s = magicSwing; if ((pos /= 0.5) < 1) { return 0.5 * (pos * pos * (((s *= 1.525) + 1) * pos - s)); } return 0.5 * ((pos -= 2) * pos * (((s *= 1.525) + 1) * pos + s) + 2); } function inElastic(pos) { var s = magicSwing; var p = 0; var a = 1; if (pos === 0) { return 0; } if (pos === 1) { return 1; } if (!p) { p = 0.3; } if (a < 1) { a = 1; s = p / 4; } else { s = p / (2 * Math.PI) * Math.asin(1 / a); } return -(a * Math.pow(2, 10 * (pos -= 1)) * Math.sin((pos - s) * (2 * Math.PI) / p)); } function outElastic(pos) { var s = magicSwing; var p = 0; var a = 1; if (pos === 0) { return 0; } if (pos === 1) { return 1; } if (!p) { p = 0.3; } if (a < 1) { a = 1; s = p / 4; } else { s = p / (2 * Math.PI) * Math.asin(1 / a); } return a * Math.pow(2, -10 * pos) * Math.sin((pos - s) * (2 * Math.PI) / p) + 1; } function inOutElastic(pos) { var s = magicSwing; var p = 0; var a = 1; if (pos === 0) { return 0; } if ((pos /= 1 / 2) === 2) { return 1; } if (!p) { p = 0.3 * 1.5; } if (a < 1) { a = 1; s = p / 4; } else { s = p / (2 * Math.PI) * Math.asin(1 / a); } if (pos < 1) { return -0.5 * (a * Math.pow(2, 10 * (pos -= 1)) * Math.sin((pos - s) * (2 * Math.PI) / p)); } return a * Math.pow(2, -10 * (pos -= 1)) * Math.sin((pos - s) * (2 * Math.PI) / p) * 0.5 + 1; } function swingFromTo(pos) { var s = magicSwing; return (pos /= 0.5) < 1 ? 0.5 * (pos * pos * (((s *= 1.525) + 1) * pos - s)) : 0.5 * ((pos -= 2) * pos * (((s *= 1.525) + 1) * pos + s) + 2); } function swingFrom(pos) { var s = magicSwing; return pos * pos * ((s + 1) * pos - s); } function swingTo(pos) { var s = magicSwing; return (pos -= 1) * pos * ((s + 1) * pos + s) + 1; } function bounce(pos) { if (pos < 1 / 2.75) { return 7.5625 * pos * pos; } else if (pos < 2 / 2.75) { return 7.5625 * (pos -= 1.5 / 2.75) * pos + 0.75; } else if (pos < 2.5 / 2.75) { return 7.5625 * (pos -= 2.25 / 2.75) * pos + 0.9375; } else { return 7.5625 * (pos -= 2.625 / 2.75) * pos + 0.984375; } } function bouncePast(pos) { if (pos < 1 / 2.75) { return 7.5625 * pos * pos; } else if (pos < 2 / 2.75) { return 2 - (7.5625 * (pos -= 1.5 / 2.75) * pos + 0.75); } else if (pos < 2.5 / 2.75) { return 2 - (7.5625 * (pos -= 2.25 / 2.75) * pos + 0.9375); } else { return 2 - (7.5625 * (pos -= 2.625 / 2.75) * pos + 0.984375); } } /***/ }), /* 139 */ /***/ (function(module, exports) { /** * https://github.com/gre/bezier-easing * BezierEasing - use bezier curve for transition easing function * by Gaëtan Renaudeau 2014 - 2015 – MIT License */ // These values are established by empiricism with tests (tradeoff: performance VS precision) var NEWTON_ITERATIONS = 4; var NEWTON_MIN_SLOPE = 0.001; var SUBDIVISION_PRECISION = 0.0000001; var SUBDIVISION_MAX_ITERATIONS = 10; var kSplineTableSize = 11; var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); var float32ArraySupported = typeof Float32Array === 'function'; function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } function C (aA1) { return 3.0 * aA1; } // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; } // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } function binarySubdivide (aX, aA, aB, mX1, mX2) { var currentX, currentT, i = 0; do { currentT = aA + (aB - aA) / 2.0; currentX = calcBezier(currentT, mX1, mX2) - aX; if (currentX > 0.0) { aB = currentT; } else { aA = currentT; } } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); return currentT; } function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) { for (var i = 0; i < NEWTON_ITERATIONS; ++i) { var currentSlope = getSlope(aGuessT, mX1, mX2); if (currentSlope === 0.0) { return aGuessT; } var currentX = calcBezier(aGuessT, mX1, mX2) - aX; aGuessT -= currentX / currentSlope; } return aGuessT; } module.exports = function bezier (mX1, mY1, mX2, mY2) { if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { throw new Error('bezier x values must be in [0, 1] range'); } // Precompute samples table var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); if (mX1 !== mY1 || mX2 !== mY2) { for (var i = 0; i < kSplineTableSize; ++i) { sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); } } function getTForX (aX) { var intervalStart = 0.0; var currentSample = 1; var lastSample = kSplineTableSize - 1; for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { intervalStart += kSampleStepSize; } --currentSample; // Interpolate to provide an initial guess for t var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); var guessForT = intervalStart + dist * kSampleStepSize; var initialSlope = getSlope(guessForT, mX1, mX2); if (initialSlope >= NEWTON_MIN_SLOPE) { return newtonRaphsonIterate(aX, guessForT, mX1, mX2); } else if (initialSlope === 0.0) { return guessForT; } else { return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); } } return function BezierEasing (x) { if (mX1 === mY1 && mX2 === mY2) { return x; // linear } // Because JavaScript number are imprecise, we should guarantee the extremes are right. if (x === 0) { return 0; } if (x === 1) { return 1; } return calcBezier(getTForX(x), mY1, mY2); }; }; /***/ }), /* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault2 = __webpack_require__(1); var _toConsumableArray2 = _interopRequireDefault2(__webpack_require__(141)); var _interopRequireDefault = __webpack_require__(1); var _interopRequireWildcard = __webpack_require__(40); Object.defineProperty(exports, "__esModule", { value: true }); exports.optimizeFloat = optimizeFloat; exports.createBezierEasing = createBezierEasing; exports.applyEasing = applyEasing; var easings = _interopRequireWildcard(__webpack_require__(138)); var _bezierEasing = _interopRequireDefault(__webpack_require__(139)); function optimizeFloat(value) { var digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5; var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; var pow = Math.pow(base, digits); var _float = Number(Math.round(value * pow) / pow); return Math.abs(_float) > 0.0001 ? _float : 0; } function createBezierEasing(easing) { return (0, _bezierEasing["default"]).apply(void 0, (0, _toConsumableArray2["default"])(easing)); } function applyEasing(easing, position, customEasingFn) { if (position === 0) { return 0; } if (position === 1) { return 1; } if (customEasingFn) { return optimizeFloat(position > 0 ? customEasingFn(position) : position); } return optimizeFloat(position > 0 && easing && easings[easing] ? easings[easing](position) : position); } /***/ }), /* 141 */ /***/ (function(module, exports, __webpack_require__) { var arrayWithoutHoles = __webpack_require__(309); var iterableToArray = __webpack_require__(310); var nonIterableSpread = __webpack_require__(311); function _toConsumableArray(arr) { return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); } module.exports = _toConsumableArray; /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(1); var _defineProperty2 = _interopRequireDefault(__webpack_require__(31)); Object.defineProperty(exports, "__esModule", { value: true }); exports.isPluginType = isPluginType; exports.clearPlugin = exports.renderPlugin = exports.createPluginInstance = exports.getPluginDestination = exports.getPluginDuration = exports.getPluginOrigin = exports.getPluginConfig = void 0; var _IX2LottieUtils = __webpack_require__(313); var _constants = __webpack_require__(7); var _IX2BrowserSupport = __webpack_require__(87); // eslint-disable-next-line webflow/module-top-level-imports, webflow/packages-must-be-defined var pluginMethodMap = (0, _defineProperty2["default"])({}, _constants.ActionTypeConsts.PLUGIN_LOTTIE, { getConfig: _IX2LottieUtils.getPluginConfig, getOrigin: _IX2LottieUtils.getPluginOrigin, getDuration: _IX2LottieUtils.getPluginDuration, getDestination: _IX2LottieUtils.getPluginDestination, createInstance: _IX2LottieUtils.createPluginInstance, render: _IX2LottieUtils.renderPlugin, clear: _IX2LottieUtils.clearPlugin }); function isPluginType(actionTypeId) { return actionTypeId === _constants.ActionTypeConsts.PLUGIN_LOTTIE; } var pluginMethod = function pluginMethod(methodName) { return function (actionTypeId) { if (!_IX2BrowserSupport.IS_BROWSER_ENV) { // IX2 plugins require browser libs for now return function () { return null; }; } var plugin = pluginMethodMap[actionTypeId]; if (!plugin) { throw new Error("IX2 no plugin configured for: ".concat(actionTypeId)); } var method = plugin[methodName]; if (!method) { throw new Error("IX2 invalid plugin method: ".concat(methodName)); } return method; }; }; var getPluginConfig = pluginMethod('getConfig'); exports.getPluginConfig = getPluginConfig; var getPluginOrigin = pluginMethod('getOrigin'); exports.getPluginOrigin = getPluginOrigin; var getPluginDuration = pluginMethod('getDuration'); exports.getPluginDuration = getPluginDuration; var getPluginDestination = pluginMethod('getDestination'); exports.getPluginDestination = getPluginDestination; var createPluginInstance = pluginMethod('createInstance'); exports.createPluginInstance = createPluginInstance; var renderPlugin = pluginMethod('render'); exports.renderPlugin = renderPlugin; var clearPlugin = pluginMethod('clear'); exports.clearPlugin = clearPlugin; /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { var baseForOwn = __webpack_require__(144), createBaseEach = __webpack_require__(320); /** * 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; /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { var baseFor = __webpack_require__(318), keys = __webpack_require__(48); /** * 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; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__(324); exports.__esModule = true; exports.default = void 0; var _shallowEqual = _interopRequireDefault(__webpack_require__(325)); var _default = _shallowEqual.default; exports.default = _default; /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault2 = __webpack_require__(1); var _toConsumableArray2 = _interopRequireDefault2(__webpack_require__(141)); var _interopRequireWildcard = __webpack_require__(40); var _interopRequireDefault = __webpack_require__(1); Object.defineProperty(exports, "__esModule", { value: true }); exports.observeRequests = observeRequests; exports.startEngine = startEngine; exports.stopEngine = stopEngine; exports.stopAllActionGroups = stopAllActionGroups; exports.stopActionGroup = stopActionGroup; exports.startActionGroup = startActionGroup; var _extends2 = _interopRequireDefault(__webpack_require__(30)); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(328)); var _find = _interopRequireDefault(__webpack_require__(136)); var _get = _interopRequireDefault(__webpack_require__(50)); var _size = _interopRequireDefault(__webpack_require__(329)); var _omitBy = _interopRequireDefault(__webpack_require__(335)); var _isEmpty = _interopRequireDefault(__webpack_require__(347)); var _mapValues = _interopRequireDefault(__webpack_require__(348)); var _forEach = _interopRequireDefault(__webpack_require__(349)); var _endsWith = _interopRequireDefault(__webpack_require__(352)); var _throttle = _interopRequireDefault(__webpack_require__(353)); var _shallowEqual = _interopRequireDefault(__webpack_require__(145)); var _constants = __webpack_require__(7); var _shared = __webpack_require__(29); var _IX2EngineActions = __webpack_require__(88); var elementApi = _interopRequireWildcard(__webpack_require__(356)); var _IX2VanillaEvents = _interopRequireDefault(__webpack_require__(357)); /* eslint-env browser */ var _constants$IX2EngineC = _constants.IX2EngineConstants, COLON_DELIMITER = _constants$IX2EngineC.COLON_DELIMITER, BOUNDARY_SELECTOR = _constants$IX2EngineC.BOUNDARY_SELECTOR, HTML_ELEMENT = _constants$IX2EngineC.HTML_ELEMENT, RENDER_GENERAL = _constants$IX2EngineC.RENDER_GENERAL, W_MOD_IX = _constants$IX2EngineC.W_MOD_IX; var _shared$IX2VanillaUti = _shared.IX2VanillaUtils, getAffectedElements = _shared$IX2VanillaUti.getAffectedElements, getElementId = _shared$IX2VanillaUti.getElementId, getDestinationValues = _shared$IX2VanillaUti.getDestinationValues, observeStore = _shared$IX2VanillaUti.observeStore, getInstanceId = _shared$IX2VanillaUti.getInstanceId, renderHTMLElement = _shared$IX2VanillaUti.renderHTMLElement, clearAllStyles = _shared$IX2VanillaUti.clearAllStyles, getMaxDurationItemIndex = _shared$IX2VanillaUti.getMaxDurationItemIndex, getComputedStyle = _shared$IX2VanillaUti.getComputedStyle, getInstanceOrigin = _shared$IX2VanillaUti.getInstanceOrigin, reduceListToGroup = _shared$IX2VanillaUti.reduceListToGroup, shouldNamespaceEventParameter = _shared$IX2VanillaUti.shouldNamespaceEventParameter, getNamespacedParameterId = _shared$IX2VanillaUti.getNamespacedParameterId, shouldAllowMediaQuery = _shared$IX2VanillaUti.shouldAllowMediaQuery, cleanupHTMLElement = _shared$IX2VanillaUti.cleanupHTMLElement, stringifyTarget = _shared$IX2VanillaUti.stringifyTarget, mediaQueriesEqual = _shared$IX2VanillaUti.mediaQueriesEqual; var _shared$IX2VanillaPlu = _shared.IX2VanillaPlugins, isPluginType = _shared$IX2VanillaPlu.isPluginType, createPluginInstance = _shared$IX2VanillaPlu.createPluginInstance, getPluginDuration = _shared$IX2VanillaPlu.getPluginDuration; var ua = navigator.userAgent; var IS_MOBILE_SAFARI = ua.match(/iPad/i) || ua.match(/iPhone/); // Keep throttled events at ~80fps to reduce reflows while maintaining render accuracy var THROTTLED_EVENT_WAIT = 12; // $FlowFixMe function observeRequests(store) { observeStore({ store: store, select: function select(_ref) { var ixRequest = _ref.ixRequest; return ixRequest.preview; }, onChange: handlePreviewRequest }); observeStore({ store: store, select: function select(_ref2) { var ixRequest = _ref2.ixRequest; return ixRequest.playback; }, onChange: handlePlaybackRequest }); observeStore({ store: store, select: function select(_ref3) { var ixRequest = _ref3.ixRequest; return ixRequest.stop; }, onChange: handleStopRequest }); observeStore({ store: store, select: function select(_ref4) { var ixRequest = _ref4.ixRequest; return ixRequest.clear; }, onChange: handleClearRequest }); } function observeMediaQueryChange(store) { observeStore({ store: store, select: function select(_ref5) { var ixSession = _ref5.ixSession; return ixSession.mediaQueryKey; }, onChange: function onChange() { stopEngine(store); clearAllStyles({ store: store, elementApi: elementApi }); startEngine({ store: store, allowEvents: true }); dispatchPageUpdateEvent(); } }); } function observeOneRenderTick(store, onTick) { var unsubscribe = observeStore({ store: store, select: function select(_ref6) { var ixSession = _ref6.ixSession; return ixSession.tick; }, onChange: function onChange(tick) { onTick(tick); unsubscribe(); } }); } function handlePreviewRequest(_ref7, store) { var rawData = _ref7.rawData, defer = _ref7.defer; var start = function start() { startEngine({ store: store, rawData: rawData, allowEvents: true }); dispatchPageUpdateEvent(); }; defer ? setTimeout(start, 0) : start(); } function dispatchPageUpdateEvent() { document.dispatchEvent(new CustomEvent('IX2_PAGE_UPDATE')); } function isQuickEffect(id) { return id && (0, _endsWith["default"])(id, '_EFFECT'); } function handlePlaybackRequest(playback, store) { var actionTypeId = playback.actionTypeId, actionListId = playback.actionListId, actionItemId = playback.actionItemId, eventId = playback.eventId, allowEvents = playback.allowEvents, immediate = playback.immediate, testManual = playback.testManual, _playback$verbose = playback.verbose, verbose = _playback$verbose === void 0 ? true : _playback$verbose; var rawData = playback.rawData; if (actionListId && actionItemId && rawData && immediate) { var actionList = rawData.actionLists[actionListId]; if (actionList) { rawData = reduceListToGroup({ actionList: actionList, actionItemId: actionItemId, rawData: rawData }); } } startEngine({ store: store, rawData: rawData, allowEvents: allowEvents, testManual: testManual }); if (actionListId && actionTypeId === _constants.ActionTypeConsts.GENERAL_START_ACTION || isQuickEffect(actionTypeId)) { stopActionGroup({ store: store, actionListId: actionListId }); renderInitialGroup({ store: store, actionListId: actionListId, eventId: eventId }); var started = startActionGroup({ store: store, eventId: eventId, actionListId: actionListId, immediate: immediate, verbose: verbose }); if (verbose && started) { store.dispatch((0, _IX2EngineActions.actionListPlaybackChanged)({ actionListId: actionListId, isPlaying: !immediate })); } } } function handleStopRequest(_ref8, store) { var actionListId = _ref8.actionListId; if (actionListId) { stopActionGroup({ store: store, actionListId: actionListId }); } else { stopAllActionGroups({ store: store }); } stopEngine(store); } function handleClearRequest(state, store) { stopEngine(store); clearAllStyles({ store: store, elementApi: elementApi }); } // $FlowFixMe function startEngine(_ref9) { var store = _ref9.store, rawData = _ref9.rawData, allowEvents = _ref9.allowEvents, testManual = _ref9.testManual; var _store$getState = store.getState(), ixSession = _store$getState.ixSession; if (rawData) { store.dispatch((0, _IX2EngineActions.rawDataImported)(rawData)); } if (!ixSession.active) { store.dispatch((0, _IX2EngineActions.sessionInitialized)({ hasBoundaryNodes: Boolean(document.querySelector(BOUNDARY_SELECTOR)) })); if (allowEvents) { bindEvents(store); addDocumentClass(); if (store.getState().ixSession.hasDefinedMediaQueries) { observeMediaQueryChange(store); } } store.dispatch((0, _IX2EngineActions.sessionStarted)()); startRenderLoop(store, testManual); } } function addDocumentClass() { var _document = document, documentElement = _document.documentElement; // $FlowFixMe if (documentElement.className.indexOf(W_MOD_IX) === -1) { // $FlowFixMe documentElement.className += " ".concat(W_MOD_IX); } } function startRenderLoop(store, testManual) { var handleFrame = function handleFrame(now) { var _store$getState2 = store.getState(), ixSession = _store$getState2.ixSession, ixParameters = _store$getState2.ixParameters; if (ixSession.active) { store.dispatch((0, _IX2EngineActions.animationFrameChanged)(now, ixParameters)); if (testManual) { observeOneRenderTick(store, handleFrame); } else { requestAnimationFrame(handleFrame); } } }; handleFrame(window.performance.now()); } // $FlowFixMe function stopEngine(store) { var _store$getState3 = store.getState(), ixSession = _store$getState3.ixSession; if (ixSession.active) { var eventListeners = ixSession.eventListeners; eventListeners.forEach(clearEventListener); store.dispatch((0, _IX2EngineActions.sessionStopped)()); } } function clearEventListener(_ref10) { var target = _ref10.target, listenerParams = _ref10.listenerParams; target.removeEventListener.apply(target, listenerParams); } function createGroupInstances(_ref11) { var store = _ref11.store, eventStateKey = _ref11.eventStateKey, eventTarget = _ref11.eventTarget, eventId = _ref11.eventId, eventConfig = _ref11.eventConfig, actionListId = _ref11.actionListId, parameterGroup = _ref11.parameterGroup, smoothing = _ref11.smoothing, restingValue = _ref11.restingValue; var _store$getState4 = store.getState(), ixData = _store$getState4.ixData, ixSession = _store$getState4.ixSession; var events = ixData.events; var event = events[eventId]; var eventTypeId = event.eventTypeId; var targetCache = {}; var instanceActionGroups = {}; var instanceConfigs = []; var continuousActionGroups = parameterGroup.continuousActionGroups; var parameterId = parameterGroup.id; if (shouldNamespaceEventParameter(eventTypeId, eventConfig)) { parameterId = getNamespacedParameterId(eventStateKey, parameterId); } // Limit affected elements when event target is within a boundary node var eventElementRoot = ixSession.hasBoundaryNodes && eventTarget ? elementApi.getClosestElement(eventTarget, BOUNDARY_SELECTOR) : null; continuousActionGroups.forEach(function (actionGroup) { var keyframe = actionGroup.keyframe, actionItems = actionGroup.actionItems; actionItems.forEach(function (actionItem) { var actionTypeId = actionItem.actionTypeId; var target = actionItem.config.target; if (!target) { return; } var elementRoot = target.boundaryMode ? eventElementRoot : null; var key = stringifyTarget(target) + COLON_DELIMITER + actionTypeId; instanceActionGroups[key] = appendActionItem(instanceActionGroups[key], keyframe, actionItem); if (!targetCache[key]) { targetCache[key] = true; var config = actionItem.config; getAffectedElements({ config: config, event: event, eventTarget: eventTarget, elementRoot: elementRoot, elementApi: elementApi }).forEach(function (element) { instanceConfigs.push({ element: element, key: key }); }); } }); }); instanceConfigs.forEach(function (_ref12) { var element = _ref12.element, key = _ref12.key; var actionGroups = instanceActionGroups[key]; var actionItem = (0, _get["default"])(actionGroups, "[0].actionItems[0]", {}); var actionTypeId = actionItem.actionTypeId; var pluginInstance = isPluginType(actionTypeId) ? // $FlowFixMe createPluginInstance(actionTypeId)(element, actionItem) : null; var destination = getDestinationValues({ element: element, actionItem: actionItem, elementApi: elementApi }, // $FlowFixMe pluginInstance); createInstance({ store: store, element: element, eventId: eventId, actionListId: actionListId, actionItem: actionItem, destination: destination, continuous: true, parameterId: parameterId, actionGroups: actionGroups, smoothing: smoothing, restingValue: restingValue, pluginInstance: pluginInstance }); }); } function appendActionItem() { var actionGroups = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var keyframe = arguments.length > 1 ? arguments[1] : undefined; var actionItem = arguments.length > 2 ? arguments[2] : undefined; var newActionGroups = (0, _toConsumableArray2["default"])(actionGroups); var groupIndex; newActionGroups.some(function (group, index) { if (group.keyframe === keyframe) { groupIndex = index; return true; } return false; }); if (groupIndex == null) { groupIndex = newActionGroups.length; newActionGroups.push({ keyframe: keyframe, actionItems: [] }); } newActionGroups[groupIndex].actionItems.push(actionItem); return newActionGroups; } function bindEvents(store) { var _store$getState5 = store.getState(), ixData = _store$getState5.ixData; var eventTypeMap = ixData.eventTypeMap; updateViewportWidth(store); (0, _forEach["default"])(eventTypeMap, function (events, key) { var logic = _IX2VanillaEvents["default"][key]; if (!logic) { console.warn("IX2 event type not configured: ".concat(key)); return; } bindEventType({ logic: logic, store: store, events: events }); }); var _store$getState6 = store.getState(), ixSession = _store$getState6.ixSession; if (ixSession.eventListeners.length) { bindResizeEvents(store); } } var WINDOW_RESIZE_EVENTS = ['resize', 'orientationchange']; function bindResizeEvents(store) { var handleResize = function handleResize() { updateViewportWidth(store); }; WINDOW_RESIZE_EVENTS.forEach(function (type) { window.addEventListener(type, handleResize); store.dispatch((0, _IX2EngineActions.eventListenerAdded)(window, [type, handleResize])); }); handleResize(); } function updateViewportWidth(store) { var _store$getState7 = store.getState(), ixSession = _store$getState7.ixSession, ixData = _store$getState7.ixData; var width = window.innerWidth; if (width !== ixSession.viewportWidth) { var mediaQueries = ixData.mediaQueries; store.dispatch((0, _IX2EngineActions.viewportWidthChanged)({ width: width, mediaQueries: mediaQueries })); } } var mapFoundValues = function mapFoundValues(object, iteratee) { return (0, _omitBy["default"])((0, _mapValues["default"])(object, iteratee), _isEmpty["default"]); }; var forEachEventTarget = function forEachEventTarget(eventTargets, eventCallback) { (0, _forEach["default"])(eventTargets, function (elements, eventId) { elements.forEach(function (element, index) { var eventStateKey = eventId + COLON_DELIMITER + index; eventCallback(element, eventId, eventStateKey); }); }); }; var getAffectedForEvent = function getAffectedForEvent(event) { var config = { target: event.target }; return getAffectedElements({ config: config, elementApi: elementApi }); }; function bindEventType(_ref13) { var logic = _ref13.logic, store = _ref13.store, events = _ref13.events; injectBehaviorCSSFixes(events); var eventTypes = logic.types, eventHandler = logic.handler; var _store$getState8 = store.getState(), ixData = _store$getState8.ixData; var actionLists = ixData.actionLists; var eventTargets = mapFoundValues(events, getAffectedForEvent); if (!(0, _size["default"])(eventTargets)) { return; } (0, _forEach["default"])(eventTargets, function (elements, key) { var event = events[key]; var eventAction = event.action, eventId = event.id, _event$mediaQueries = event.mediaQueries, mediaQueries = _event$mediaQueries === void 0 ? ixData.mediaQueryKeys : _event$mediaQueries; var actionListId = eventAction.config.actionListId; if (!mediaQueriesEqual(mediaQueries, ixData.mediaQueryKeys)) { store.dispatch((0, _IX2EngineActions.mediaQueriesDefined)()); } if (eventAction.actionTypeId === _constants.ActionTypeConsts.GENERAL_CONTINUOUS_ACTION) { var configs = Array.isArray(event.config) ? event.config : [event.config]; configs.forEach(function (eventConfig) { var continuousParameterGroupId = eventConfig.continuousParameterGroupId; var paramGroups = (0, _get["default"])(actionLists, "".concat(actionListId, ".continuousParameterGroups"), []); var parameterGroup = (0, _find["default"])(paramGroups, function (_ref14) { var id = _ref14.id; return id === continuousParameterGroupId; }); var smoothing = (eventConfig.smoothing || 0) / 100; var restingValue = (eventConfig.restingState || 0) / 100; if (!parameterGroup) { return; } elements.forEach(function (eventTarget, index) { var eventStateKey = eventId + COLON_DELIMITER + index; createGroupInstances({ store: store, eventStateKey: eventStateKey, eventTarget: eventTarget, eventId: eventId, eventConfig: eventConfig, actionListId: actionListId, parameterGroup: parameterGroup, smoothing: smoothing, restingValue: restingValue }); }); }); } if (eventAction.actionTypeId === _constants.ActionTypeConsts.GENERAL_START_ACTION || isQuickEffect(eventAction.actionTypeId)) { renderInitialGroup({ store: store, actionListId: actionListId, eventId: eventId }); } }); var handleEvent = function handleEvent(nativeEvent) { var _store$getState9 = store.getState(), ixSession = _store$getState9.ixSession; forEachEventTarget(eventTargets, function (element, eventId, eventStateKey) { var event = events[eventId]; var oldState = ixSession.eventState[eventStateKey]; var eventAction = event.action, _event$mediaQueries2 = event.mediaQueries, mediaQueries = _event$mediaQueries2 === void 0 ? ixData.mediaQueryKeys : _event$mediaQueries2; // Bypass event handler if current media query is not listed in event config if (!shouldAllowMediaQuery(mediaQueries, ixSession.mediaQueryKey)) { return; } var handleEventWithConfig = function handleEventWithConfig() { var eventConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var newState = eventHandler({ store: store, element: element, event: event, eventConfig: eventConfig, nativeEvent: nativeEvent, eventStateKey: eventStateKey }, oldState); if (!(0, _shallowEqual["default"])(newState, oldState)) { store.dispatch((0, _IX2EngineActions.eventStateChanged)(eventStateKey, newState)); } }; if (eventAction.actionTypeId === _constants.ActionTypeConsts.GENERAL_CONTINUOUS_ACTION) { var configs = Array.isArray(event.config) ? event.config : [event.config]; configs.forEach(handleEventWithConfig); } else { handleEventWithConfig(); } }); }; var handleEventThrottled = (0, _throttle["default"])(handleEvent, THROTTLED_EVENT_WAIT); var addListeners = function addListeners(_ref15) { var _ref15$target = _ref15.target, target = _ref15$target === void 0 ? document : _ref15$target, types = _ref15.types, shouldThrottle = _ref15.throttle; types.split(' ').filter(Boolean).forEach(function (type) { var handlerFunc = shouldThrottle ? handleEventThrottled : handleEvent; // $FlowFixMe target.addEventListener(type, handlerFunc); store.dispatch((0, _IX2EngineActions.eventListenerAdded)(target, [type, handlerFunc])); }); }; if (Array.isArray(eventTypes)) { eventTypes.forEach(addListeners); } else if (typeof eventTypes === 'string') { addListeners(logic); } } /** * Injects CSS into the document to fix behavior issues across * different devices. */ function injectBehaviorCSSFixes(events) { if (!IS_MOBILE_SAFARI) { return; } var injectedSelectors = {}; var cssText = ''; for (var eventId in events) { var _events$eventId = events[eventId], eventTypeId = _events$eventId.eventTypeId, target = _events$eventId.target; var selector = elementApi.getQuerySelector(target); // $FlowFixMe if (injectedSelectors[selector]) { continue; } // add a "cursor: pointer" style rule to ensure that CLICK events get fired for IOS devices if (eventTypeId === _constants.EventTypeConsts.MOUSE_CLICK || eventTypeId === _constants.EventTypeConsts.MOUSE_SECOND_CLICK) { // $FlowFixMe injectedSelectors[selector] = true; cssText += // $FlowFixMe selector + '{' + 'cursor: pointer;' + 'touch-action: manipulation;' + '}'; } } if (cssText) { var style = document.createElement('style'); style.textContent = cssText; // $FlowFixMe document.body.appendChild(style); } } function renderInitialGroup(_ref16) { var store = _ref16.store, actionListId = _ref16.actionListId, eventId = _ref16.eventId; var _store$getState10 = store.getState(), ixData = _store$getState10.ixData, ixSession = _store$getState10.ixSession; var actionLists = ixData.actionLists, events = ixData.events; var event = events[eventId]; var actionList = actionLists[actionListId]; if (actionList && actionList.useFirstGroupAsInitialState) { var initialStateItems = (0, _get["default"])(actionList, 'actionItemGroups[0].actionItems', []); // Bypass initial state render if current media query is not listed in event config var mediaQueries = (0, _get["default"])(event, 'mediaQueries', ixData.mediaQueryKeys); if (!shouldAllowMediaQuery(mediaQueries, ixSession.mediaQueryKey)) { return; } initialStateItems.forEach(function (actionItem) { var config = actionItem.config, actionTypeId = actionItem.actionTypeId; var itemElements = getAffectedElements({ config: config, event: event, elementApi: elementApi }); var shouldUsePlugin = isPluginType(actionTypeId); itemElements.forEach(function (element) { var pluginInstance = shouldUsePlugin ? // $FlowFixMe createPluginInstance(actionTypeId)(element, actionItem) : null; createInstance({ destination: getDestinationValues({ element: element, actionItem: actionItem, elementApi: elementApi }, // $FlowFixMe pluginInstance), immediate: true, store: store, element: element, eventId: eventId, actionItem: actionItem, actionListId: actionListId, pluginInstance: pluginInstance }); }); }); } } // $FlowFixMe function stopAllActionGroups(_ref17) { var store = _ref17.store; var _store$getState11 = store.getState(), ixInstances = _store$getState11.ixInstances; (0, _forEach["default"])(ixInstances, function (instance) { if (!instance.continuous) { var actionListId = instance.actionListId, verbose = instance.verbose; removeInstance(instance, store); if (verbose) { store.dispatch((0, _IX2EngineActions.actionListPlaybackChanged)({ actionListId: actionListId, isPlaying: false })); } } }); } // $FlowFixMe function stopActionGroup(_ref18) { var store = _ref18.store, eventId = _ref18.eventId, eventTarget = _ref18.eventTarget, eventStateKey = _ref18.eventStateKey, actionListId = _ref18.actionListId; var _store$getState12 = store.getState(), ixInstances = _store$getState12.ixInstances, ixSession = _store$getState12.ixSession; // Check for element boundary before stopping engine instances var eventElementRoot = ixSession.hasBoundaryNodes && eventTarget ? elementApi.getClosestElement(eventTarget, BOUNDARY_SELECTOR) : null; (0, _forEach["default"])(ixInstances, function (instance) { var boundaryMode = (0, _get["default"])(instance, 'actionItem.config.target.boundaryMode'); // Validate event key if eventStateKey was provided, otherwise default to true var validEventKey = eventStateKey ? instance.eventStateKey === eventStateKey : true; // Remove engine instances that match the required ids if (instance.actionListId === actionListId && instance.eventId === eventId && validEventKey) { // Avoid removal when root boundary does not contain instance element if (eventElementRoot && boundaryMode && !elementApi.elementContains(eventElementRoot, instance.element)) { return; } removeInstance(instance, store); if (instance.verbose) { store.dispatch((0, _IX2EngineActions.actionListPlaybackChanged)({ actionListId: actionListId, isPlaying: false })); } } }); } // $FlowFixMe function startActionGroup(_ref19) { var store = _ref19.store, eventId = _ref19.eventId, eventTarget = _ref19.eventTarget, eventStateKey = _ref19.eventStateKey, actionListId = _ref19.actionListId, _ref19$groupIndex = _ref19.groupIndex, groupIndex = _ref19$groupIndex === void 0 ? 0 : _ref19$groupIndex, immediate = _ref19.immediate, verbose = _ref19.verbose; var _store$getState13 = store.getState(), ixData = _store$getState13.ixData, ixSession = _store$getState13.ixSession; var events = ixData.events; var event = events[eventId] || {}; var _event$mediaQueries3 = event.mediaQueries, mediaQueries = _event$mediaQueries3 === void 0 ? ixData.mediaQueryKeys : _event$mediaQueries3; var actionList = (0, _get["default"])(ixData, "actionLists.".concat(actionListId), {}); var actionItemGroups = actionList.actionItemGroups, useFirstGroupAsInitialState = actionList.useFirstGroupAsInitialState; // Abort playback if no action groups if (!actionItemGroups || !actionItemGroups.length) { return false; } // Reset to first group when event loop is configured if (groupIndex >= actionItemGroups.length && (0, _get["default"])(event, 'config.loop')) { groupIndex = 0; } // Skip initial state group during action list playback, as it should already be applied if (groupIndex === 0 && useFirstGroupAsInitialState) { groupIndex++; } // Identify first animated group and apply the initial QuickEffect delay var isFirstGroup = groupIndex === 0 || groupIndex === 1 && useFirstGroupAsInitialState; var instanceDelay = isFirstGroup && isQuickEffect(event.action && event.action.actionTypeId) ? event.config.delay : undefined; // Abort playback if no action items exist at group index var actionItems = (0, _get["default"])(actionItemGroups, [groupIndex, 'actionItems'], []); if (!actionItems.length) { return false; } // Abort playback if current media query is not listed in event config if (!shouldAllowMediaQuery(mediaQueries, ixSession.mediaQueryKey)) { return false; } // Limit affected elements when event target is within a boundary node var eventElementRoot = ixSession.hasBoundaryNodes && eventTarget ? elementApi.getClosestElement(eventTarget, BOUNDARY_SELECTOR) : null; var carrierIndex = getMaxDurationItemIndex(actionItems); var groupStartResult = false; actionItems.forEach(function (actionItem, actionIndex) { var config = actionItem.config, actionTypeId = actionItem.actionTypeId; var shouldUsePlugin = isPluginType(actionTypeId); var target = config.target; if (!target) { return; } var elementRoot = target.boundaryMode ? eventElementRoot : null; var elements = getAffectedElements({ config: config, event: event, eventTarget: eventTarget, elementRoot: elementRoot, elementApi: elementApi }); elements.forEach(function (element, elementIndex) { var pluginInstance = shouldUsePlugin ? // $FlowFixMe createPluginInstance(actionTypeId)(element, actionItem) : null; var pluginDuration = shouldUsePlugin ? // $FlowFixMe getPluginDuration(actionTypeId)(element, actionItem) : null; groupStartResult = true; var isCarrier = carrierIndex === actionIndex && elementIndex === 0; var computedStyle = getComputedStyle({ element: element, actionItem: actionItem }); var destination = getDestinationValues({ element: element, actionItem: actionItem, elementApi: elementApi }, // $FlowFixMe pluginInstance); createInstance({ store: store, element: element, actionItem: actionItem, eventId: eventId, eventTarget: eventTarget, eventStateKey: eventStateKey, actionListId: actionListId, groupIndex: groupIndex, isCarrier: isCarrier, computedStyle: computedStyle, destination: destination, immediate: immediate, verbose: verbose, pluginInstance: pluginInstance, pluginDuration: pluginDuration, instanceDelay: instanceDelay }); }); }); return groupStartResult; } function createInstance(options) { // $FlowFixMe var store = options.store, computedStyle = options.computedStyle, rest = (0, _objectWithoutPropertiesLoose2["default"])(options, ["store", "computedStyle"]); // $FlowFixMe var autoStart = !rest.continuous; // $FlowFixMe var element = rest.element, actionItem = rest.actionItem, immediate = rest.immediate, pluginInstance = rest.pluginInstance; var instanceId = getInstanceId(); var _store$getState14 = store.getState(), ixElements = _store$getState14.ixElements, ixSession = _store$getState14.ixSession; var elementId = getElementId(ixElements, element); var _ref20 = ixElements[elementId] || {}, refState = _ref20.refState; var refType = elementApi.getRefType(element); var origin = getInstanceOrigin(element, refState, computedStyle, actionItem, elementApi, // $FlowFixMe pluginInstance); store.dispatch((0, _IX2EngineActions.instanceAdded)((0, _extends2["default"])({ instanceId: instanceId, elementId: elementId, origin: origin, refType: refType }, rest))); dispatchCustomEvent(document.body, 'ix2-animation-started', instanceId); if (immediate) { renderImmediateInstance(store, instanceId); return; } observeStore({ store: store, select: function select(_ref21) { var ixInstances = _ref21.ixInstances; return ixInstances[instanceId]; }, onChange: handleInstanceChange }); if (autoStart) { store.dispatch((0, _IX2EngineActions.instanceStarted)(instanceId, ixSession.tick)); } } function removeInstance(instance, store) { dispatchCustomEvent(document.body, 'ix2-animation-stopping', { instanceId: instance.id, state: store.getState() }); var elementId = instance.elementId, actionItem = instance.actionItem; var _store$getState15 = store.getState(), ixElements = _store$getState15.ixElements; var _ref22 = ixElements[elementId] || {}, ref = _ref22.ref, refType = _ref22.refType; if (refType === HTML_ELEMENT) { cleanupHTMLElement(ref, actionItem, elementApi); } store.dispatch((0, _IX2EngineActions.instanceRemoved)(instance.id)); } function dispatchCustomEvent(element, eventName, detail) { var event = document.createEvent('CustomEvent'); event.initCustomEvent(eventName, true, true, detail); // $FlowFixMe element.dispatchEvent(event); } function renderImmediateInstance(store, instanceId) { var _store$getState16 = store.getState(), ixParameters = _store$getState16.ixParameters; store.dispatch((0, _IX2EngineActions.instanceStarted)(instanceId, 0)); store.dispatch((0, _IX2EngineActions.animationFrameChanged)(performance.now(), ixParameters)); var _store$getState17 = store.getState(), ixInstances = _store$getState17.ixInstances; handleInstanceChange(ixInstances[instanceId], store); } function handleInstanceChange(instance, store) { var active = instance.active, continuous = instance.continuous, complete = instance.complete, elementId = instance.elementId, actionItem = instance.actionItem, actionTypeId = instance.actionTypeId, renderType = instance.renderType, current = instance.current, groupIndex = instance.groupIndex, eventId = instance.eventId, eventTarget = instance.eventTarget, eventStateKey = instance.eventStateKey, actionListId = instance.actionListId, isCarrier = instance.isCarrier, styleProp = instance.styleProp, verbose = instance.verbose, pluginInstance = instance.pluginInstance; // Bypass render if current media query is not listed in event config var _store$getState18 = store.getState(), ixData = _store$getState18.ixData, ixSession = _store$getState18.ixSession; var events = ixData.events; var event = events[eventId] || {}; var _event$mediaQueries4 = event.mediaQueries, mediaQueries = _event$mediaQueries4 === void 0 ? ixData.mediaQueryKeys : _event$mediaQueries4; if (!shouldAllowMediaQuery(mediaQueries, ixSession.mediaQueryKey)) { return; } if (continuous || active || complete) { if (current || renderType === RENDER_GENERAL && complete) { // Render current values to ref state and grab latest store.dispatch((0, _IX2EngineActions.elementStateChanged)(elementId, actionTypeId, current, actionItem)); var _store$getState19 = store.getState(), ixElements = _store$getState19.ixElements; var _ref23 = ixElements[elementId] || {}, ref = _ref23.ref, refType = _ref23.refType, refState = _ref23.refState; var actionState = refState && refState[actionTypeId]; // Choose render based on ref type switch (refType) { case HTML_ELEMENT: { renderHTMLElement(ref, refState, actionState, eventId, actionItem, styleProp, elementApi, renderType, pluginInstance); break; } } } if (complete) { if (isCarrier) { var started = startActionGroup({ store: store, eventId: eventId, eventTarget: eventTarget, eventStateKey: eventStateKey, actionListId: actionListId, groupIndex: groupIndex + 1, verbose: verbose }); if (verbose && !started) { store.dispatch((0, _IX2EngineActions.actionListPlaybackChanged)({ actionListId: actionListId, isPlaying: false })); } } removeInstance(instance, store); } } } /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(148); /** * 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; /***/ }), /* 148 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /* 149 */ /***/ (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; /***/ }), /* 150 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(12); /** 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; /***/ }), /* 151 */ /***/ (function(module, exports, __webpack_require__) { var metaMap = __webpack_require__(370), noop = __webpack_require__(371); /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; module.exports = getData; /***/ }), /* 152 */ /***/ (function(module, exports, __webpack_require__) { var realNames = __webpack_require__(372); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } module.exports = getFuncName; /***/ }), /* 153 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(154); __webpack_require__(285); __webpack_require__(39); __webpack_require__(287); __webpack_require__(378); __webpack_require__(379); __webpack_require__(380); __webpack_require__(381); __webpack_require__(382); __webpack_require__(387); __webpack_require__(388); __webpack_require__(389); __webpack_require__(390); module.exports = __webpack_require__(391); /***/ }), /* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // @wf-will-never-add-flow-to-this-file /* eslint-disable no-var */ var Webflow = __webpack_require__(4); var lottieSiteModule = __webpack_require__(156); var lottie = __webpack_require__(284); Webflow.define('lottie', module.exports = function () { return { lottie: lottie, createInstance: lottieSiteModule.createInstance, cleanupElement: lottieSiteModule.cleanupElement, init: lottieSiteModule.init, destroy: lottieSiteModule.destroy, ready: lottieSiteModule.ready }; }); /***/ }), /* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // @wf-will-never-add-flow-to-this-file // Include tram for frame-throttling /* globals window */ /* eslint-disable no-var */ var $ = window.$; var tram = __webpack_require__(92) && $.tram; /*! * Webflow._ (aka) Underscore.js 1.6.0 (custom build) * _.each * _.map * _.find * _.filter * _.any * _.contains * _.delay * _.defer * _.throttle (webflow) * _.debounce * _.keys * _.has * _.now * * http://underscorejs.org * (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Underscore may be freely distributed under the MIT license. * @license MIT */ module.exports = function () { var _ = {}; // Current version. _.VERSION = '1.6.0-Webflow'; // Establish the object that gets returned to break out of a loop iteration. var breaker = {}; // Save bytes in the minified (but not gzipped) version: /* eslint-disable one-var */ var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; /* eslint-enable one-var */ // Create quick reference variables for speed access to core prototypes. /* eslint-disable one-var, no-unused-vars */ var push = ArrayProto.push, slice = ArrayProto.slice, concat = ArrayProto.concat, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty; /* eslint-enable one-var, no-unused-vars */ // All **ECMAScript 5** native function implementations that we hope to use // are declared here. /* eslint-disable one-var, no-unused-vars */ var nativeForEach = ArrayProto.forEach, nativeMap = ArrayProto.map, nativeReduce = ArrayProto.reduce, nativeReduceRight = ArrayProto.reduceRight, nativeFilter = ArrayProto.filter, nativeEvery = ArrayProto.every, nativeSome = ArrayProto.some, nativeIndexOf = ArrayProto.indexOf, nativeLastIndexOf = ArrayProto.lastIndexOf, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind; /* eslint-enable one-var, no-unused-vars */ // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. // Handles objects with the built-in `forEach`, arrays, and raw objects. // Delegates to **ECMAScript 5**'s native `forEach` if available. var each = _.each = _.forEach = function (obj, iterator, context) { /* jshint shadow:true */ if (obj == null) return obj; if (nativeForEach && obj.forEach === nativeForEach) { obj.forEach(iterator, context); // eslint-disable-next-line no-implicit-coercion } else if (obj.length === +obj.length) { for (var i = 0, length = obj.length; i < length; i++) { if (iterator.call(context, obj[i], i, obj) === breaker) return; } } else { var keys = _.keys(obj); // eslint-disable-next-line no-redeclare for (var i = 0, length = keys.length; i < length; i++) { if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; } } return obj; }; // Return the results of applying the iterator to each element. // Delegates to **ECMAScript 5**'s native `map` if available. _.map = _.collect = function (obj, iterator, context) { var results = []; if (obj == null) return results; if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); each(obj, function (value, index, list) { results.push(iterator.call(context, value, index, list)); }); return results; }; // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function (obj, predicate, context) { var result; any(obj, function (value, index, list) { if (predicate.call(context, value, index, list)) { result = value; return true; } }); return result; }; // Return all the elements that pass a truth test. // Delegates to **ECMAScript 5**'s native `filter` if available. // Aliased as `select`. _.filter = _.select = function (obj, predicate, context) { var results = []; if (obj == null) return results; if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); each(obj, function (value, index, list) { if (predicate.call(context, value, index, list)) results.push(value); }); return results; }; // Determine if at least one element in the object matches a truth test. // Delegates to **ECMAScript 5**'s native `some` if available. // Aliased as `any`. var any = _.some = _.any = function (obj, predicate, context) { predicate || (predicate = _.identity); var result = false; if (obj == null) return result; if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); each(obj, function (value, index, list) { if (result || (result = predicate.call(context, value, index, list))) return breaker; }); return !!result; // eslint-disable-line no-implicit-coercion }; // Determine if the array or object contains a given value (using `===`). // Aliased as `include`. _.contains = _.include = function (obj, target) { if (obj == null) return false; if (nativeIndexOf && obj.indexOf === nativeIndexOf) // eslint-disable-next-line eqeqeq return obj.indexOf(target) != -1; return any(obj, function (value) { return value === target; }); }; // Function (ahem) Functions // -------------------- // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function (func, wait) { var args = slice.call(arguments, 2); return setTimeout(function () { return func.apply(null, args); }, wait); }; // Defers a function, scheduling it to run after the current call stack has // cleared. _.defer = function (func) { return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); }; // Returns a function, that, when invoked, will only be triggered once every // browser animation frame - using tram's requestAnimationFrame polyfill. _.throttle = function (func) { // eslint-disable-next-line one-var var wait, args, context; return function () { if (wait) return; wait = true; args = arguments; context = this; tram.frame(function () { wait = false; func.apply(context, args); }); }; }; // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function (func, wait, immediate) { // eslint-disable-next-line one-var var timeout, args, context, timestamp, result; var later = function later() { var last = _.now() - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } }; return function () { context = this; args = arguments; timestamp = _.now(); var callNow = immediate && !timeout; if (!timeout) { timeout = setTimeout(later, wait); } if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; }; // Object Functions // ---------------- // Fill in a given object with default properties. _.defaults = function (obj) { if (!_.isObject(obj)) return obj; for (var i = 1, length = arguments.length; i < length; i++) { var source = arguments[i]; for (var prop in source) { // eslint-disable-next-line no-void if (obj[prop] === void 0) obj[prop] = source[prop]; } } return obj; }; // Retrieve the names of an object's properties. // Delegates to **ECMAScript 5**'s native `Object.keys` _.keys = function (obj) { if (!_.isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) { if (_.has(obj, key)) keys.push(key); } return keys; }; // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function (obj, key) { return hasOwnProperty.call(obj, key); }; // Is a given variable an object? _.isObject = function (obj) { return obj === Object(obj); }; // Utility Functions // ----------------- // A (possibly faster) way to get the current timestamp as an integer. _.now = Date.now || function () { return new Date().getTime(); }; // By default, Underscore uses ERB-style template delimiters, change the // following template settings to use alternative delimiters. _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; // When customizing `templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', "\u2028": 'u2028', "\u2029": 'u2029' }; var escaper = /\\|'|\r|\n|\u2028|\u2029/g; var escapeChar = function escapeChar(match) { return '\\' + escapes[match]; }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. _.template = function (text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function (match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escaper, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; // If a variable is not specified, place data values in local scope. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; try { // eslint-disable-next-line no-new-func var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } var template = function template(data) { return render.call(this, data, _); }; // Provide the compiled source as a convenience for precompilation. var argument = settings.variable || 'obj'; template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; // Export underscore return _; }(); /* eslint-enable */ /***/ }), /* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault2 = __webpack_require__(1); var _classCallCheck2 = _interopRequireDefault2(__webpack_require__(157)); var _createClass2 = _interopRequireDefault2(__webpack_require__(158)); var _interopRequireDefault = __webpack_require__(1); Object.defineProperty(exports, "__esModule", { value: true }); exports.ready = exports.destroy = exports.init = exports.cleanupElement = exports.createInstance = void 0; var _extends2 = _interopRequireDefault(__webpack_require__(30)); var _defineProperty2 = _interopRequireDefault(__webpack_require__(31)); var _findIndex = _interopRequireDefault(__webpack_require__(93)); __webpack_require__(223); /* eslint-env browser */ var getLottieLibrary = function getLottieLibrary() { return window.Webflow.require('lottie').lottie; }; var isInDesigner = function isInDesigner() { return Boolean(window.Webflow.env('design') || window.Webflow.env('preview')); }; var PlayerState = { Playing: 'playing', Stopped: 'stopped' }; var Cache = /*#__PURE__*/ function () { function Cache() { (0, _classCallCheck2["default"])(this, Cache); (0, _defineProperty2["default"])(this, "_cache", []); } (0, _createClass2["default"])(Cache, [{ key: "set", value: function set(container, instance) { var index = (0, _findIndex["default"])(this._cache, function (_ref) { var wrapper = _ref.wrapper; return wrapper === container; }); if (index !== -1) this._cache.splice(index, 1); this._cache.push({ wrapper: container, instance: instance }); } }, { key: "delete", value: function _delete(container) { var index = (0, _findIndex["default"])(this._cache, function (_ref2) { var wrapper = _ref2.wrapper; return wrapper === container; }); if (index !== -1) this._cache.splice(index, 1); } }, { key: "get", value: function get(container) { var index = (0, _findIndex["default"])(this._cache, function (_ref3) { var wrapper = _ref3.wrapper; return wrapper === container; }); return index !== -1 ? this._cache[index].instance : null; } }]); return Cache; }(); var cache = new Cache(); var emptyObject = {}; var LottieInstance = /*#__PURE__*/ function () { function LottieInstance() { (0, _classCallCheck2["default"])(this, LottieInstance); (0, _defineProperty2["default"])(this, "config", null); (0, _defineProperty2["default"])(this, "currentState", PlayerState.Stopped); (0, _defineProperty2["default"])(this, "handlers", { enterFrame: [], complete: [], loop: [], dataReady: [], destroy: [], error: [] }); } (0, _createClass2["default"])(LottieInstance, [{ key: "load", value: function load(container) { var _this = this; var dataset = container.dataset || emptyObject; var src = dataset.src || ''; // Available options here https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio var preserveAspectRatio = dataset.preserveAspectRatio || 'xMidYMid meet'; var renderer = dataset.renderer || 'svg'; var loop = parseFloat(dataset.loop) === 1; var direction = parseFloat(dataset.direction) || 1; var autoplay = parseFloat(dataset.autoplay) === 1; var duration = parseFloat(dataset.duration) || 0; var hasIx2 = parseFloat(dataset.isIx2Target) === 1; var ix2InitialValue = parseFloat(dataset.ix2InitialState); if (isNaN(ix2InitialValue)) { ix2InitialValue = null; } var config = { src: src, loop: loop, autoplay: autoplay, renderer: renderer, direction: direction, duration: duration, hasIx2: hasIx2, ix2InitialValue: ix2InitialValue, preserveAspectRatio: preserveAspectRatio }; // If it's the same path/src, don't destroy the animation if (this.animationItem && this.config && this.config.src === src && renderer === this.config.renderer && preserveAspectRatio === this.config.preserveAspectRatio) { if (loop !== this.config.loop) { this.setLooping(loop); } if (!hasIx2) { if (direction !== this.config.direction) { this.setDirection(direction); } if (duration !== this.config.duration) { if (duration > 0 && duration !== this.duration) { this.setSpeed(this.duration / duration); } else { this.setSpeed(1); } } } if (autoplay) { this.play(); } if (ix2InitialValue && ix2InitialValue !== this.config.ix2InitialValue) { var percent = ix2InitialValue / 100; this.goToFrame(this.frames * percent); } this.config = config; return; } var options = { container: container, loop: loop, autoplay: autoplay, renderer: renderer, rendererSettings: { preserveAspectRatio: preserveAspectRatio, progressiveLoad: true, hideOnTransparent: true } }; try { // Clear previous animation, if any if (this.animationItem) { this.destroy(); } // Initialize lottie player and load animation this.animationItem = getLottieLibrary().loadAnimation((0, _extends2["default"])({}, options, { path: src })); } catch (err) { this.handlers.error.forEach(function (cb) { return cb(err); }); return; } if (!this.animationItem) return; if (isInDesigner()) { // Calculate and save the current progress of the animation this.animationItem.addEventListener('enterFrame', function () { if (!_this.isPlaying) return; var _this$animationItem = _this.animationItem, currentFrame = _this$animationItem.currentFrame, totalFrames = _this$animationItem.totalFrames, playDirection = _this$animationItem.playDirection; var toPercent = currentFrame / totalFrames * 100; var percentage = Math.round(playDirection === 1 ? toPercent : 100 - toPercent); _this.handlers.enterFrame.forEach(function (cb) { return cb(percentage, currentFrame); }); }); // Handle animation play complete this.animationItem.addEventListener('complete', function () { if (_this.currentState !== PlayerState.Playing) { _this.handlers.complete.forEach(function (cb) { return cb(); }); return; } if (!_this.animationItem.loop) { _this.handlers.complete.forEach(function (cb) { return cb(); }); return; } _this.currentState = PlayerState.Stopped; }); // Handle animation play complete this.animationItem.addEventListener('loopComplete', function (loopComplete) { _this.handlers.loop.forEach(function (cb) { return cb(loopComplete); }); }); // Set error state when animation load fail event triggers this.animationItem.addEventListener('data_failed', function (err) { _this.handlers.error.forEach(function (cb) { return cb(err); }); }); // Set error state when animation load fail event triggers this.animationItem.addEventListener('error', function (err) { _this.handlers.error.forEach(function (cb) { return cb(err); }); }); } if (this.isLoaded) { this.handlers.dataReady.forEach(function (cb) { return cb(); }); if (autoplay) { this.play(); } } else { // Handle animation data load complete this.animationItem.addEventListener('data_ready', function () { _this.handlers.dataReady.forEach(function (cb) { return cb(); }); // Only set the direction and speed if no IX2 is attached if (!hasIx2) { _this.setDirection(direction); if (duration > 0 && duration !== _this.duration) { _this.setSpeed(_this.duration / duration); } if (autoplay) { _this.play(); } } // Set the animation's initial state value from IX2 if (ix2InitialValue) { var _percent = ix2InitialValue / 100; _this.goToFrame(_this.frames * _percent); } }); } cache.set(container, this); this.container = container; this.config = config; } }, { key: "onFrameChange", value: function onFrameChange(cb) { if (this.handlers.enterFrame.indexOf(cb) === -1) { this.handlers.enterFrame.push(cb); } } }, { key: "onPlaybackComplete", value: function onPlaybackComplete(cb) { if (this.handlers.complete.indexOf(cb) === -1) { this.handlers.complete.push(cb); } } }, { key: "onLoopComplete", value: function onLoopComplete(cb) { if (this.handlers.loop.indexOf(cb) === -1) { this.handlers.loop.push(cb); } } }, { key: "onDestroy", value: function onDestroy(cb) { if (this.handlers.destroy.indexOf(cb) === -1) { this.handlers.destroy.push(cb); } } }, { key: "onDataReady", value: function onDataReady(cb) { if (this.handlers.dataReady.indexOf(cb) === -1) { this.handlers.dataReady.push(cb); } } }, { key: "onError", value: function onError(cb) { if (this.handlers.error.indexOf(cb) === -1) { this.handlers.error.push(cb); } } }, { key: "play", value: function play() { if (!this.animationItem) return; var frame = this.animationItem.playDirection === 1 ? 0 : this.frames; this.animationItem.goToAndPlay(frame, true); this.currentState = PlayerState.Playing; } }, { key: "stop", value: function stop() { if (!this.animationItem) return; if (this.isPlaying) { var playDirection = this.animationItem.playDirection; var frame = playDirection === 1 ? 0 : this.frames; this.animationItem.goToAndStop(frame, true); } this.currentState = PlayerState.Stopped; } }, { key: "destroy", value: function destroy() { var _this2 = this; if (!this.animationItem) return; if (this.isPlaying) this.stop(); this.handlers.destroy.forEach(function (cb) { return cb(); }); if (this.container) { cache["delete"](this.container); } this.animationItem.destroy(); Object.keys(this.handlers).forEach(function (key) { return _this2.handlers[key].length = 0; }); this.animationItem = null; this.container = null; this.config = null; } }, { key: "goToFrame", value: function goToFrame(value) { if (!this.animationItem) return; this.animationItem.setCurrentRawFrameValue(value); } }, { key: "setSubframe", value: function setSubframe(value) { if (!this.animationItem) return; this.animationItem.setSubframe(value); } }, { key: "setSpeed", value: function setSpeed() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; if (!this.animationItem) return; if (this.isPlaying) this.stop(); this.animationItem.setSpeed(value); } }, { key: "setLooping", value: function setLooping(value) { if (!this.animationItem) return; if (this.isPlaying) this.stop(); this.animationItem.loop = value; } }, { key: "setDirection", value: function setDirection(value) { if (!this.animationItem) return; if (this.isPlaying) this.stop(); this.animationItem.setDirection(value); this.goToFrame(value === 1 ? 0 : this.frames); } }, { key: "isPlaying", get: function get() { if (!this.animationItem) return false; return !this.animationItem.isPaused; } }, { key: "isPaused", get: function get() { if (!this.animationItem) return false; return this.animationItem.isPaused; } }, { key: "duration", get: function get() { if (!this.animationItem) return 0; return this.animationItem.getDuration(); } }, { key: "frames", get: function get() { if (!this.animationItem) return 0; return this.animationItem.totalFrames; } }, { key: "direction", get: function get() { if (!this.animationItem) return 1; return this.animationItem.playDirection; } }, { key: "isLoaded", get: function get() { if (!this.animationItem) false; return this.animationItem.isLoaded; } }, { key: "ix2InitialValue", get: function get() { return this.config ? this.config.ix2InitialValue : null; } }]); return LottieInstance; }(); var getLottieElements = function getLottieElements() { return Array.from(document.querySelectorAll('[data-animation-type="lottie"]')); }; var createInstance = function createInstance(container) { var lottieInstance = cache.get(container); if (lottieInstance == null) { lottieInstance = new LottieInstance(); } lottieInstance.load(container); return lottieInstance; }; exports.createInstance = createInstance; var cleanupElement = function cleanupElement(element) { var lottieInstance = cache.get(element); if (lottieInstance) { lottieInstance.destroy(); } }; exports.cleanupElement = cleanupElement; var init = function init() { getLottieElements().forEach(function (element) { var hasIx2 = parseFloat(element.getAttribute('data-is-ix2-target')) === 1; if (!hasIx2) { cleanupElement(element); } createInstance(element); }); }; exports.init = init; var destroy = function destroy() { getLottieElements().forEach(cleanupElement); }; exports.destroy = destroy; var ready = init; exports.ready = ready; /***/ }), /* 157 */ /***/ (function(module, exports) { function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } module.exports = _classCallCheck; /***/ }), /* 158 */ /***/ (function(module, exports) { function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } module.exports = _createClass; /***/ }), /* 159 */ /***/ (function(module, exports, __webpack_require__) { var baseIsMatch = __webpack_require__(160), getMatchData = __webpack_require__(212), matchesStrictComparable = __webpack_require__(109); /** * 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; /***/ }), /* 160 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(95), baseIsEqual = __webpack_require__(99); /** 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; /***/ }), /* 161 */ /***/ (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; /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(44); /** 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; /***/ }), /* 163 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(44); /** * 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; /***/ }), /* 164 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(44); /** * 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; /***/ }), /* 165 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(44); /** * 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; /***/ }), /* 166 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(43); /** * 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; /***/ }), /* 167 */ /***/ (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; /***/ }), /* 168 */ /***/ (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; /***/ }), /* 169 */ /***/ (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; /***/ }), /* 170 */ /***/ (function(module, exports, __webpack_require__) { var ListCache = __webpack_require__(43), Map = __webpack_require__(58), MapCache = __webpack_require__(59); /** 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; /***/ }), /* 171 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(96), isMasked = __webpack_require__(174), isObject = __webpack_require__(12), toSource = __webpack_require__(98); /** * 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; /***/ }), /* 172 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(32); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/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; /***/ }), /* 173 */ /***/ (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; /***/ }), /* 174 */ /***/ (function(module, exports, __webpack_require__) { var coreJsData = __webpack_require__(175); /** 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; /***/ }), /* 175 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(9); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /* 176 */ /***/ (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; /***/ }), /* 177 */ /***/ (function(module, exports, __webpack_require__) { var Hash = __webpack_require__(178), ListCache = __webpack_require__(43), Map = __webpack_require__(58); /** * 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; /***/ }), /* 178 */ /***/ (function(module, exports, __webpack_require__) { var hashClear = __webpack_require__(179), hashDelete = __webpack_require__(180), hashGet = __webpack_require__(181), hashHas = __webpack_require__(182), hashSet = __webpack_require__(183); /** * 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; /***/ }), /* 179 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(46); /** * 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; /***/ }), /* 180 */ /***/ (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; /***/ }), /* 181 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(46); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * 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; /***/ }), /* 182 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(46); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * 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; /***/ }), /* 183 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(46); /** 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; /***/ }), /* 184 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(47); /** * 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; /***/ }), /* 185 */ /***/ (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; /***/ }), /* 186 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(47); /** * 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; /***/ }), /* 187 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(47); /** * 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; /***/ }), /* 188 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(47); /** * 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; /***/ }), /* 189 */ /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__(95), equalArrays = __webpack_require__(100), equalByTag = __webpack_require__(195), equalObjects = __webpack_require__(199), getTag = __webpack_require__(67), isArray = __webpack_require__(2), isBuffer = __webpack_require__(61), isTypedArray = __webpack_require__(63); /** 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; /***/ }), /* 190 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(59), setCacheAdd = __webpack_require__(191), setCacheHas = __webpack_require__(192); /** * * 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; /***/ }), /* 191 */ /***/ (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; /***/ }), /* 192 */ /***/ (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; /***/ }), /* 193 */ /***/ (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; /***/ }), /* 194 */ /***/ (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; /***/ }), /* 195 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(32), Uint8Array = __webpack_require__(196), eq = __webpack_require__(57), equalArrays = __webpack_require__(100), mapToArray = __webpack_require__(197), setToArray = __webpack_require__(198); /** 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; /***/ }), /* 196 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(9); /** Built-in value references. */ var Uint8Array = root.Uint8Array; module.exports = Uint8Array; /***/ }), /* 197 */ /***/ (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; /***/ }), /* 198 */ /***/ (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; /***/ }), /* 199 */ /***/ (function(module, exports, __webpack_require__) { var getAllKeys = __webpack_require__(200); /** 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; /***/ }), /* 200 */ /***/ (function(module, exports, __webpack_require__) { var baseGetAllKeys = __webpack_require__(101), getSymbols = __webpack_require__(102), keys = __webpack_require__(48); /** * 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; /***/ }), /* 201 */ /***/ (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; /***/ }), /* 202 */ /***/ (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; /***/ }), /* 203 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(24), isObjectLike = __webpack_require__(20); /** `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; /***/ }), /* 204 */ /***/ (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; /***/ }), /* 205 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(24), isLength = __webpack_require__(64), isObjectLike = __webpack_require__(20); /** `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; /***/ }), /* 206 */ /***/ (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; /***/ }), /* 207 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(97); /** Detect free variable `exports`. */ var freeExports = true && 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 { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); module.exports = nodeUtil; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(105)(module))) /***/ }), /* 208 */ /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__(106); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /* 209 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19), root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); module.exports = DataView; /***/ }), /* 210 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19), root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); module.exports = Promise; /***/ }), /* 211 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(19), root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); module.exports = Set; /***/ }), /* 212 */ /***/ (function(module, exports, __webpack_require__) { var isStrictComparable = __webpack_require__(108), keys = __webpack_require__(48); /** * 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; /***/ }), /* 213 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__(99), get = __webpack_require__(50), hasIn = __webpack_require__(217), isKey = __webpack_require__(69), isStrictComparable = __webpack_require__(108), matchesStrictComparable = __webpack_require__(109), toKey = __webpack_require__(33); /** 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; /***/ }), /* 214 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(215); /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); module.exports = stringToPath; /***/ }), /* 215 */ /***/ (function(module, exports, __webpack_require__) { var memoize = __webpack_require__(216); /** 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; /***/ }), /* 216 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(59); /** 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; /***/ }), /* 217 */ /***/ (function(module, exports, __webpack_require__) { var baseHasIn = __webpack_require__(218), hasPath = __webpack_require__(219); /** * 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; /***/ }), /* 218 */ /***/ (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; /***/ }), /* 219 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(51), isArguments = __webpack_require__(49), isArray = __webpack_require__(2), isIndex = __webpack_require__(62), isLength = __webpack_require__(64), toKey = __webpack_require__(33); /** * 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; /***/ }), /* 220 */ /***/ (function(module, exports, __webpack_require__) { var baseProperty = __webpack_require__(113), basePropertyDeep = __webpack_require__(221), isKey = __webpack_require__(69), toKey = __webpack_require__(33); /** * 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; /***/ }), /* 221 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(68); /** * 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; /***/ }), /* 222 */ /***/ (function(module, exports, __webpack_require__) { var toNumber = __webpack_require__(72); /** 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; /***/ }), /* 223 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(224); __webpack_require__(282); __webpack_require__(283); /***/ }), /* 224 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(225); __webpack_require__(242); __webpack_require__(249); __webpack_require__(250); __webpack_require__(251); __webpack_require__(252); __webpack_require__(254); __webpack_require__(255); __webpack_require__(257); __webpack_require__(258); __webpack_require__(259); __webpack_require__(260); __webpack_require__(261); __webpack_require__(262); __webpack_require__(264); __webpack_require__(265); __webpack_require__(266); __webpack_require__(267); __webpack_require__(268); __webpack_require__(270); __webpack_require__(271); __webpack_require__(272); __webpack_require__(273); __webpack_require__(274); __webpack_require__(275); __webpack_require__(276); __webpack_require__(277); __webpack_require__(279); __webpack_require__(280); __webpack_require__(281); var path = __webpack_require__(121); module.exports = path.Array; /***/ }), /* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var charAt = __webpack_require__(226).charAt; var InternalStateModule = __webpack_require__(74); var defineIterator = __webpack_require__(118); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); /***/ }), /* 226 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(26); var requireObjectCoercible = __webpack_require__(73); // `String.prototype.{ codePointAt, at }` methods implementation var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible($this)); var position = toInteger(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { // `String.prototype.codePointAt` method // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod(true) }; /***/ }), /* 227 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(10); var nativeFunctionToString = __webpack_require__(114); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap)); /***/ }), /* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; /***/ }), /* 229 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(17); var ownKeys = __webpack_require__(230); var getOwnPropertyDescriptorModule = __webpack_require__(119); var definePropertyModule = __webpack_require__(15); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; /***/ }), /* 230 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(81); var getOwnPropertyNamesModule = __webpack_require__(231); var getOwnPropertySymbolsModule = __webpack_require__(232); var anObject = __webpack_require__(27); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; /***/ }), /* 231 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(122); var enumBugKeys = __webpack_require__(83); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /* 232 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 233 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /* 234 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IteratorPrototype = __webpack_require__(123).IteratorPrototype; var create = __webpack_require__(125); var createPropertyDescriptor = __webpack_require__(54); var setToStringTag = __webpack_require__(126); var Iterators = __webpack_require__(35); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; /***/ }), /* 235 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); /***/ }), /* 236 */ /***/ (function(module, exports, __webpack_require__) { var fails = __webpack_require__(8); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); /***/ }), /* 237 */ /***/ (function(module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(14); var definePropertyModule = __webpack_require__(15); var anObject = __webpack_require__(27); var objectKeys = __webpack_require__(238); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; /***/ }), /* 238 */ /***/ (function(module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(122); var enumBugKeys = __webpack_require__(83); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /* 239 */ /***/ (function(module, exports, __webpack_require__) { var getBuiltIn = __webpack_require__(81); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /* 240 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(27); var aPossiblePrototype = __webpack_require__(241); // `Object.setPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /* 241 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(16); module.exports = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; /***/ }), /* 242 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(0); var from = __webpack_require__(243); var checkCorrectnessOfIteration = __webpack_require__(248); var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { Array.from(iterable); }); // `Array.from` method // https://tc39.github.io/ecma262/#sec-array.from $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from }); /***/ }), /* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(84); var toObject = __webpack_require__(5); var callWithSafeIterationClosing = __webpack_require__(244); var isArrayIteratorMethod = __webpack_require__(245); var toLength = __webpack_require__(3); var createProperty = __webpack_require__(36); var getIteratorMethod = __webpack_require__(246); // `Array.from` method implementation // https://tc39.github.io/ecma262/#sec-array.from module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iteratorMethod = getIteratorMethod(O); var length, result, step, iterator; if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = iteratorMethod.call(O); result = new C(); for (;!(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value ); } } else { length = toLength(O.length); result = new C(length); for (;length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; }; /***/ }), /* 244 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(27); // call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (error) { var returnMethod = iterator['return']; if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); throw error; } }; /***/ }), /* 245 */ /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(6); var Iterators = __webpack_require__(35); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; /***/ }), /* 246 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(247); var Iterators = __webpack_require__(35); var wellKnownSymbol = __webpack_require__(6); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }), /* 247 */ /***/ (function(module, exports, __webpack_require__) { var classofRaw = __webpack_require__(80); var wellKnownSymbol = __webpack_require__(6); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; }; /***/ }), /* 248 */ /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(6); var ITERATOR = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR] = function () { return this; }; // eslint-disable-next-line no-throw-literal Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /* empty */ } module.exports = function (exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; /***/ }), /* 249 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(0); var isArray = __webpack_require__(28); // `Array.isArray` method // https://tc39.github.io/ecma262/#sec-array.isarray $({ target: 'Array', stat: true }, { isArray: isArray }); /***/ }), /* 250 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var fails = __webpack_require__(8); var createProperty = __webpack_require__(36); var ISNT_GENERIC = fails(function () { function F() { /* empty */ } return !(Array.of.call(F) instanceof F); }); // `Array.of` method // https://tc39.github.io/ecma262/#sec-array.of // WebKit Array.of isn't generic $({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { of: function of(/* ...args */) { var index = 0; var argumentsLength = arguments.length; var result = new (typeof this == 'function' ? this : Array)(argumentsLength); while (argumentsLength > index) createProperty(result, index, arguments[index++]); result.length = argumentsLength; return result; } }); /***/ }), /* 251 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var fails = __webpack_require__(8); var isArray = __webpack_require__(28); var isObject = __webpack_require__(16); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var createProperty = __webpack_require__(36); var arraySpeciesCreate = __webpack_require__(37); var arrayMethodHasSpeciesSupport = __webpack_require__(38); var wellKnownSymbol = __webpack_require__(6); var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); var isConcatSpreadable = function (O) { if (!isObject(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray(O); }; var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method // https://tc39.github.io/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species $({ target: 'Array', proto: true, forced: FORCED }, { concat: function concat(arg) { // eslint-disable-line no-unused-vars var O = toObject(this); var A = arraySpeciesCreate(O, 0); var n = 0; var i, k, length, len, E; for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = toLength(E.length); if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); } else { if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); createProperty(A, n++, E); } } A.length = n; return A; } }); /***/ }), /* 252 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(0); var copyWithin = __webpack_require__(253); var addToUnscopables = __webpack_require__(11); // `Array.prototype.copyWithin` method // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin $({ target: 'Array', proto: true }, { copyWithin: copyWithin }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('copyWithin'); /***/ }), /* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toObject = __webpack_require__(5); var toAbsoluteIndex = __webpack_require__(34); var toLength = __webpack_require__(3); var min = Math.min; // `Array.prototype.copyWithin` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { var O = toObject(this); var len = toLength(O.length); var to = toAbsoluteIndex(target, len); var from = toAbsoluteIndex(start, len); var end = arguments.length > 2 ? arguments[2] : undefined; var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); var inc = 1; if (from < to && to < from + count) { inc = -1; from += count - 1; to += count - 1; } while (count-- > 0) { if (from in O) O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }; /***/ }), /* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $every = __webpack_require__(23).every; var sloppyArrayMethod = __webpack_require__(13); // `Array.prototype.every` method // https://tc39.github.io/ecma262/#sec-array.prototype.every $({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, { every: function every(callbackfn /* , thisArg */) { return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 255 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(0); var fill = __webpack_require__(256); var addToUnscopables = __webpack_require__(11); // `Array.prototype.fill` method // https://tc39.github.io/ecma262/#sec-array.prototype.fill $({ target: 'Array', proto: true }, { fill: fill }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('fill'); /***/ }), /* 256 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toObject = __webpack_require__(5); var toAbsoluteIndex = __webpack_require__(34); var toLength = __webpack_require__(3); // `Array.prototype.fill` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.fill module.exports = function fill(value /* , start = 0, end = @length */) { var O = toObject(this); var length = toLength(O.length); var argumentsLength = arguments.length; var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); var end = argumentsLength > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex(end, length); while (endPos > index) O[index++] = value; return O; }; /***/ }), /* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $filter = __webpack_require__(23).filter; var arrayMethodHasSpeciesSupport = __webpack_require__(38); // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $find = __webpack_require__(23).find; var addToUnscopables = __webpack_require__(11); var FIND = 'find'; var SKIPS_HOLES = true; // Shouldn't skip holes if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); // `Array.prototype.find` method // https://tc39.github.io/ecma262/#sec-array.prototype.find $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND); /***/ }), /* 259 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $findIndex = __webpack_require__(23).findIndex; var addToUnscopables = __webpack_require__(11); var FIND_INDEX = 'findIndex'; var SKIPS_HOLES = true; // Shouldn't skip holes if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; }); // `Array.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-array.prototype.findindex $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND_INDEX); /***/ }), /* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var flattenIntoArray = __webpack_require__(127); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var toInteger = __webpack_require__(26); var arraySpeciesCreate = __webpack_require__(37); // `Array.prototype.flat` method // https://github.com/tc39/proposal-flatMap $({ target: 'Array', proto: true }, { flat: function flat(/* depthArg = 1 */) { var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject(this); var sourceLen = toLength(O.length); var A = arraySpeciesCreate(O, 0); A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); return A; } }); /***/ }), /* 261 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var flattenIntoArray = __webpack_require__(127); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var aFunction = __webpack_require__(56); var arraySpeciesCreate = __webpack_require__(37); // `Array.prototype.flatMap` method // https://github.com/tc39/proposal-flatMap $({ target: 'Array', proto: true }, { flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject(this); var sourceLen = toLength(O.length); var A; aFunction(callbackfn); A = arraySpeciesCreate(O, 0); A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); return A; } }); /***/ }), /* 262 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var forEach = __webpack_require__(263); // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach $({ target: 'Array', proto: true, forced: [].forEach != forEach }, { forEach: forEach }); /***/ }), /* 263 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $forEach = __webpack_require__(23).forEach; var sloppyArrayMethod = __webpack_require__(13); // `Array.prototype.forEach` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.foreach module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } : [].forEach; /***/ }), /* 264 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $includes = __webpack_require__(82).includes; var addToUnscopables = __webpack_require__(11); // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes $({ target: 'Array', proto: true }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes'); /***/ }), /* 265 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $indexOf = __webpack_require__(82).indexOf; var sloppyArrayMethod = __webpack_require__(13); var nativeIndexOf = [].indexOf; var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; var SLOPPY_METHOD = sloppyArrayMethod('indexOf'); // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIndexedObject = __webpack_require__(22); var addToUnscopables = __webpack_require__(11); var Iterators = __webpack_require__(35); var InternalStateModule = __webpack_require__(74); var defineIterator = __webpack_require__(118); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.github.io/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.github.io/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.github.io/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.github.io/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var IndexedObject = __webpack_require__(55); var toIndexedObject = __webpack_require__(22); var sloppyArrayMethod = __webpack_require__(13); var nativeJoin = [].join; var ES3_STRINGS = IndexedObject != Object; var SLOPPY_METHOD = sloppyArrayMethod('join', ','); // `Array.prototype.join` method // https://tc39.github.io/ecma262/#sec-array.prototype.join $({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, { join: function join(separator) { return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); } }); /***/ }), /* 268 */ /***/ (function(module, exports, __webpack_require__) { var $ = __webpack_require__(0); var lastIndexOf = __webpack_require__(269); // `Array.prototype.lastIndexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { lastIndexOf: lastIndexOf }); /***/ }), /* 269 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIndexedObject = __webpack_require__(22); var toInteger = __webpack_require__(26); var toLength = __webpack_require__(3); var sloppyArrayMethod = __webpack_require__(13); var min = Math.min; var nativeLastIndexOf = [].lastIndexOf; var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; var SLOPPY_METHOD = sloppyArrayMethod('lastIndexOf'); // `Array.prototype.lastIndexOf` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof module.exports = (NEGATIVE_ZERO || SLOPPY_METHOD) ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0; var O = toIndexedObject(this); var length = toLength(O.length); var index = length - 1; if (arguments.length > 1) index = min(index, toInteger(arguments[1])); if (index < 0) index = length + index; for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; return -1; } : nativeLastIndexOf; /***/ }), /* 270 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $map = __webpack_require__(23).map; var arrayMethodHasSpeciesSupport = __webpack_require__(38); // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 271 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $reduce = __webpack_require__(128).left; var sloppyArrayMethod = __webpack_require__(13); // `Array.prototype.reduce` method // https://tc39.github.io/ecma262/#sec-array.prototype.reduce $({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, { reduce: function reduce(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 272 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $reduceRight = __webpack_require__(128).right; var sloppyArrayMethod = __webpack_require__(13); // `Array.prototype.reduceRight` method // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright $({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduceRight') }, { reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 273 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var isArray = __webpack_require__(28); var nativeReverse = [].reverse; var test = [1, 2]; // `Array.prototype.reverse` method // https://tc39.github.io/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, { reverse: function reverse() { if (isArray(this)) this.length = this.length; return nativeReverse.call(this); } }); /***/ }), /* 274 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var isObject = __webpack_require__(16); var isArray = __webpack_require__(28); var toAbsoluteIndex = __webpack_require__(34); var toLength = __webpack_require__(3); var toIndexedObject = __webpack_require__(22); var createProperty = __webpack_require__(36); var arrayMethodHasSpeciesSupport = __webpack_require__(38); var wellKnownSymbol = __webpack_require__(6); var SPECIES = wellKnownSymbol('species'); var nativeSlice = [].slice; var max = Math.max; // `Array.prototype.slice` method // https://tc39.github.io/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, { slice: function slice(start, end) { var O = toIndexedObject(this); var length = toLength(O.length); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible var Constructor, result, n; if (isArray(O)) { Constructor = O.constructor; // cross-realm fallback if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { Constructor = undefined; } else if (isObject(Constructor)) { Constructor = Constructor[SPECIES]; if (Constructor === null) Constructor = undefined; } if (Constructor === Array || Constructor === undefined) { return nativeSlice.call(O, k, fin); } } result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); result.length = n; return result; } }); /***/ }), /* 275 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var $some = __webpack_require__(23).some; var sloppyArrayMethod = __webpack_require__(13); // `Array.prototype.some` method // https://tc39.github.io/ecma262/#sec-array.prototype.some $({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, { some: function some(callbackfn /* , thisArg */) { return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), /* 276 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var aFunction = __webpack_require__(56); var toObject = __webpack_require__(5); var fails = __webpack_require__(8); var sloppyArrayMethod = __webpack_require__(13); var nativeSort = [].sort; var test = [1, 2, 3]; // IE8- var FAILS_ON_UNDEFINED = fails(function () { test.sort(undefined); }); // V8 bug var FAILS_ON_NULL = fails(function () { test.sort(null); }); // Old WebKit var SLOPPY_METHOD = sloppyArrayMethod('sort'); var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD; // `Array.prototype.sort` method // https://tc39.github.io/ecma262/#sec-array.prototype.sort $({ target: 'Array', proto: true, forced: FORCED }, { sort: function sort(comparefn) { return comparefn === undefined ? nativeSort.call(toObject(this)) : nativeSort.call(toObject(this), aFunction(comparefn)); } }); /***/ }), /* 277 */ /***/ (function(module, exports, __webpack_require__) { var setSpecies = __webpack_require__(278); // `Array[@@species]` getter // https://tc39.github.io/ecma262/#sec-get-array-@@species setSpecies('Array'); /***/ }), /* 278 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(81); var definePropertyModule = __webpack_require__(15); var wellKnownSymbol = __webpack_require__(6); var DESCRIPTORS = __webpack_require__(14); var SPECIES = wellKnownSymbol('species'); module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); var defineProperty = definePropertyModule.f; if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineProperty(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; /***/ }), /* 279 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0); var toAbsoluteIndex = __webpack_require__(34); var toInteger = __webpack_require__(26); var toLength = __webpack_require__(3); var toObject = __webpack_require__(5); var arraySpeciesCreate = __webpack_require__(37); var createProperty = __webpack_require__(36); var arrayMethodHasSpeciesSupport = __webpack_require__(38); var max = Math.max; var min = Math.min; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method // https://tc39.github.io/ecma262/#sec-array.prototype.splice // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject(this); var len = toLength(O.length); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var insertCount, actualDeleteCount, A, k, from, to; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); } if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); } A = arraySpeciesCreate(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty(A, k, O[from]); } A.length = actualDeleteCount; if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from]; else delete O[to]; } for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { from = k + actualDeleteCount - 1; to = k + insertCount - 1; if (from in O) O[to] = O[from]; else delete O[to]; } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } O.length = len - actualDeleteCount + insertCount; return A; } }); /***/ }), /* 280 */ /***/ (function(module, exports, __webpack_require__) { // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables = __webpack_require__(11); addToUnscopables('flat'); /***/ }), /* 281 */ /***/ (function(module, exports, __webpack_require__) { // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables = __webpack_require__(11); addToUnscopables('flatMap'); /***/ }), /* 282 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(14); var addToUnscopables = __webpack_require__(11); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var defineProperty = __webpack_require__(15).f; // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS && !('lastItem' in [])) { defineProperty(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject(this); var len = toLength(O.length); return len == 0 ? undefined : O[len - 1]; }, set: function lastItem(value) { var O = toObject(this); var len = toLength(O.length); return O[len == 0 ? 0 : len - 1] = value; } }); addToUnscopables('lastItem'); } /***/ }), /* 283 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(14); var addToUnscopables = __webpack_require__(11); var toObject = __webpack_require__(5); var toLength = __webpack_require__(3); var defineProperty = __webpack_require__(15).f; // `Array.prototype.lastIndex` getter // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS && !('lastIndex' in [])) { defineProperty(Array.prototype, 'lastIndex', { configurable: true, get: function lastIndex() { var O = toObject(this); var len = toLength(O.length); return len == 0 ? 0 : len - 1; } }); addToUnscopables('lastIndex'); } /***/ }), /* 284 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;(typeof navigator !== "undefined") && (function(root, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return factory(root); }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }((window || {}), function(window) { "use strict"; var svgNS = "http://www.w3.org/2000/svg"; var locationHref = ''; var initialDefaultFrame = -999999; var subframeEnabled = true; var expressionsPlugin; var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); var cachedColors = {}; var bm_rounder = Math.round; var bm_rnd; var bm_pow = Math.pow; var bm_sqrt = Math.sqrt; var bm_abs = Math.abs; var bm_floor = Math.floor; var bm_max = Math.max; var bm_min = Math.min; var blitter = 10; var BMMath = {}; (function(){ var propertyNames = ["abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "cbrt", "expm1", "clz32", "cos", "cosh", "exp", "floor", "fround", "hypot", "imul", "log", "log1p", "log2", "log10", "max", "min", "pow", "random", "round", "sign", "sin", "sinh", "sqrt", "tan", "tanh", "trunc", "E", "LN10", "LN2", "LOG10E", "LOG2E", "PI", "SQRT1_2", "SQRT2"]; var i, len = propertyNames.length; for(i=0;i 1) { hsv[1] = 1; } else if (hsv[1] <= 0) { hsv[1] = 0; } return HSVtoRGB(hsv[0],hsv[1],hsv[2]); } function addBrightnessToRGB(color,offset){ var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255); hsv[2] += offset; if (hsv[2] > 1) { hsv[2] = 1; } else if (hsv[2] < 0) { hsv[2] = 0; } return HSVtoRGB(hsv[0],hsv[1],hsv[2]); } function addHueToRGB(color,offset) { var hsv = RGBtoHSV(color[0]*255,color[1]*255,color[2]*255); hsv[0] += offset/360; if (hsv[0] > 1) { hsv[0] -= 1; } else if (hsv[0] < 0) { hsv[0] += 1; } return HSVtoRGB(hsv[0],hsv[1],hsv[2]); } var rgbToHex = (function(){ var colorMap = []; var i; var hex; for(i=0;i<256;i+=1){ hex = i.toString(16); colorMap[i] = hex.length == 1 ? '0' + hex : hex; } return function(r, g, b) { if(r<0){ r = 0; } if(g<0){ g = 0; } if(b<0){ b = 0; } return '#' + colorMap[r] + colorMap[g] + colorMap[b]; }; }()); function BaseEvent(){} BaseEvent.prototype = { triggerEvent: function (eventName, args) { if (this._cbs[eventName]) { var len = this._cbs[eventName].length; for (var i = 0; i < len; i++){ this._cbs[eventName][i](args); } } }, addEventListener: function (eventName, callback) { if (!this._cbs[eventName]){ this._cbs[eventName] = []; } this._cbs[eventName].push(callback); return function() { this.removeEventListener(eventName, callback); }.bind(this); }, removeEventListener: function (eventName,callback){ if (!callback){ this._cbs[eventName] = null; }else if(this._cbs[eventName]){ var i = 0, len = this._cbs[eventName].length; while(i 0) || (val > -0.000001 && val < 0)) { return _rnd(val * v) / v; } return val; } function to2dCSS() { //Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed. /*if(this.isIdentity()) { return ''; }*/ var props = this.props; var _a = roundMatrixProperty(props[0]); var _b = roundMatrixProperty(props[1]); var _c = roundMatrixProperty(props[4]); var _d = roundMatrixProperty(props[5]); var _e = roundMatrixProperty(props[12]); var _f = roundMatrixProperty(props[13]); return "matrix(" + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ")"; } return function(){ this.reset = reset; this.rotate = rotate; this.rotateX = rotateX; this.rotateY = rotateY; this.rotateZ = rotateZ; this.skew = skew; this.skewFromAxis = skewFromAxis; this.shear = shear; this.scale = scale; this.setTransform = setTransform; this.translate = translate; this.transform = transform; this.applyToPoint = applyToPoint; this.applyToX = applyToX; this.applyToY = applyToY; this.applyToZ = applyToZ; this.applyToPointArray = applyToPointArray; this.applyToTriplePoints = applyToTriplePoints; this.applyToPointStringified = applyToPointStringified; this.toCSS = toCSS; this.to2dCSS = to2dCSS; this.clone = clone; this.cloneFromProps = cloneFromProps; this.equals = equals; this.inversePoints = inversePoints; this.inversePoint = inversePoint; this._t = this.transform; this.isIdentity = isIdentity; this._identity = true; this._identityCalculated = false; this.props = createTypedArray('float32', 16); this.reset(); }; }()); /* Copyright 2014 David Bau. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function (pool, math) { // // The following constants are related to IEEE 754 limits. // var global = this, width = 256, // each RC4 output is 0 <= x < 256 chunks = 6, // at least six RC4 outputs for each double digits = 52, // there are 52 significant digits in a double rngname = 'random', // rngname: name for Math.random and Math.seedrandom startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; // node.js crypto module, initialized at the bottom. // // seedrandom() // This is the seedrandom function described above. // function seedrandom(seed, options, callback) { var key = []; options = (options === true) ? { entropy: true } : (options || {}); // Flatten the seed string or build one from local entropy if needed. var shortseed = mixkey(flatten( options.entropy ? [seed, tostring(pool)] : (seed === null) ? autoseed() : seed, 3), key); // Use the seed to initialize an ARC4 generator. var arc4 = new ARC4(key); // This function returns a random double in [0, 1) that contains // randomness in every bit of the mantissa of the IEEE 754 value. var prng = function() { var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 d = startdenom, // and denominator d = 2 ^ 48. x = 0; // and no 'extra last byte'. while (n < significance) { // Fill up all significant digits by n = (n + x) * width; // shifting numerator and d *= width; // denominator and generating a x = arc4.g(1); // new least-significant-byte. } while (n >= overflow) { // To avoid rounding up, before adding n /= 2; // last byte, shift everything d /= 2; // right using integer math until x >>>= 1; // we have exactly the desired bits. } return (n + x) / d; // Form the number within [0, 1). }; prng.int32 = function() { return arc4.g(4) | 0; }; prng.quick = function() { return arc4.g(4) / 0x100000000; }; prng.double = prng; // Mix the randomness into accumulated entropy. mixkey(tostring(arc4.S), pool); // Calling convention: what to return as a function of prng, seed, is_math. return (options.pass || callback || function(prng, seed, is_math_call, state) { if (state) { // Load the arc4 state from the given state if it has an S array. if (state.S) { copy(state, arc4); } // Only provide the .state method if requested via options.state. prng.state = function() { return copy(arc4, {}); }; } // If called as a method of Math (Math.seedrandom()), mutate // Math.random because that is how seedrandom.js has worked since v1.0. if (is_math_call) { math[rngname] = prng; return seed; } // Otherwise, it is a newer calling convention, so return the // prng directly. else return prng; })( prng, shortseed, 'global' in options ? options.global : (this == math), options.state); } math['seed' + rngname] = seedrandom; // // ARC4 // // An ARC4 implementation. The constructor takes a key in the form of // an array of at most (width) integers that should be 0 <= x < (width). // // The g(count) method returns a pseudorandom integer that concatenates // the next (count) outputs from ARC4. Its return value is a number x // that is in the range 0 <= x < (width ^ count). // function ARC4(key) { var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; // The empty key [] is treated as [0]. if (!keylen) { key = [keylen++]; } // Set up S using the standard key scheduling algorithm. while (i < width) { s[i] = i++; } for (i = 0; i < width; i++) { s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; s[j] = t; } // The "g" method returns the next (count) outputs as one number. me.g = function(count) { // Using instance members instead of closure state nearly doubles speed. var t, r = 0, i = me.i, j = me.j, s = me.S; while (count--) { t = s[i = mask & (i + 1)]; r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; } me.i = i; me.j = j; return r; // For robust unpredictability, the function call below automatically // discards an initial batch of values. This is called RC4-drop[256]. // See http://google.com/search?q=rsa+fluhrer+response&btnI }; } // // copy() // Copies internal state of ARC4 to or from a plain object. // function copy(f, t) { t.i = f.i; t.j = f.j; t.S = f.S.slice(); return t; } // // flatten() // Converts an object tree to nested arrays of strings. // function flatten(obj, depth) { var result = [], typ = (typeof obj), prop; if (depth && typ == 'object') { for (prop in obj) { try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} } } return (result.length ? result : typ == 'string' ? obj : obj + '\0'); } // // mixkey() // Mixes a string seed into a key that is an array of integers, and // returns a shortened string seed that is equivalent to the result key. // function mixkey(seed, key) { var stringseed = seed + '', smear, j = 0; while (j < stringseed.length) { key[mask & j] = mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); } return tostring(key); } // // autoseed() // Returns an object for autoseeding, using window.crypto and Node crypto // module if available. // function autoseed() { try { if (nodecrypto) { return tostring(nodecrypto.randomBytes(width)); } var out = new Uint8Array(width); (global.crypto || global.msCrypto).getRandomValues(out); return tostring(out); } catch (e) { var browser = global.navigator, plugins = browser && browser.plugins; return [+new Date(), global, plugins, global.screen, tostring(pool)]; } } // // tostring() // Converts an array of charcodes to a string // function tostring(a) { return String.fromCharCode.apply(0, a); } // // When seedrandom.js is loaded, we immediately mix a few bits // from the built-in RNG into the entropy pool. Because we do // not want to interfere with deterministic PRNG state later, // seedrandom will not call math.random on its own again after // initialization. // mixkey(math.random(), pool); // // Nodejs and AMD support: export the implementation as a module using // either convention. // // End anonymous scope, and pass initial values. })( [], // pool: entropy pool starts empty BMMath // math: package containing random, pow, and seedrandom ); var BezierFactory = (function(){ /** * BezierEasing - use bezier curve for transition easing function * by Gaëtan Renaudeau 2014 - 2015 – MIT License * * Credits: is based on Firefox's nsSMILKeySpline.cpp * Usage: * var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ]) * spline.get(x) => returns the easing value | x must be in [0, 1] range * */ var ob = {}; ob.getBezierEasing = getBezierEasing; var beziers = {}; function getBezierEasing(a,b,c,d,nm){ var str = nm || ('bez_' + a+'_'+b+'_'+c+'_'+d).replace(/\./g, 'p'); if(beziers[str]){ return beziers[str]; } var bezEasing = new BezierEasing([a,b,c,d]); beziers[str] = bezEasing; return bezEasing; } // These values are established by empiricism with tests (tradeoff: performance VS precision) var NEWTON_ITERATIONS = 4; var NEWTON_MIN_SLOPE = 0.001; var SUBDIVISION_PRECISION = 0.0000001; var SUBDIVISION_MAX_ITERATIONS = 10; var kSplineTableSize = 11; var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); var float32ArraySupported = typeof Float32Array === "function"; function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } function C (aA1) { return 3.0 * aA1; } // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT; } // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } function binarySubdivide (aX, aA, aB, mX1, mX2) { var currentX, currentT, i = 0; do { currentT = aA + (aB - aA) / 2.0; currentX = calcBezier(currentT, mX1, mX2) - aX; if (currentX > 0.0) { aB = currentT; } else { aA = currentT; } } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); return currentT; } function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) { for (var i = 0; i < NEWTON_ITERATIONS; ++i) { var currentSlope = getSlope(aGuessT, mX1, mX2); if (currentSlope === 0.0) return aGuessT; var currentX = calcBezier(aGuessT, mX1, mX2) - aX; aGuessT -= currentX / currentSlope; } return aGuessT; } /** * points is an array of [ mX1, mY1, mX2, mY2 ] */ function BezierEasing (points) { this._p = points; this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); this._precomputed = false; this.get = this.get.bind(this); } BezierEasing.prototype = { get: function (x) { var mX1 = this._p[0], mY1 = this._p[1], mX2 = this._p[2], mY2 = this._p[3]; if (!this._precomputed) this._precompute(); if (mX1 === mY1 && mX2 === mY2) return x; // linear // Because JavaScript number are imprecise, we should guarantee the extremes are right. if (x === 0) return 0; if (x === 1) return 1; return calcBezier(this._getTForX(x), mY1, mY2); }, // Private part _precompute: function () { var mX1 = this._p[0], mY1 = this._p[1], mX2 = this._p[2], mY2 = this._p[3]; this._precomputed = true; if (mX1 !== mY1 || mX2 !== mY2) this._calcSampleValues(); }, _calcSampleValues: function () { var mX1 = this._p[0], mX2 = this._p[2]; for (var i = 0; i < kSplineTableSize; ++i) { this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); } }, /** * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection. */ _getTForX: function (aX) { var mX1 = this._p[0], mX2 = this._p[2], mSampleValues = this._mSampleValues; var intervalStart = 0.0; var currentSample = 1; var lastSample = kSplineTableSize - 1; for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { intervalStart += kSampleStepSize; } --currentSample; // Interpolate to provide an initial guess for t var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]); var guessForT = intervalStart + dist * kSampleStepSize; var initialSlope = getSlope(guessForT, mX1, mX2); if (initialSlope >= NEWTON_MIN_SLOPE) { return newtonRaphsonIterate(aX, guessForT, mX1, mX2); } else if (initialSlope === 0.0) { return guessForT; } else { return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); } } }; return ob; }()); (function () { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; } if(!window.requestAnimationFrame) window.requestAnimationFrame = function (callback, element) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = setTimeout(function () { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if(!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) { clearTimeout(id); }; }()); function extendPrototype(sources,destination){ var i, len = sources.length, sourcePrototype; for (i = 0;i < len;i += 1) { sourcePrototype = sources[i].prototype; for (var attr in sourcePrototype) { if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr]; } } } function getDescriptor(object, prop) { return Object.getOwnPropertyDescriptor(object, prop); } function createProxyFunction(prototype) { function ProxyFunction(){} ProxyFunction.prototype = prototype; return ProxyFunction; } function bezFunction(){ var easingFunctions = []; var math = Math; function pointOnLine2D(x1,y1, x2,y2, x3,y3){ var det1 = (x1*y2) + (y1*x3) + (x2*y3) - (x3*y2) - (y3*x1) - (x2*y1); return det1 > -0.001 && det1 < 0.001; } function pointOnLine3D(x1,y1,z1, x2,y2,z2, x3,y3,z3){ if(z1 === 0 && z2 === 0 && z3 === 0) { return pointOnLine2D(x1,y1, x2,y2, x3,y3); } var dist1 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2)); var dist2 = Math.sqrt(Math.pow(x3 - x1, 2) + Math.pow(y3 - y1, 2) + Math.pow(z3 - z1, 2)); var dist3 = Math.sqrt(Math.pow(x3 - x2, 2) + Math.pow(y3 - y2, 2) + Math.pow(z3 - z2, 2)); var diffDist; if(dist1 > dist2){ if(dist1 > dist3){ diffDist = dist1 - dist2 - dist3; } else { diffDist = dist3 - dist2 - dist1; } } else if(dist3 > dist2){ diffDist = dist3 - dist2 - dist1; } else { diffDist = dist2 - dist1 - dist3; } return diffDist > -0.0001 && diffDist < 0.0001; } var getBezierLength = (function(){ return function(pt1,pt2,pt3,pt4){ var curveSegments = defaultCurveSegments; var k; var i, len; var ptCoord,perc,addedLength = 0; var ptDistance; var point = [],lastPoint = []; var lengthData = bezier_length_pool.newElement(); len = pt3.length; for(k=0;k lengthPos ? -1 : 1; var flag = true; while(flag){ if(lengths[initPos] <= lengthPos && lengths[initPos+1] > lengthPos){ lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos+1] - lengths[initPos]); flag = false; }else{ initPos += dir; } if(initPos < 0 || initPos >= len - 1){ //FIX for TypedArrays that don't store floating point values with enough accuracy if(initPos === len - 1) { return percents[initPos]; } flag = false; } } return percents[initPos] + (percents[initPos+1] - percents[initPos])*lPerc; } } function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) { var t1 = getDistancePerc(percent,bezierData); var u0 = 1; var u1 = 1 - t1; var ptX = Math.round((u1*u1*u1* pt1[0] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[0] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[0] + t1*t1*t1* pt2[0])* 1000) / 1000; var ptY = Math.round((u1*u1*u1* pt1[1] + (t1*u1*u1 + u1*t1*u1 + u1*u1*t1)* pt3[1] + (t1*t1*u1 + u1*t1*t1 + t1*u1*t1)*pt4[1] + t1*t1*t1* pt2[1])* 1000) / 1000; return [ptX, ptY]; } function getSegmentArray() { } var bezier_segment_points = createTypedArray('float32', 8); function getNewSegment(pt1,pt2,pt3,pt4,startPerc,endPerc, bezierData){ startPerc = startPerc < 0 ? 0 : startPerc > 1 ? 1 : startPerc; var t0 = getDistancePerc(startPerc,bezierData); endPerc = endPerc > 1 ? 1 : endPerc; var t1 = getDistancePerc(endPerc,bezierData); var i, len = pt1.length; var u0 = 1 - t0; var u1 = 1 - t1; var u0u0u0 = u0*u0*u0; var t0u0u0_3 = t0*u0*u0*3; var t0t0u0_3 = t0*t0*u0*3; var t0t0t0 = t0*t0*t0; // var u0u0u1 = u0*u0*u1; var t0u0u1_3 = t0*u0*u1 + u0*t0*u1 + u0*u0*t1; var t0t0u1_3 = t0*t0*u1 + u0*t0*t1 + t0*u0*t1; var t0t0t1 = t0*t0*t1; // var u0u1u1 = u0*u1*u1; var t0u1u1_3 = t0*u1*u1 + u0*t1*u1 + u0*u1*t1; var t0t1u1_3 = t0*t1*u1 + u0*t1*t1 + t0*u1*t1; var t0t1t1 = t0*t1*t1; // var u1u1u1 = u1*u1*u1; var t1u1u1_3 = t1*u1*u1 + u1*t1*u1 + u1*u1*t1; var t1t1u1_3 = t1*t1*u1 + u1*t1*t1 + t1*u1*t1; var t1t1t1 = t1*t1*t1; for(i=0;i=0;i-=1){ if(arr[i].ty == 'sh'){ if(arr[i].ks.k.i){ convertPathsToAbsoluteValues(arr[i].ks.k); }else{ jLen = arr[i].ks.k.length; for(j=0;janimVersion[0]){ return true; } else if(animVersion[0] > minimum[0]){ return false; } if(minimum[1]>animVersion[1]){ return true; } else if(animVersion[1] > minimum[1]){ return false; } if(minimum[2]>animVersion[2]){ return true; } else if(animVersion[2] > minimum[2]){ return false; } } var checkText = (function(){ var minimumVersion = [4,4,14]; function updateTextLayer(textLayer){ var documentData = textLayer.t.d; textLayer.t.d = { k: [ { s:documentData, t:0 } ] }; } function iterateLayers(layers){ var i, len = layers.length; for(i=0;i=0;i-=1){ if(arr[i].ty == 'sh'){ if(arr[i].ks.k.i){ arr[i].ks.k.c = arr[i].closed; }else{ jLen = arr[i].ks.k.length; for(j=0;j 0) { shouldLoadFont = false; } if (shouldLoadFont) { var s = createTag('style'); s.setAttribute('f-forigin', fontArr[i].fOrigin); s.setAttribute('f-origin', fontArr[i].origin); s.setAttribute('f-family', fontArr[i].fFamily); s.type = "text/css"; s.innerHTML = "@font-face {" + "font-family: "+fontArr[i].fFamily+"; font-style: normal; src: url('"+fontArr[i].fPath+"');}"; defs.appendChild(s); } } else if(fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1){ loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'); for (j = 0; j < loadedSelector.length; j++) { if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) { // Font is already loaded shouldLoadFont = false; } } if (shouldLoadFont) { var l = createTag('link'); l.setAttribute('f-forigin', fontArr[i].fOrigin); l.setAttribute('f-origin', fontArr[i].origin); l.type = "text/css"; l.rel = "stylesheet"; l.href = fontArr[i].fPath; document.body.appendChild(l); } } else if(fontArr[i].fOrigin === 't' || fontArr[i].origin === 2){ loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'); for (j = 0; j < loadedSelector.length; j++) { if (fontArr[i].fPath === loadedSelector[j].src) { // Font is already loaded shouldLoadFont = false; } } if (shouldLoadFont) { var sc = createTag('link'); sc.setAttribute('f-forigin', fontArr[i].fOrigin); sc.setAttribute('f-origin', fontArr[i].origin); sc.setAttribute('rel','stylesheet'); sc.setAttribute('href',fontArr[i].fPath); defs.appendChild(sc); } } fontArr[i].helper = createHelper(defs,fontArr[i]); fontArr[i].cache = {}; this.fonts.push(fontArr[i]); } if (_pendingFonts === 0) { this.isLoaded = true; } else { //On some cases even if the font is loaded, it won't load correctly when measuring text on canvas. //Adding this timeout seems to fix it setTimeout(this.checkLoadedFonts.bind(this), 100); } } function addChars(chars){ if(!chars){ return; } if(!this.chars){ this.chars = []; } var i, len = chars.length; var j, jLen = this.chars.length, found; for(i=0;i= nextKeyData.t - offsetTime){ if(keyData.h){ keyData = nextKeyData; } iterationIndex = 0; break; } if ((nextKeyData.t - offsetTime) > frameNum){ iterationIndex = i; break; } if (i < len - 1){ i += 1; } else { iterationIndex = 0; flag = false; } } var k, kLen, perc, jLen, j, fnc; var nextKeyTime = nextKeyData.t - offsetTime; var keyTime = keyData.t - offsetTime; var endValue; if (keyData.to) { if (!keyData.bezierData) { keyData.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti); } var bezierData = keyData.bezierData; if (frameNum >= nextKeyTime || frameNum < keyTime) { var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0; kLen = bezierData.points[ind].point.length; for (k = 0; k < kLen; k += 1) { newValue[k] = bezierData.points[ind].point[k]; } // caching._lastKeyframeIndex = -1; } else { if (keyData.__fnct) { fnc = keyData.__fnct; } else { fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get; keyData.__fnct = fnc; } perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime)); var distanceInLine = bezierData.segmentLength*perc; var segmentPerc; var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0; j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0; flag = true; jLen = bezierData.points.length; while (flag) { addedLength += bezierData.points[j].partialLength; if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) { kLen = bezierData.points[j].point.length; for (k = 0; k < kLen; k += 1) { newValue[k] = bezierData.points[j].point[k]; } break; } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) { segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength; kLen = bezierData.points[j].point.length; for (k = 0; k < kLen; k += 1) { newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc; } break; } if (j < jLen - 1){ j += 1; } else { flag = false; } } caching._lastPoint = j; caching._lastAddedLength = addedLength - bezierData.points[j].partialLength; caching._lastKeyframeIndex = i; } } else { var outX, outY, inX, inY, keyValue; len = keyData.s.length; endValue = nextKeyData.s || keyData.e; if (this.sh && keyData.h !== 1) { if (frameNum >= nextKeyTime) { newValue[0] = endValue[0]; newValue[1] = endValue[1]; newValue[2] = endValue[2]; } else if (frameNum <= keyTime) { newValue[0] = keyData.s[0]; newValue[1] = keyData.s[1]; newValue[2] = keyData.s[2]; } else { var quatStart = createQuaternion(keyData.s); var quatEnd = createQuaternion(endValue); var time = (frameNum - keyTime) / (nextKeyTime - keyTime); quaternionToEuler(newValue, slerp(quatStart, quatEnd, time)); } } else { for(i = 0; i < len; i += 1) { if (keyData.h !== 1) { if (frameNum >= nextKeyTime) { perc = 1; } else if(frameNum < keyTime) { perc = 0; } else { if(keyData.o.x.constructor === Array) { if (!keyData.__fnct) { keyData.__fnct = []; } if (!keyData.__fnct[i]) { outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i]; outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i]; inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i]; inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i]; fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get; keyData.__fnct[i] = fnc; } else { fnc = keyData.__fnct[i]; } } else { if (!keyData.__fnct) { outX = keyData.o.x; outY = keyData.o.y; inX = keyData.i.x; inY = keyData.i.y; fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get; keyData.__fnct = fnc; } else { fnc = keyData.__fnct; } } perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime )); } } endValue = nextKeyData.s || keyData.e; keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc; if (this.propType === 'multidimensional') { newValue[i] = keyValue; } else { newValue = keyValue; } } } } caching.lastIndex = iterationIndex; return newValue; } //based on @Toji's https://github.com/toji/gl-matrix/ function slerp(a, b, t) { var out = []; var ax = a[0], ay = a[1], az = a[2], aw = a[3], bx = b[0], by = b[1], bz = b[2], bw = b[3] var omega, cosom, sinom, scale0, scale1; cosom = ax * bx + ay * by + az * bz + aw * bw; if (cosom < 0.0) { cosom = -cosom; bx = -bx; by = -by; bz = -bz; bw = -bw; } if ((1.0 - cosom) > 0.000001) { omega = Math.acos(cosom); sinom = Math.sin(omega); scale0 = Math.sin((1.0 - t) * omega) / sinom; scale1 = Math.sin(t * omega) / sinom; } else { scale0 = 1.0 - t; scale1 = t; } out[0] = scale0 * ax + scale1 * bx; out[1] = scale0 * ay + scale1 * by; out[2] = scale0 * az + scale1 * bz; out[3] = scale0 * aw + scale1 * bw; return out; } function quaternionToEuler(out, quat) { var qx = quat[0]; var qy = quat[1]; var qz = quat[2]; var qw = quat[3]; var heading = Math.atan2(2*qy*qw-2*qx*qz , 1 - 2*qy*qy - 2*qz*qz) var attitude = Math.asin(2*qx*qy + 2*qz*qw) var bank = Math.atan2(2*qx*qw-2*qy*qz , 1 - 2*qx*qx - 2*qz*qz); out[0] = heading/degToRads; out[1] = attitude/degToRads; out[2] = bank/degToRads; } function createQuaternion(values) { var heading = values[0] * degToRads; var attitude = values[1] * degToRads; var bank = values[2] * degToRads; var c1 = Math.cos(heading / 2); var c2 = Math.cos(attitude / 2); var c3 = Math.cos(bank / 2); var s1 = Math.sin(heading / 2); var s2 = Math.sin(attitude / 2); var s3 = Math.sin(bank / 2); var w = c1 * c2 * c3 - s1 * s2 * s3; var x = s1 * s2 * c3 + c1 * c2 * s3; var y = s1 * c2 * c3 + c1 * s2 * s3; var z = c1 * s2 * c3 - s1 * c2 * s3; return [x,y,z,w]; } function getValueAtCurrentTime(){ var frameNum = this.comp.renderedFrame - this.offsetTime; var initTime = this.keyframes[0].t - this.offsetTime; var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime; if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){ if(this._caching.lastFrame >= frameNum) { this._caching._lastKeyframeIndex = -1; this._caching.lastIndex = 0; } var renderResult = this.interpolateValue(frameNum, this._caching); this.pv = renderResult; } this._caching.lastFrame = frameNum; return this.pv; } function setVValue(val) { var multipliedValue; if(this.propType === 'unidimensional') { multipliedValue = val * this.mult; if(math_abs(this.v - multipliedValue) > 0.00001) { this.v = multipliedValue; this._mdf = true; } } else { var i = 0, len = this.v.length; while (i < len) { multipliedValue = val[i] * this.mult; if (math_abs(this.v[i] - multipliedValue) > 0.00001) { this.v[i] = multipliedValue; this._mdf = true; } i += 1; } } } function processEffectsSequence() { if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) { return; } if(this.lock) { this.setVValue(this.pv); return; } this.lock = true; this._mdf = this._isFirstFrame; var multipliedValue; var i, len = this.effectsSequence.length; var finalValue = this.kf ? this.pv : this.data.k; for(i = 0; i < len; i += 1) { finalValue = this.effectsSequence[i](finalValue); } this.setVValue(finalValue); this._isFirstFrame = false; this.lock = false; this.frameId = this.elem.globalData.frameId; } function addEffect(effectFunction) { this.effectsSequence.push(effectFunction); this.container.addDynamicProperty(this); } function ValueProperty(elem, data, mult, container){ this.propType = 'unidimensional'; this.mult = mult || 1; this.data = data; this.v = mult ? data.k * mult : data.k; this.pv = data.k; this._mdf = false; this.elem = elem; this.container = container; this.comp = elem.comp; this.k = false; this.kf = false; this.vel = 0; this.effectsSequence = []; this._isFirstFrame = true; this.getValue = processEffectsSequence; this.setVValue = setVValue; this.addEffect = addEffect; } function MultiDimensionalProperty(elem, data, mult, container) { this.propType = 'multidimensional'; this.mult = mult || 1; this.data = data; this._mdf = false; this.elem = elem; this.container = container; this.comp = elem.comp; this.k = false; this.kf = false; this.frameId = -1; var i, len = data.k.length; this.v = createTypedArray('float32', len); this.pv = createTypedArray('float32', len); var arr = createTypedArray('float32', len); this.vel = createTypedArray('float32', len); for (i = 0; i < len; i += 1) { this.v[i] = data.k[i] * this.mult; this.pv[i] = data.k[i]; } this._isFirstFrame = true; this.effectsSequence = []; this.getValue = processEffectsSequence; this.setVValue = setVValue; this.addEffect = addEffect; } function KeyframedValueProperty(elem, data, mult, container) { this.propType = 'unidimensional'; this.keyframes = data.k; this.offsetTime = elem.data.st; this.frameId = -1; this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1}; this.k = true; this.kf = true; this.data = data; this.mult = mult || 1; this.elem = elem; this.container = container; this.comp = elem.comp; this.v = initFrame; this.pv = initFrame; this._isFirstFrame = true; this.getValue = processEffectsSequence; this.setVValue = setVValue; this.interpolateValue = interpolateValue; this.effectsSequence = [getValueAtCurrentTime.bind(this)]; this.addEffect = addEffect; } function KeyframedMultidimensionalProperty(elem, data, mult, container){ this.propType = 'multidimensional'; var i, len = data.k.length; var s, e,to,ti; for (i = 0; i < len - 1; i += 1) { if (data.k[i].to && data.k[i].s && data.k[i].e) { s = data.k[i].s; e = data.k[i].e; to = data.k[i].to; ti = data.k[i].ti; if((s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0],s[1],e[0],e[1],s[0] + to[0],s[1] + to[1]) && bez.pointOnLine2D(s[0],s[1],e[0],e[1],e[0] + ti[0],e[1] + ti[1])) || (s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0],s[1],s[2],e[0],e[1],e[2],s[0] + to[0],s[1] + to[1],s[2] + to[2]) && bez.pointOnLine3D(s[0],s[1],s[2],e[0],e[1],e[2],e[0] + ti[0],e[1] + ti[1],e[2] + ti[2]))){ data.k[i].to = null; data.k[i].ti = null; } if(s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) { if(s.length === 2 || (s[2] === e[2] && to[2] === 0 && ti[2] === 0)) { data.k[i].to = null; data.k[i].ti = null; } } } } this.effectsSequence = [getValueAtCurrentTime.bind(this)]; this.keyframes = data.k; this.offsetTime = elem.data.st; this.k = true; this.kf = true; this._isFirstFrame = true; this.mult = mult || 1; this.elem = elem; this.container = container; this.comp = elem.comp; this.getValue = processEffectsSequence; this.setVValue = setVValue; this.interpolateValue = interpolateValue; this.frameId = -1; var arrLen = data.k[0].s.length; this.v = createTypedArray('float32', arrLen); this.pv = createTypedArray('float32', arrLen); for (i = 0; i < arrLen; i += 1) { this.v[i] = initFrame; this.pv[i] = initFrame; } this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray('float32', arrLen)}; this.addEffect = addEffect; } function getProp(elem,data,type, mult, container) { var p; if(!data.k.length){ p = new ValueProperty(elem,data, mult, container); }else if(typeof(data.k[0]) === 'number'){ p = new MultiDimensionalProperty(elem,data, mult, container); }else{ switch(type){ case 0: p = new KeyframedValueProperty(elem,data,mult, container); break; case 1: p = new KeyframedMultidimensionalProperty(elem,data,mult, container); break; } } if(p.effectsSequence.length){ container.addDynamicProperty(p); } return p; } var ob = { getProp: getProp }; return ob; }()); var TransformPropertyFactory = (function() { function applyToMatrix(mat) { var _mdf = this._mdf; this.iterateDynamicProperties(); this._mdf = this._mdf || _mdf; if (this.a) { mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); } if (this.s) { mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]); } if (this.sk) { mat.skewFromAxis(-this.sk.v, this.sa.v); } if (this.r) { mat.rotate(-this.r.v); } else { mat.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]); } if (this.data.p.s) { if (this.data.p.z) { mat.translate(this.px.v, this.py.v, -this.pz.v); } else { mat.translate(this.px.v, this.py.v, 0); } } else { mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]); } } function processKeys(forceRender){ if (this.elem.globalData.frameId === this.frameId) { return; } if(this._isDirty) { this.precalculateMatrix(); this._isDirty = false; } this.iterateDynamicProperties(); if (this._mdf || forceRender) { this.v.cloneFromProps(this.pre.props); if (this.appliedTransformations < 1) { this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); } if(this.appliedTransformations < 2) { this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]); } if (this.sk && this.appliedTransformations < 3) { this.v.skewFromAxis(-this.sk.v, this.sa.v); } if (this.r && this.appliedTransformations < 4) { this.v.rotate(-this.r.v); } else if (!this.r && this.appliedTransformations < 4){ this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]); } if (this.autoOriented) { var v1,v2, frameRate = this.elem.globalData.frameRate; if(this.p && this.p.keyframes && this.p.getValueAtTime) { if (this.p._caching.lastFrame+this.p.offsetTime <= this.p.keyframes[0].t) { v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate,0); v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0); } else if(this.p._caching.lastFrame+this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) { v1 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t / frameRate), 0); v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0); } else { v1 = this.p.pv; v2 = this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime); } } else if(this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) { v1 = []; v2 = []; var px = this.px, py = this.py, frameRate; if (px._caching.lastFrame+px.offsetTime <= px.keyframes[0].t) { v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate,0); v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate,0); v2[0] = px.getValueAtTime((px.keyframes[0].t) / frameRate,0); v2[1] = py.getValueAtTime((py.keyframes[0].t) / frameRate,0); } else if(px._caching.lastFrame+px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) { v1[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t / frameRate),0); v1[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t / frameRate),0); v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate,0); v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate,0); } else { v1 = [px.pv, py.pv]; v2[0] = px.getValueAtTime((px._caching.lastFrame+px.offsetTime - 0.01) / frameRate,px.offsetTime); v2[1] = py.getValueAtTime((py._caching.lastFrame+py.offsetTime - 0.01) / frameRate,py.offsetTime); } } this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0])); } if(this.data.p && this.data.p.s){ if(this.data.p.z) { this.v.translate(this.px.v, this.py.v, -this.pz.v); } else { this.v.translate(this.px.v, this.py.v, 0); } }else{ this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2]); } } this.frameId = this.elem.globalData.frameId; } function precalculateMatrix() { if(!this.a.k) { this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]); this.appliedTransformations = 1; } else { return; } if(!this.s.effectsSequence.length) { this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]); this.appliedTransformations = 2; } else { return; } if(this.sk) { if(!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) { this.pre.skewFromAxis(-this.sk.v, this.sa.v); this.appliedTransformations = 3; } else { return; } } if (this.r) { if(!this.r.effectsSequence.length) { this.pre.rotate(-this.r.v); this.appliedTransformations = 4; } else { return; } } else if(!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) { this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]); this.appliedTransformations = 4; } } function autoOrient(){ // //var prevP = this.getValueAtTime(); } function addDynamicProperty(prop) { this._addDynamicProperty(prop); this.elem.addDynamicProperty(prop); this._isDirty = true; } function TransformProperty(elem,data,container){ this.elem = elem; this.frameId = -1; this.propType = 'transform'; this.data = data; this.v = new Matrix(); //Precalculated matrix with non animated properties this.pre = new Matrix(); this.appliedTransformations = 0; this.initDynamicPropertyContainer(container || elem); if(data.p && data.p.s){ this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this); this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this); if(data.p.z){ this.pz = PropertyFactory.getProp(elem,data.p.z,0,0,this); } }else{ this.p = PropertyFactory.getProp(elem,data.p || {k:[0,0,0]},1,0,this); } if(data.rx) { this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this); this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this); this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this); if(data.or.k[0].ti) { var i, len = data.or.k.length; for(i=0;i= this._maxLength) { this.doubleArrayLength(); } switch(type){ case 'v': arr = this.v; break; case 'i': arr = this.i; break; case 'o': arr = this.o; break; } if(!arr[pos] || (arr[pos] && !replace)){ arr[pos] = point_pool.newElement(); } arr[pos][0] = x; arr[pos][1] = y; }; ShapePath.prototype.setTripleAt = function(vX,vY,oX,oY,iX,iY,pos, replace) { this.setXYAt(vX,vY,'v',pos, replace); this.setXYAt(oX,oY,'o',pos, replace); this.setXYAt(iX,iY,'i',pos, replace); }; ShapePath.prototype.reverse = function() { var newPath = new ShapePath(); newPath.setPathData(this.c, this._length); var vertices = this.v, outPoints = this.o, inPoints = this.i; var init = 0; if (this.c) { newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false); init = 1; } var cnt = this._length - 1; var len = this._length; var i; for (i = init; i < len; i += 1) { newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false); cnt -= 1; } return newPath; }; var ShapePropertyFactory = (function(){ var initFrame = -999999; function interpolateShape(frameNum, previousValue, caching) { var iterationIndex = caching.lastIndex; var keyPropS,keyPropE,isHold, j, k, jLen, kLen, perc, vertexValue; var kf = this.keyframes; if(frameNum < kf[0].t-this.offsetTime){ keyPropS = kf[0].s[0]; isHold = true; iterationIndex = 0; }else if(frameNum >= kf[kf.length - 1].t-this.offsetTime){ keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0]; /*if(kf[kf.length - 1].s){ keyPropS = kf[kf.length - 1].s[0]; }else{ keyPropS = kf[kf.length - 2].e[0]; }*/ isHold = true; }else{ var i = iterationIndex; var len = kf.length- 1,flag = true,keyData,nextKeyData; while(flag){ keyData = kf[i]; nextKeyData = kf[i+1]; if((nextKeyData.t - this.offsetTime) > frameNum){ break; } if(i < len - 1){ i += 1; }else{ flag = false; } } isHold = keyData.h === 1; iterationIndex = i; if(!isHold){ if(frameNum >= nextKeyData.t-this.offsetTime){ perc = 1; }else if(frameNum < keyData.t-this.offsetTime){ perc = 0; }else{ var fnc; if(keyData.__fnct){ fnc = keyData.__fnct; }else{ fnc = BezierFactory.getBezierEasing(keyData.o.x,keyData.o.y,keyData.i.x,keyData.i.y).get; keyData.__fnct = fnc; } perc = fnc((frameNum-(keyData.t-this.offsetTime))/((nextKeyData.t-this.offsetTime)-(keyData.t-this.offsetTime))); } keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0]; } keyPropS = keyData.s[0]; } jLen = previousValue._length; kLen = keyPropS.i[0].length; caching.lastIndex = iterationIndex; for(j=0;j endTime && frameNum > endTime)))){ //// this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0; this.interpolateShape(frameNum, this.pv, this._caching); //// } this._caching.lastFrame = frameNum; return this.pv; } function resetShape(){ this.paths = this.localShapeCollection; } function shapesEqual(shape1, shape2) { if(shape1._length !== shape2._length || shape1.c !== shape2.c){ return false; } var i, len = shape1._length; for(i = 0; i < len; i += 1) { if(shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]) { return false; } } return true; } function setVValue(newPath) { if(!shapesEqual(this.v, newPath)) { this.v = shape_pool.clone(newPath); this.localShapeCollection.releaseShapes(); this.localShapeCollection.addShape(this.v); this._mdf = true; this.paths = this.localShapeCollection; } } function processEffectsSequence() { if (this.elem.globalData.frameId === this.frameId) { return; } else if (!this.effectsSequence.length) { this._mdf = false; return; } if (this.lock) { this.setVValue(this.pv); return; } this.lock = true; this._mdf = false; var finalValue = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k; var i, len = this.effectsSequence.length; for(i = 0; i < len; i += 1) { finalValue = this.effectsSequence[i](finalValue); } this.setVValue(finalValue); this.lock = false; this.frameId = this.elem.globalData.frameId; }; function ShapeProperty(elem, data, type){ this.propType = 'shape'; this.comp = elem.comp; this.container = elem; this.elem = elem; this.data = data; this.k = false; this.kf = false; this._mdf = false; var pathData = type === 3 ? data.pt.k : data.ks.k; this.v = shape_pool.clone(pathData); this.pv = shape_pool.clone(this.v); this.localShapeCollection = shapeCollection_pool.newShapeCollection(); this.paths = this.localShapeCollection; this.paths.addShape(this.v); this.reset = resetShape; this.effectsSequence = []; } function addEffect(effectFunction) { this.effectsSequence.push(effectFunction); this.container.addDynamicProperty(this); } ShapeProperty.prototype.interpolateShape = interpolateShape; ShapeProperty.prototype.getValue = processEffectsSequence; ShapeProperty.prototype.setVValue = setVValue; ShapeProperty.prototype.addEffect = addEffect; function KeyframedShapeProperty(elem,data,type){ this.propType = 'shape'; this.comp = elem.comp; this.elem = elem; this.container = elem; this.offsetTime = elem.data.st; this.keyframes = type === 3 ? data.pt.k : data.ks.k; this.k = true; this.kf = true; var i, len = this.keyframes[0].s[0].i.length; var jLen = this.keyframes[0].s[0].i[0].length; this.v = shape_pool.newElement(); this.v.setPathData(this.keyframes[0].s[0].c, len); this.pv = shape_pool.clone(this.v); this.localShapeCollection = shapeCollection_pool.newShapeCollection(); this.paths = this.localShapeCollection; this.paths.addShape(this.v); this.lastFrame = initFrame; this.reset = resetShape; this._caching = {lastFrame: initFrame, lastIndex: 0}; this.effectsSequence = [interpolateShapeCurrentTime.bind(this)]; } KeyframedShapeProperty.prototype.getValue = processEffectsSequence; KeyframedShapeProperty.prototype.interpolateShape = interpolateShape; KeyframedShapeProperty.prototype.setVValue = setVValue; KeyframedShapeProperty.prototype.addEffect = addEffect; var EllShapeProperty = (function(){ var cPoint = roundCorner; function EllShapeProperty(elem,data) { /*this.v = { v: createSizedArray(4), i: createSizedArray(4), o: createSizedArray(4), c: true };*/ this.v = shape_pool.newElement(); this.v.setPathData(true, 4); this.localShapeCollection = shapeCollection_pool.newShapeCollection(); this.paths = this.localShapeCollection; this.localShapeCollection.addShape(this.v); this.d = data.d; this.elem = elem; this.comp = elem.comp; this.frameId = -1; this.initDynamicPropertyContainer(elem); this.p = PropertyFactory.getProp(elem,data.p,1,0,this); this.s = PropertyFactory.getProp(elem,data.s,1,0,this); if(this.dynamicProperties.length){ this.k = true; }else{ this.k = false; this.convertEllToPath(); } }; EllShapeProperty.prototype = { reset: resetShape, getValue: function (){ if(this.elem.globalData.frameId === this.frameId){ return; } this.frameId = this.elem.globalData.frameId; this.iterateDynamicProperties(); if(this._mdf){ this.convertEllToPath(); } }, convertEllToPath: function() { var p0 = this.p.v[0], p1 = this.p.v[1], s0 = this.s.v[0]/2, s1 = this.s.v[1]/2; var _cw = this.d !== 3; var _v = this.v; _v.v[0][0] = p0; _v.v[0][1] = p1 - s1; _v.v[1][0] = _cw ? p0 + s0 : p0 - s0; _v.v[1][1] = p1; _v.v[2][0] = p0; _v.v[2][1] = p1 + s1; _v.v[3][0] = _cw ? p0 - s0 : p0 + s0; _v.v[3][1] = p1; _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint; _v.i[0][1] = p1 - s1; _v.i[1][0] = _cw ? p0 + s0 : p0 - s0; _v.i[1][1] = p1 - s1 * cPoint; _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint; _v.i[2][1] = p1 + s1; _v.i[3][0] = _cw ? p0 - s0 : p0 + s0; _v.i[3][1] = p1 + s1 * cPoint; _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint; _v.o[0][1] = p1 - s1; _v.o[1][0] = _cw ? p0 + s0 : p0 - s0; _v.o[1][1] = p1 + s1 * cPoint; _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint; _v.o[2][1] = p1 + s1; _v.o[3][0] = _cw ? p0 - s0 : p0 + s0; _v.o[3][1] = p1 - s1 * cPoint; } } extendPrototype([DynamicPropertyContainer], EllShapeProperty); return EllShapeProperty; }()); var StarShapeProperty = (function() { function StarShapeProperty(elem,data) { this.v = shape_pool.newElement(); this.v.setPathData(true, 0); this.elem = elem; this.comp = elem.comp; this.data = data; this.frameId = -1; this.d = data.d; this.initDynamicPropertyContainer(elem); if(data.sy === 1){ this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this); this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this); this.convertToPath = this.convertStarToPath; } else { this.convertToPath = this.convertPolygonToPath; } this.pt = PropertyFactory.getProp(elem,data.pt,0,0,this); this.p = PropertyFactory.getProp(elem,data.p,1,0,this); this.r = PropertyFactory.getProp(elem,data.r,0,degToRads,this); this.or = PropertyFactory.getProp(elem,data.or,0,0,this); this.os = PropertyFactory.getProp(elem,data.os,0,0.01,this); this.localShapeCollection = shapeCollection_pool.newShapeCollection(); this.localShapeCollection.addShape(this.v); this.paths = this.localShapeCollection; if(this.dynamicProperties.length){ this.k = true; }else{ this.k = false; this.convertToPath(); } }; StarShapeProperty.prototype = { reset: resetShape, getValue: function() { if(this.elem.globalData.frameId === this.frameId){ return; } this.frameId = this.elem.globalData.frameId; this.iterateDynamicProperties(); if(this._mdf){ this.convertToPath(); } }, convertStarToPath: function() { var numPts = Math.floor(this.pt.v)*2; var angle = Math.PI*2/numPts; /*this.v.v.length = numPts; this.v.i.length = numPts; this.v.o.length = numPts;*/ var longFlag = true; var longRad = this.or.v; var shortRad = this.ir.v; var longRound = this.os.v; var shortRound = this.is.v; var longPerimSegment = 2*Math.PI*longRad/(numPts*2); var shortPerimSegment = 2*Math.PI*shortRad/(numPts*2); var i, rad,roundness,perimSegment, currentAng = -Math.PI/ 2; currentAng += this.r.v; var dir = this.data.d === 3 ? -1 : 1; this.v._length = 0; for(i=0;i= 1) { segments.push({ s: s - 1, e: e - 1 }); } else { segments.push({ s: s, e: 1 }); segments.push({ s: 0, e: e - 1 }); } var shapeSegments = []; var i, len = segments.length, segmentOb; for (i = 0; i < len; i += 1) { segmentOb = segments[i]; if (segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength) { } else { var shapeS, shapeE; if (segmentOb.s * totalModifierLength <= addedLength) { shapeS = 0; } else { shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength; } if(segmentOb.e * totalModifierLength >= addedLength + shapeLength) { shapeE = 1; } else { shapeE = ((segmentOb.e * totalModifierLength - addedLength) / shapeLength); } shapeSegments.push([shapeS, shapeE]); } } if (!shapeSegments.length) { shapeSegments.push([0, 0]); } return shapeSegments; }; TrimModifier.prototype.releasePathsData = function(pathsData) { var i, len = pathsData.length; for (i = 0; i < len; i += 1) { segments_length_pool.release(pathsData[i]); } pathsData.length = 0; return pathsData; }; TrimModifier.prototype.processShapes = function(_isFirstFrame) { var s, e; if (this._mdf || _isFirstFrame) { var o = (this.o.v % 360) / 360; if (o < 0) { o += 1; } s = (this.s.v > 1 ? 1 : this.s.v < 0 ? 0 : this.s.v) + o; e = (this.e.v > 1 ? 1 : this.e.v < 0 ? 0 : this.e.v) + o; if (s === e) { } if (s > e) { var _s = s; s = e; e = _s; } s = Math.round(s * 10000) * 0.0001; e = Math.round(e * 10000) * 0.0001; this.sValue = s; this.eValue = e; } else { s = this.sValue; e = this.eValue; } var shapePaths; var i, len = this.shapes.length, j, jLen; var pathsData, pathData, totalShapeLength, totalModifierLength = 0; if (e === s) { for (i = 0; i < len; i += 1) { this.shapes[i].localShapeCollection.releaseShapes(); this.shapes[i].shape._mdf = true; this.shapes[i].shape.paths = this.shapes[i].localShapeCollection; } } else if (!((e === 1 && s === 0) || (e===0 && s === 1))){ var segments = [], shapeData, localShapeCollection; for (i = 0; i < len; i += 1) { shapeData = this.shapes[i]; // if shape hasn't changed and trim properties haven't changed, cached previous path can be used if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) { shapeData.shape.paths = shapeData.localShapeCollection; } else { shapePaths = shapeData.shape.paths; jLen = shapePaths._length; totalShapeLength = 0; if (!shapeData.shape._mdf && shapeData.pathsData.length) { totalShapeLength = shapeData.totalShapeLength; } else { pathsData = this.releasePathsData(shapeData.pathsData); for (j = 0; j < jLen; j += 1) { pathData = bez.getSegmentsLength(shapePaths.shapes[j]); pathsData.push(pathData); totalShapeLength += pathData.totalLength; } shapeData.totalShapeLength = totalShapeLength; shapeData.pathsData = pathsData; } totalModifierLength += totalShapeLength; shapeData.shape._mdf = true; } } var shapeS = s, shapeE = e, addedLength = 0, edges; for (i = len - 1; i >= 0; i -= 1) { shapeData = this.shapes[i]; if (shapeData.shape._mdf) { localShapeCollection = shapeData.localShapeCollection; localShapeCollection.releaseShapes(); //if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group if (this.m === 2 && len > 1) { edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength); addedLength += shapeData.totalShapeLength; } else { edges = [[shapeS, shapeE]]; } jLen = edges.length; for (j = 0; j < jLen; j += 1) { shapeS = edges[j][0]; shapeE = edges[j][1]; segments.length = 0; if (shapeE <= 1) { segments.push({ s:shapeData.totalShapeLength * shapeS, e:shapeData.totalShapeLength * shapeE }); } else if (shapeS >= 1) { segments.push({ s:shapeData.totalShapeLength * (shapeS - 1), e:shapeData.totalShapeLength * (shapeE - 1) }); } else { segments.push({ s:shapeData.totalShapeLength * shapeS, e:shapeData.totalShapeLength }); segments.push({ s:0, e:shapeData.totalShapeLength * (shapeE - 1) }); } var newShapesData = this.addShapes(shapeData,segments[0]); if (segments[0].s !== segments[0].e) { if (segments.length > 1) { var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1]; if (lastShapeInCollection.c) { var lastShape = newShapesData.pop(); this.addPaths(newShapesData, localShapeCollection); newShapesData = this.addShapes(shapeData, segments[1], lastShape); } else { this.addPaths(newShapesData, localShapeCollection); newShapesData = this.addShapes(shapeData, segments[1]); } } this.addPaths(newShapesData, localShapeCollection); } } shapeData.shape.paths = localShapeCollection; } } } else if (this._mdf) { for (i = 0; i < len; i += 1) { //Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween. //Don't remove this even if it's losing cached info. this.shapes[i].pathsData.length = 0; this.shapes[i].shape._mdf = true; } } }; TrimModifier.prototype.addPaths = function(newPaths, localShapeCollection) { var i, len = newPaths.length; for (i = 0; i < len; i += 1) { localShapeCollection.addShape(newPaths[i]); } }; TrimModifier.prototype.addSegment = function(pt1, pt2, pt3, pt4, shapePath, pos, newShape) { shapePath.setXYAt(pt2[0], pt2[1], 'o', pos); shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1); if(newShape){ shapePath.setXYAt(pt1[0], pt1[1], 'v', pos); } shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1); }; TrimModifier.prototype.addSegmentFromArray = function(points, shapePath, pos, newShape) { shapePath.setXYAt(points[1], points[5], 'o', pos); shapePath.setXYAt(points[2], points[6], 'i', pos + 1); if(newShape){ shapePath.setXYAt(points[0], points[4], 'v', pos); } shapePath.setXYAt(points[3], points[7], 'v', pos + 1); }; TrimModifier.prototype.addShapes = function(shapeData, shapeSegment, shapePath) { var pathsData = shapeData.pathsData; var shapePaths = shapeData.shape.paths.shapes; var i, len = shapeData.shape.paths._length, j, jLen; var addedLength = 0; var currentLengthData,segmentCount; var lengths; var segment; var shapes = []; var initPos; var newShape = true; if (!shapePath) { shapePath = shape_pool.newElement(); segmentCount = 0; initPos = 0; } else { segmentCount = shapePath._length; initPos = shapePath._length; } shapes.push(shapePath); for (i = 0; i < len; i += 1) { lengths = pathsData[i].lengths; shapePath.c = shapePaths[i].c; jLen = shapePaths[i].c ? lengths.length : lengths.length + 1; for (j = 1; j < jLen; j +=1) { currentLengthData = lengths[j-1]; if (addedLength + currentLengthData.addedLength < shapeSegment.s) { addedLength += currentLengthData.addedLength; shapePath.c = false; } else if(addedLength > shapeSegment.e) { shapePath.c = false; break; } else { if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) { this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape); newShape = false; } else { segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength)/currentLengthData.addedLength,(shapeSegment.e - addedLength)/currentLengthData.addedLength, lengths[j-1]); this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape); newShape = false; shapePath.c = false; } addedLength += currentLengthData.addedLength; segmentCount += 1; } } if (shapePaths[i].c && lengths.length) { currentLengthData = lengths[j - 1]; if (addedLength <= shapeSegment.e) { var segmentLength = lengths[j - 1].addedLength; if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) { this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape); newShape = false; } else { segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]); this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape); newShape = false; shapePath.c = false; } } else { shapePath.c = false; } addedLength += currentLengthData.addedLength; segmentCount += 1; } if (shapePath._length) { shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos); shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1],'o', shapePath._length - 1); } if (addedLength > shapeSegment.e) { break; } if (i < len - 1) { shapePath = shape_pool.newElement(); newShape = true; shapes.push(shapePath); segmentCount = 0; } } return shapes; }; ShapeModifiers.registerModifier('tm', TrimModifier); function RoundCornersModifier(){} extendPrototype([ShapeModifier],RoundCornersModifier); RoundCornersModifier.prototype.initModifierProperties = function(elem,data){ this.getValue = this.processKeys; this.rd = PropertyFactory.getProp(elem,data.r,0,null,this); this._isAnimated = !!this.rd.effectsSequence.length; }; RoundCornersModifier.prototype.processPath = function(path, round){ var cloned_path = shape_pool.newElement(); cloned_path.c = path.c; var i, len = path._length; var currentV,currentI,currentO,closerV, newV,newO,newI,distance,newPosPerc,index = 0; var vX,vY,oX,oY,iX,iY; for(i=0;i0){ pos -= 1; //this._elements.unshift(arr.splice(pos,1)[0]); this._elements.unshift(arr[pos]); cont += 1; } if(this.dynamicProperties.length){ this.k = true; }else{ this.getValue(true); } }; RepeaterModifier.prototype.resetElements = function(elements){ var i, len = elements.length; for(i = 0; i < len; i += 1) { elements[i]._processed = false; if(elements[i].ty === 'gr'){ this.resetElements(elements[i].it); } } }; RepeaterModifier.prototype.cloneElements = function(elements){ var i, len = elements.length; var newElements = JSON.parse(JSON.stringify(elements)); this.resetElements(newElements); return newElements; }; RepeaterModifier.prototype.changeGroupRender = function(elements, renderFlag) { var i, len = elements.length; for(i = 0; i < len; i += 1) { elements[i]._render = renderFlag; if(elements[i].ty === 'gr') { this.changeGroupRender(elements[i].it, renderFlag); } } }; RepeaterModifier.prototype.processShapes = function(_isFirstFrame) { var items, itemsTransform, i, dir, cont; if(this._mdf || _isFirstFrame){ var copies = Math.ceil(this.c.v); if(this._groups.length < copies){ while(this._groups.length < copies){ var group = { it:this.cloneElements(this._elements), ty:'gr' }; group.it.push({"a":{"a":0,"ix":1,"k":[0,0]},"nm":"Transform","o":{"a":0,"ix":7,"k":100},"p":{"a":0,"ix":2,"k":[0,0]},"r":{"a":1,"ix":6,"k":[{s:0,e:0,t:0},{s:0,e:0,t:1}]},"s":{"a":0,"ix":3,"k":[100,100]},"sa":{"a":0,"ix":5,"k":0},"sk":{"a":0,"ix":4,"k":0},"ty":"tr"}); this.arr.splice(0,0,group); this._groups.splice(0,0,group); this._currentCopies += 1; } this.elem.reloadShapes(); } cont = 0; var renderFlag; for(i = 0; i <= this._groups.length - 1; i += 1){ renderFlag = cont < copies; this._groups[i]._render = renderFlag; this.changeGroupRender(this._groups[i].it, renderFlag); cont += 1; } this._currentCopies = copies; //// var offset = this.o.v; var offsetModulo = offset%1; var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset); var k; var tMat = this.tr.v.props; var pProps = this.pMatrix.props; var rProps = this.rMatrix.props; var sProps = this.sMatrix.props; this.pMatrix.reset(); this.rMatrix.reset(); this.sMatrix.reset(); this.tMatrix.reset(); this.matrix.reset(); var iteration = 0; if(offset > 0) { while(iterationroundOffset){ this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true); iteration -= 1; } if(offsetModulo){ this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, - offsetModulo, true); iteration -= offsetModulo; } } i = this.data.m === 1 ? 0 : this._currentCopies - 1; dir = this.data.m === 1 ? 1 : -1; cont = this._currentCopies; var j, jLen; while(cont){ items = this.elemsData[i].it; itemsTransform = items[items.length - 1].transform.mProps.v.props; jLen = itemsTransform.length; items[items.length - 1].transform.mProps._mdf = true; items[items.length - 1].transform.op._mdf = true; items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1)); if(iteration !== 0){ if((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)){ this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false); } this.matrix.transform(rProps[0],rProps[1],rProps[2],rProps[3],rProps[4],rProps[5],rProps[6],rProps[7],rProps[8],rProps[9],rProps[10],rProps[11],rProps[12],rProps[13],rProps[14],rProps[15]); this.matrix.transform(sProps[0],sProps[1],sProps[2],sProps[3],sProps[4],sProps[5],sProps[6],sProps[7],sProps[8],sProps[9],sProps[10],sProps[11],sProps[12],sProps[13],sProps[14],sProps[15]); this.matrix.transform(pProps[0],pProps[1],pProps[2],pProps[3],pProps[4],pProps[5],pProps[6],pProps[7],pProps[8],pProps[9],pProps[10],pProps[11],pProps[12],pProps[13],pProps[14],pProps[15]); for(j=0;j 0.01){ return false; } i += 1; } return true; }; GradientProperty.prototype.checkCollapsable = function() { if (this.o.length/2 !== this.c.length/4) { return false; } if (this.data.k.k[0].s) { var i = 0, len = this.data.k.k.length; while (i < len) { if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) { return false; } i += 1; } } else if(!this.comparePoints(this.data.k.k, this.data.p)) { return false; } return true; }; GradientProperty.prototype.getValue = function(forceRender){ this.prop.getValue(); this._mdf = false; this._cmdf = false; this._omdf = false; if(this.prop._mdf || forceRender){ var i, len = this.data.p*4; var mult, val; for(i=0;i= currentLength + animatorOffset || !points) { perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength; xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc; yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc; matrixHelper.translate(-alignment[0]*letters[i].an/200, -(alignment[1] * yOff / 100)); flag = false; } else if (points) { segmentLength += currentPoint.partialLength; pointInd += 1; if (pointInd >= points.length) { pointInd = 0; segmentInd += 1; if (!segments[segmentInd]) { if (mask.v.c) { pointInd = 0; segmentInd = 0; points = segments[segmentInd].points; } else { segmentLength -= currentPoint.partialLength; points = null; } } else { points = segments[segmentInd].points; } } if (points) { prevPoint = currentPoint; currentPoint = points[pointInd]; partialLength = currentPoint.partialLength; } } } offf = letters[i].an / 2 - letters[i].add; matrixHelper.translate(-offf, 0, 0); } else { offf = letters[i].an/2 - letters[i].add; matrixHelper.translate(-offf,0,0); // Grouping alignment matrixHelper.translate(-alignment[0]*letters[i].an/200, -alignment[1]*yOff/100, 0); } lineLength += letters[i].l/2; for(j=0;j 1; if(this.kf) { this.addEffect(this.getKeyframeValue.bind(this)); } return this.kf; } TextProperty.prototype.addEffect = function(effectFunction) { this.effectsSequence.push(effectFunction); this.elem.addDynamicProperty(this); }; TextProperty.prototype.getValue = function(_finalValue) { if((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) { return; } this.currentData.t = this.data.d.k[this.keysIndex].s.t; var currentValue = this.currentData; var currentIndex = this.keysIndex; if(this.lock) { this.setCurrentData(this.currentData); return; } this.lock = true; this._mdf = false; var multipliedValue; var i, len = this.effectsSequence.length; var finalValue = _finalValue || this.data.d.k[this.keysIndex].s; for(i = 0; i < len; i += 1) { //Checking if index changed to prevent creating a new object every time the expression updates. if(currentIndex !== this.keysIndex) { finalValue = this.effectsSequence[i](finalValue, finalValue.t); } else { finalValue = this.effectsSequence[i](this.currentData, finalValue.t); } } if(currentValue !== finalValue) { this.setCurrentData(finalValue); } this.pv = this.v = this.currentData; this.lock = false; this.frameId = this.elem.globalData.frameId; } TextProperty.prototype.getKeyframeValue = function() { var textKeys = this.data.d.k, textDocumentData; var frameNum = this.elem.comp.renderedFrame; var i = 0, len = textKeys.length; while(i <= len - 1) { textDocumentData = textKeys[i].s; if(i === len - 1 || textKeys[i+1].t > frameNum){ break; } i += 1; } if(this.keysIndex !== i) { this.keysIndex = i; } return this.data.d.k[this.keysIndex].s; }; TextProperty.prototype.buildFinalText = function(text) { var combinedCharacters = FontManager.getCombinedCharacterCodes(); var charactersArray = []; var i = 0, len = text.length; var charCode; while (i < len) { charCode = text.charCodeAt(i); if (combinedCharacters.indexOf(charCode) !== -1) { charactersArray[charactersArray.length - 1] += text.charAt(i); } else { if (charCode >= 0xD800 && charCode <= 0xDBFF) { charCode = text.charCodeAt(i + 1); if (charCode >= 0xDC00 && charCode <= 0xDFFF) { charactersArray.push(text.substr(i, 2)); ++i; } else { charactersArray.push(text.charAt(i)); } } else { charactersArray.push(text.charAt(i)); } } i += 1; } return charactersArray; } TextProperty.prototype.completeTextData = function(documentData) { documentData.__complete = true; var fontManager = this.elem.globalData.fontManager; var data = this.data; var letters = []; var i, len; var newLineFlag, index = 0, val; var anchorGrouping = data.m.g; var currentSize = 0, currentPos = 0, currentLine = 0, lineWidths = []; var lineWidth = 0; var maxLineWidth = 0; var j, jLen; var fontData = fontManager.getFontByName(documentData.f); var charData, cLength = 0; var styles = fontData.fStyle ? fontData.fStyle.split(' ') : []; var fWeight = 'normal', fStyle = 'normal'; len = styles.length; var styleName; for(i=0;i boxWidth && finalText[i] !== ' '){ if(lastSpaceIndex === -1){ len += 1; } else { i = lastSpaceIndex; } currentHeight += documentData.finalLineHeight || documentData.finalSize*1.2; finalText.splice(i, lastSpaceIndex === i ? 1 : 0,"\r"); //finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i); lastSpaceIndex = -1; lineWidth = 0; }else { lineWidth += cLength; lineWidth += trackingOffset; } } currentHeight += fontData.ascent*documentData.finalSize/100; if(this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) { documentData.finalSize -= 1; documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s; } else { documentData.finalText = finalText; len = documentData.finalText.length; flag = false; } } } lineWidth = - trackingOffset; cLength = 0; var uncollapsedSpaces = 0; var currentChar; for (i = 0;i < len ;i += 1) { newLineFlag = false; currentChar = documentData.finalText[i]; charCode = currentChar.charCodeAt(0); if (currentChar === ' '){ val = '\u00A0'; } else if (charCode === 13 || charCode === 3) { uncollapsedSpaces = 0; lineWidths.push(lineWidth); maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth; lineWidth = - 2 * trackingOffset; val = ''; newLineFlag = true; currentLine += 1; }else{ val = documentData.finalText[i]; } if(fontManager.chars){ charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily); cLength = newLineFlag ? 0 : charData.w*documentData.finalSize/100; }else{ //var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize); //tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily; cLength = fontManager.measureText(val, documentData.f, documentData.finalSize); } // if(currentChar === ' '){ uncollapsedSpaces += cLength + trackingOffset; } else { lineWidth += cLength + trackingOffset + uncollapsedSpaces; uncollapsedSpaces = 0; } letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0}); if(anchorGrouping == 2){ currentSize += cLength; if(val === '' || val === '\u00A0' || i === len - 1){ if(val === '' || val === '\u00A0'){ currentSize -= cLength; } while(currentPos<=i){ letters[currentPos].an = currentSize; letters[currentPos].ind = index; letters[currentPos].extra = cLength; currentPos += 1; } index += 1; currentSize = 0; } }else if(anchorGrouping == 3){ currentSize += cLength; if(val === '' || i === len - 1){ if(val === ''){ currentSize -= cLength; } while(currentPos<=i){ letters[currentPos].an = currentSize; letters[currentPos].ind = index; letters[currentPos].extra = cLength; currentPos += 1; } currentSize = 0; index += 1; } }else{ letters[index].ind = index; letters[index].extra = 0; index += 1; } } documentData.l = letters; maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth; lineWidths.push(lineWidth); if(documentData.sz){ documentData.boxWidth = documentData.sz[0]; documentData.justifyOffset = 0; }else{ documentData.boxWidth = maxLineWidth; switch(documentData.j){ case 1: documentData.justifyOffset = - documentData.boxWidth; break; case 2: documentData.justifyOffset = - documentData.boxWidth/2; break; default: documentData.justifyOffset = 0; } } documentData.lineWidths = lineWidths; var animators = data.a, animatorData, letterData; jLen = animators.length; var based, ind, indexes = []; for(j=0;j= e ? 1 : 0; }else{ mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1)); } mult = easer(mult); }else if(type == 3){ if(e === s){ mult = ind >= e ? 0 : 1; }else{ mult = 1 - max(0,min(0.5/(e-s) + (ind-s)/(e-s),1)); } mult = easer(mult); }else if(type == 4){ if(e === s){ mult = 0; }else{ mult = max(0,min(0.5/(e-s) + (ind-s)/(e-s),1)); if(mult<0.5){ mult *= 2; }else{ mult = 1 - 2*(mult-0.5); } } mult = easer(mult); }else if(type == 5){ if(e === s){ mult = 0; }else{ var tot = e - s; /*ind += 0.5; mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind;*/ ind = min(max(0,ind+0.5-s),e-s); var x = -tot/2+ind; var a = tot/2; mult = Math.sqrt(1 - (x*x)/(a*a)); } mult = easer(mult); }else if(type == 6){ if(e === s){ mult = 0; }else{ ind = min(max(0,ind+0.5-s),e-s); mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind)/(e-s)))))/2; /* ind = Math.min(Math.max(s,ind),e-1); mult = (1+(Math.cos((Math.PI+Math.PI*2*(ind-s)/(e-1-s)))))/2; mult = Math.max(mult,(1/(e-1-s))/(e-1-s));*/ } mult = easer(mult); }else { if(ind >= floor(s)){ if(ind-s < 0){ mult = 1 - (s - ind); }else{ mult = max(0,min(e-ind,1)); } } mult = easer(mult); } return mult*this.a.v; }, getValue: function(newCharsFlag) { this.iterateDynamicProperties(); this._mdf = newCharsFlag || this._mdf; this._currentTextLength = this.elem.textProperty.currentData.l.length || 0; if(newCharsFlag && this.data.r === 2) { this.e.v = this._currentTextLength; } var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars; var o = this.o.v/divisor; var s = this.s.v/divisor + o; var e = (this.e.v/divisor) + o; if(s>e){ var _s = s; s = e; e = _s; } this.finalS = s; this.finalE = e; } } extendPrototype([DynamicPropertyContainer], TextSelectorProp); function getTextSelectorProp(elem, data,arr) { return new TextSelectorProp(elem, data, arr); } return { getTextSelectorProp: getTextSelectorProp }; }()); var pool_factory = (function() { return function(initialLength, _create, _release, _clone) { var _length = 0; var _maxLength = initialLength; var pool = createSizedArray(_maxLength); var ob = { newElement: newElement, release: release }; function newElement(){ var element; if(_length){ _length -= 1; element = pool[_length]; } else { element = _create(); } return element; } function release(element) { if(_length === _maxLength) { pool = pooling.double(pool); _maxLength = _maxLength*2; } if (_release) { _release(element); } pool[_length] = element; _length += 1; } function clone() { var clonedElement = newElement(); return _clone(clonedElement); } return ob; }; }()); var pooling = (function(){ function double(arr){ return arr.concat(createSizedArray(arr.length)); } return { double: double }; }()); var point_pool = (function(){ function create() { return createTypedArray('float32', 2); } return pool_factory(8, create); }()); var shape_pool = (function(){ function create() { return new ShapePath(); } function release(shapePath) { var len = shapePath._length, i; for(i = 0; i < len; i += 1) { point_pool.release(shapePath.v[i]); point_pool.release(shapePath.i[i]); point_pool.release(shapePath.o[i]); shapePath.v[i] = null; shapePath.i[i] = null; shapePath.o[i] = null; } shapePath._length = 0; shapePath.c = false; } function clone(shape) { var cloned = factory.newElement(); var i, len = shape._length === undefined ? shape.v.length : shape._length; cloned.setLength(len); cloned.c = shape.c; var pt; for(i = 0; i < len; i += 1) { cloned.setTripleAt(shape.v[i][0],shape.v[i][1],shape.o[i][0],shape.o[i][1],shape.i[i][0],shape.i[i][1], i); } return cloned; } var factory = pool_factory(4, create, release); factory.clone = clone; return factory; }()); var shapeCollection_pool = (function(){ var ob = { newShapeCollection: newShapeCollection, release: release }; var _length = 0; var _maxLength = 4; var pool = createSizedArray(_maxLength); function newShapeCollection(){ var shapeCollection; if(_length){ _length -= 1; shapeCollection = pool[_length]; } else { shapeCollection = new ShapeCollection(); } return shapeCollection; } function release(shapeCollection) { var i, len = shapeCollection._length; for(i = 0; i < len; i += 1) { shape_pool.release(shapeCollection.shapes[i]); } shapeCollection._length = 0; if(_length === _maxLength) { pool = pooling.double(pool); _maxLength = _maxLength*2; } pool[_length] = shapeCollection; _length += 1; } return ob; }()); var segments_length_pool = (function(){ function create() { return { lengths: [], totalLength: 0 }; } function release(element) { var i, len = element.lengths.length; for(i=0;i= 0; i--) { if (!this.elements[i]) { data = this.layers[i]; if(data.ip - data.st <= (num - this.layers[i].st) && data.op - data.st > (num - this.layers[i].st)) { this.buildItem(i); } } this.completeLayers = this.elements[i] ? this.completeLayers:false; } this.checkPendingElements(); }; BaseRenderer.prototype.createItem = function(layer){ switch(layer.ty){ case 2: return this.createImage(layer); case 0: return this.createComp(layer); case 1: return this.createSolid(layer); case 3: return this.createNull(layer); case 4: return this.createShape(layer); case 5: return this.createText(layer); case 13: return this.createCamera(layer); } return this.createNull(layer); }; BaseRenderer.prototype.createCamera = function(){ throw new Error('You\'re using a 3d camera. Try the html renderer.'); }; BaseRenderer.prototype.buildAllItems = function(){ var i, len = this.layers.length; for(i=0;i= 0; i--) { if(this.completeLayers || this.elements[i]){ this.elements[i].prepareFrame(num - this.layers[i].st); } } if(this.globalData._mdf) { for (i = 0; i < len; i += 1) { if(this.completeLayers || this.elements[i]){ this.elements[i].renderFrame(); } } } }; SVGRenderer.prototype.appendElementInPos = function(element, pos){ var newElement = element.getBaseElement(); if(!newElement){ return; } var i = 0; var nextElement; while(ielementRel && fillType === 'meet' || animationRelelementRel && fillType === 'slice'))){ this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))/2*this.renderConfig.dpr; } else if(xPos === 'xMax' && ((animationRelelementRel && fillType === 'slice'))){ this.transformCanvas.tx = (elementWidth-this.transformCanvas.w*(elementHeight/this.transformCanvas.h))*this.renderConfig.dpr; } else { this.transformCanvas.tx = 0; } if(yPos === 'YMid' && ((animationRel>elementRel && fillType==='meet') || (animationRelelementRel && fillType==='meet') || (animationRel= 0; i-=1) { if(this.elements[i]) { this.elements[i].destroy(); } } this.elements.length = 0; this.globalData.canvasContext = null; this.animationItem.container = null; this.destroyed = true; }; CanvasRenderer.prototype.renderFrame = function(num, forceRender){ if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){ return; } this.renderedFrame = num; this.globalData.frameNum = num - this.animationItem._isFirstFrame; this.globalData.frameId += 1; this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender; this.globalData.projectInterface.currentFrame = num; // console.log('--------'); // console.log('NEW: ',num); var i, len = this.layers.length; if(!this.completeLayers){ this.checkLayers(num); } for (i = 0; i < len; i++) { if(this.completeLayers || this.elements[i]){ this.elements[i].prepareFrame(num - this.layers[i].st); } } if(this.globalData._mdf) { if(this.renderConfig.clearCanvas === true){ this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h); }else{ this.save(); } for (i = len - 1; i >= 0; i-=1) { if(this.completeLayers || this.elements[i]){ this.elements[i].renderFrame(); } } if(this.renderConfig.clearCanvas !== true){ this.restore(); } } }; CanvasRenderer.prototype.buildItem = function(pos){ var elements = this.elements; if(elements[pos] || this.layers[pos].ty == 99){ return; } var element = this.createItem(this.layers[pos], this,this.globalData); elements[pos] = element; element.initExpressions(); /*if(this.layers[pos].ty === 0){ element.resize(this.globalData.transformCanvas); }*/ }; CanvasRenderer.prototype.checkPendingElements = function(){ while(this.pendingElements.length){ var element = this.pendingElements.pop(); element.checkParenting(); } }; CanvasRenderer.prototype.hide = function(){ this.animationItem.container.style.display = 'none'; }; CanvasRenderer.prototype.show = function(){ this.animationItem.container.style.display = 'block'; }; function HybridRenderer(animationItem, config){ this.animationItem = animationItem; this.layers = null; this.renderedFrame = -1; this.renderConfig = { className: (config && config.className) || '', imagePreserveAspectRatio: (config && config.imagePreserveAspectRatio) || 'xMidYMid slice', hideOnTransparent: (config && config.hideOnTransparent === false) ? false : true }; this.globalData = { _mdf: false, frameNum: -1, renderConfig: this.renderConfig }; this.pendingElements = []; this.elements = []; this.threeDElements = []; this.destroyed = false; this.camera = null; this.supports3d = true; this.rendererType = 'html'; } extendPrototype([BaseRenderer],HybridRenderer); HybridRenderer.prototype.buildItem = SVGRenderer.prototype.buildItem; HybridRenderer.prototype.checkPendingElements = function(){ while(this.pendingElements.length){ var element = this.pendingElements.pop(); element.checkParenting(); } }; HybridRenderer.prototype.appendElementInPos = function(element, pos){ var newDOMElement = element.getBaseElement(); if(!newDOMElement){ return; } var layer = this.layers[pos]; if(!layer.ddd || !this.supports3d){ if(this.threeDElements) { this.addTo3dContainer(newDOMElement,pos); } else { var i = 0; var nextDOMElement, nextLayer, tmpDOMElement; while(i= pos) { return this.threeDElements[i].perspectiveElem; } i += 1; } }; HybridRenderer.prototype.createThreeDContainer = function(pos, type){ var perspectiveElem = createTag('div'); styleDiv(perspectiveElem); var container = createTag('div'); styleDiv(container); if(type === '3d') { perspectiveElem.style.width = this.globalData.compSize.w+'px'; perspectiveElem.style.height = this.globalData.compSize.h+'px'; perspectiveElem.style.transformOrigin = perspectiveElem.style.mozTransformOrigin = perspectiveElem.style.webkitTransformOrigin = "50% 50%"; container.style.transform = container.style.webkitTransform = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)'; } perspectiveElem.appendChild(container); //this.resizerElem.appendChild(perspectiveElem); var threeDContainerData = { container:container, perspectiveElem:perspectiveElem, startPos: pos, endPos: pos, type: type }; this.threeDElements.push(threeDContainerData); return threeDContainerData; }; HybridRenderer.prototype.build3dContainers = function(){ var i, len = this.layers.length; var lastThreeDContainerData; var currentContainer = ''; for(i=0;i= 0; i --) { this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem); } }; HybridRenderer.prototype.addTo3dContainer = function(elem,pos){ var i = 0, len = this.threeDElements.length; while(ielementRel){ sx = elementWidth/(this.globalData.compSize.w); sy = elementWidth/(this.globalData.compSize.w); tx = 0; ty = ((elementHeight-this.globalData.compSize.h*(elementWidth/this.globalData.compSize.w))/2); }else{ sx = elementHeight/(this.globalData.compSize.h); sy = elementHeight/(this.globalData.compSize.h); tx = (elementWidth-this.globalData.compSize.w*(elementHeight/this.globalData.compSize.h))/2; ty = 0; } this.resizerElem.style.transform = this.resizerElem.style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,'+sy+',0,0,0,0,1,0,'+tx+','+ty+',0,1)'; }; HybridRenderer.prototype.renderFrame = SVGRenderer.prototype.renderFrame; HybridRenderer.prototype.hide = function(){ this.resizerElem.style.display = 'none'; }; HybridRenderer.prototype.show = function(){ this.resizerElem.style.display = 'block'; }; HybridRenderer.prototype.initItems = function(){ this.buildAllItems(); if(this.camera){ this.camera.setup(); } else { var cWidth = this.globalData.compSize.w; var cHeight = this.globalData.compSize.h; var i, len = this.threeDElements.length; for(i=0;i 0){ this.maskElement.setAttribute('id', layerId); this.element.maskedElement.setAttribute(maskRef, "url(" + locationHref + "#" + layerId + ")"); defs.appendChild(this.maskElement); } if (this.viewData.length) { this.element.addRenderableComponent(this); } } MaskElement.prototype.getMaskProperty = function(pos){ return this.viewData[pos].prop; }; MaskElement.prototype.renderFrame = function (isFirstFrame) { var finalMat = this.element.finalTransform.mat; var i, len = this.masksProperties.length; for (i = 0; i < len; i++) { if(this.viewData[i].prop._mdf || isFirstFrame){ this.drawPath(this.masksProperties[i],this.viewData[i].prop.v,this.viewData[i]); } if(this.viewData[i].op._mdf || isFirstFrame){ this.viewData[i].elem.setAttribute('fill-opacity',this.viewData[i].op.v); } if(this.masksProperties[i].mode !== 'n'){ if(this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)){ this.viewData[i].invRect.setAttribute('x', -finalMat.props[12]); this.viewData[i].invRect.setAttribute('y', -finalMat.props[13]); } if(this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)){ var feMorph = this.storedData[i].expan; if(this.storedData[i].x.v < 0){ if(this.storedData[i].lastOperator !== 'erode'){ this.storedData[i].lastOperator = 'erode'; this.storedData[i].elem.setAttribute('filter','url(' + locationHref + '#'+this.storedData[i].filterId+')'); } feMorph.setAttribute('radius',-this.storedData[i].x.v); }else{ if(this.storedData[i].lastOperator !== 'dilate'){ this.storedData[i].lastOperator = 'dilate'; this.storedData[i].elem.setAttribute('filter',null); } this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v*2); } } } } }; MaskElement.prototype.getMaskelement = function () { return this.maskElement; }; MaskElement.prototype.createLayerSolidPath = function(){ var path = 'M0,0 '; path += ' h' + this.globalData.compSize.w ; path += ' v' + this.globalData.compSize.h ; path += ' h-' + this.globalData.compSize.w ; path += ' v-' + this.globalData.compSize.h + ' '; return path; }; MaskElement.prototype.drawPath = function(pathData,pathNodes,viewData){ var pathString = " M"+pathNodes.v[0][0]+','+pathNodes.v[0][1]; var i, len; len = pathNodes._length; for(i=1;i 1){ pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1]; } //pathNodes.__renderedString = pathString; if(viewData.lastPath !== pathString){ var pathShapeValue = ''; if(viewData.elem){ if(pathNodes.c){ pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString; } viewData.elem.setAttribute('d',pathShapeValue); } viewData.lastPath = pathString; } }; MaskElement.prototype.destroy = function(){ this.element = null; this.globalData = null; this.maskElement = null; this.data = null; this.masksProperties = null; }; /** * @file * Handles AE's layer parenting property. * */ function HierarchyElement(){} HierarchyElement.prototype = { /** * @function * Initializes hierarchy properties * */ initHierarchy: function() { //element's parent list this.hierarchy = []; //if element is parent of another layer _isParent will be true this._isParent = false; this.checkParenting(); }, /** * @function * Sets layer's hierarchy. * @param {array} hierarch * layer's parent list * */ setHierarchy: function(hierarchy){ this.hierarchy = hierarchy; }, /** * @function * Sets layer as parent. * */ setAsParent: function() { this._isParent = true; }, /** * @function * Searches layer's parenting chain * */ checkParenting: function(){ if (this.data.parent !== undefined){ this.comp.buildElementParenting(this, this.data.parent, []); } } }; /** * @file * Handles element's layer frame update. * Checks layer in point and out point * */ function FrameElement(){} FrameElement.prototype = { /** * @function * Initializes frame related properties. * */ initFrame: function(){ //set to true when inpoint is rendered this._isFirstFrame = false; //list of animated properties this.dynamicProperties = []; // If layer has been modified in current tick this will be true this._mdf = false; }, /** * @function * Calculates all dynamic values * * @param {number} num * current frame number in Layer's time * @param {boolean} isVisible * if layers is currently in range * */ prepareProperties: function(num, isVisible) { var i, len = this.dynamicProperties.length; for (i = 0;i < len; i += 1) { if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) { this.dynamicProperties[i].getValue(); if (this.dynamicProperties[i]._mdf) { this.globalData._mdf = true; this._mdf = true; } } } }, addDynamicProperty: function(prop) { if(this.dynamicProperties.indexOf(prop) === -1) { this.dynamicProperties.push(prop); } } }; function TransformElement(){} TransformElement.prototype = { initTransform: function() { this.finalTransform = { mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {o:0}, _matMdf: false, _opMdf: false, mat: new Matrix() }; if (this.data.ao) { this.finalTransform.mProp.autoOriented = true; } //TODO: check TYPE 11: Guided elements if (this.data.ty !== 11) { //this.createElements(); } }, renderTransform: function() { this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame; this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame; if (this.hierarchy) { var mat; var finalMat = this.finalTransform.mat; var i = 0, len = this.hierarchy.length; //Checking if any of the transformation matrices in the hierarchy chain has changed. if (!this.finalTransform._matMdf) { while (i < len) { if (this.hierarchy[i].finalTransform.mProp._mdf) { this.finalTransform._matMdf = true; break; } i += 1; } } if (this.finalTransform._matMdf) { mat = this.finalTransform.mProp.v.props; finalMat.cloneFromProps(mat); for (i = 0; i < len; i += 1) { mat = this.hierarchy[i].finalTransform.mProp.v.props; finalMat.transform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5], mat[6], mat[7], mat[8], mat[9], mat[10], mat[11], mat[12], mat[13], mat[14], mat[15]); } } } }, globalToLocal: function(pt) { var transforms = []; transforms.push(this.finalTransform); var flag = true; var comp = this.comp; while (flag) { if (comp.finalTransform) { if (comp.data.hasMask) { transforms.splice(0, 0, comp.finalTransform); } comp = comp.comp; } else { flag = false; } } var i, len = transforms.length,ptNew; for (i = 0; i < len; i += 1) { ptNew = transforms[i].mat.applyToPointArray(0, 0, 0); //ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]); pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0]; } return pt; }, mHelper: new Matrix() }; function RenderableElement(){ } RenderableElement.prototype = { initRenderable: function() { //layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange this.isInRange = false; //layer's display state this.hidden = false; // If layer's transparency equals 0, it can be hidden this.isTransparent = false; //list of animated components this.renderableComponents = []; }, addRenderableComponent: function(component) { if(this.renderableComponents.indexOf(component) === -1) { this.renderableComponents.push(component); } }, removeRenderableComponent: function(component) { if(this.renderableComponents.indexOf(component) !== -1) { this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1); } }, prepareRenderableFrame: function(num) { this.checkLayerLimits(num); }, checkTransparency: function(){ if(this.finalTransform.mProp.o.v <= 0) { if(!this.isTransparent && this.globalData.renderConfig.hideOnTransparent){ this.isTransparent = true; this.hide(); } } else if(this.isTransparent) { this.isTransparent = false; this.show(); } }, /** * @function * Initializes frame related properties. * * @param {number} num * current frame number in Layer's time * */ checkLayerLimits: function(num) { if(this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) { if(this.isInRange !== true){ this.globalData._mdf = true; this._mdf = true; this.isInRange = true; this.show(); } } else { if(this.isInRange !== false){ this.globalData._mdf = true; this.isInRange = false; this.hide(); } } }, renderRenderable: function() { var i, len = this.renderableComponents.length; for(i = 0; i < len; i += 1) { this.renderableComponents[i].renderFrame(this._isFirstFrame); } /*this.maskManager.renderFrame(this.finalTransform.mat); this.renderableEffectsManager.renderFrame(this._isFirstFrame);*/ }, sourceRectAtTime: function(){ return { top:0, left:0, width:100, height:100 }; }, getLayerSize: function(){ if(this.data.ty === 5){ return {w:this.data.textData.width,h:this.data.textData.height}; }else{ return {w:this.data.width,h:this.data.height}; } } }; function RenderableDOMElement() {} (function(){ var _prototype = { initElement: function(data,globalData,comp) { this.initFrame(); this.initBaseData(data, globalData, comp); this.initTransform(data, globalData, comp); this.initHierarchy(); this.initRenderable(); this.initRendererElement(); this.createContainerElements(); this.createRenderableComponents(); this.createContent(); this.hide(); }, hide: function(){ if (!this.hidden && (!this.isInRange || this.isTransparent)) { var elem = this.baseElement || this.layerElement; elem.style.display = 'none'; this.hidden = true; } }, show: function(){ if (this.isInRange && !this.isTransparent){ if (!this.data.hd) { var elem = this.baseElement || this.layerElement; elem.style.display = 'block'; } this.hidden = false; this._isFirstFrame = true; } }, renderFrame: function() { //If it is exported as hidden (data.hd === true) no need to render //If it is not visible no need to render if (this.data.hd || this.hidden) { return; } this.renderTransform(); this.renderRenderable(); this.renderElement(); this.renderInnerContent(); if (this._isFirstFrame) { this._isFirstFrame = false; } }, renderInnerContent: function() {}, prepareFrame: function(num) { this._mdf = false; this.prepareRenderableFrame(num); this.prepareProperties(num, this.isInRange); this.checkTransparency(); }, destroy: function(){ this.innerElem = null; this.destroyBaseElement(); } }; extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement); }()); function ProcessedElement(element, position) { this.elem = element; this.pos = position; } function SVGStyleData(data, level) { this.data = data; this.type = data.ty; this.d = ''; this.lvl = level; this._mdf = false; this.closed = data.hd === true; this.pElem = createNS('path'); this.msElem = null; } SVGStyleData.prototype.reset = function() { this.d = ''; this._mdf = false; }; function SVGShapeData(transformers, level, shape) { this.caches = []; this.styles = []; this.transformers = transformers; this.lStr = ''; this.sh = shape; this.lvl = level; //TODO find if there are some cases where _isAnimated can be false. // For now, since shapes add up with other shapes. They have to be calculated every time. // One way of finding out is checking if all styles associated to this shape depend only of this shape this._isAnimated = !!shape.k; // TODO: commenting this for now since all shapes are animated var i = 0, len = transformers.length; while(i < len) { if(transformers[i].mProps.dynamicProperties.length) { this._isAnimated = true; break; } i += 1; } } SVGShapeData.prototype.setAsAnimated = function() { this._isAnimated = true; } function SVGTransformData(mProps, op, container) { this.transform = { mProps: mProps, op: op, container: container }; this.elements = []; this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length; } function SVGStrokeStyleData(elem, data, styleOb){ this.initDynamicPropertyContainer(elem); this.getValue = this.iterateDynamicProperties; this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this); this.w = PropertyFactory.getProp(elem,data.w,0,null,this); this.d = new DashProperty(elem,data.d||{},'svg',this); this.c = PropertyFactory.getProp(elem,data.c,1,255,this); this.style = styleOb; this._isAnimated = !!this._isAnimated; } extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData); function SVGFillStyleData(elem, data, styleOb){ this.initDynamicPropertyContainer(elem); this.getValue = this.iterateDynamicProperties; this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this); this.c = PropertyFactory.getProp(elem,data.c,1,255,this); this.style = styleOb; } extendPrototype([DynamicPropertyContainer], SVGFillStyleData); function SVGGradientFillStyleData(elem, data, styleOb){ this.initDynamicPropertyContainer(elem); this.getValue = this.iterateDynamicProperties; this.initGradientData(elem, data, styleOb); } SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){ this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this); this.s = PropertyFactory.getProp(elem,data.s,1,null,this); this.e = PropertyFactory.getProp(elem,data.e,1,null,this); this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this); this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this); this.g = new GradientProperty(elem,data.g,this); this.style = styleOb; this.stops = []; this.setGradientData(styleOb.pElem, data); this.setGradientOpacity(data, styleOb); this._isAnimated = !!this._isAnimated; }; SVGGradientFillStyleData.prototype.setGradientData = function(pathElement,data){ var gradientId = createElementID(); var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient'); gfill.setAttribute('id',gradientId); gfill.setAttribute('spreadMethod','pad'); gfill.setAttribute('gradientUnits','userSpaceOnUse'); var stops = []; var stop, j, jLen; jLen = data.g.p*4; for(j=0;j 0) { redraw = itemData.transformers[k].mProps._mdf || redraw; iterations --; k --; } if(redraw) { iterations = lvl - itemData.styles[l].lvl; k = itemData.transformers.length-1; while(iterations > 0) { props = itemData.transformers[k].mProps.v.props; mat.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]); iterations --; k --; } } } else { mat = _identityMatrix; } paths = itemData.sh.paths; jLen = paths._length; if(redraw){ pathStringTransformed = ''; for(j=0;j= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v; var dist = rad * percent; var x = Math.cos(ang + itemData.a.v) * dist + pt1[0]; var y = Math.sin(ang + itemData.a.v) * dist + pt1[1]; gfill.setAttribute('fx', x); gfill.setAttribute('fy', y); if (hasOpacity && !itemData.g._collapsable) { itemData.of.setAttribute('fx', x); itemData.of.setAttribute('fy', y); } } //gfill.setAttribute('fy','200'); } }; function renderStroke(styleData, itemData, isFirstFrame) { var styleElem = itemData.style; var d = itemData.d; if (d && (d._mdf || isFirstFrame) && d.dashStr) { styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr); styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]); } if(itemData.c && (itemData.c._mdf || isFirstFrame)){ styleElem.pElem.setAttribute('stroke','rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')'); } if(itemData.o._mdf || isFirstFrame){ styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v); } if(itemData.w._mdf || isFirstFrame){ styleElem.pElem.setAttribute('stroke-width', itemData.w.v); if(styleElem.msElem){ styleElem.msElem.setAttribute('stroke-width', itemData.w.v); } } }; return ob; }()) function ShapeTransformManager() { this.sequences = {}; this.sequenceList = []; this.transform_key_count = 0; } ShapeTransformManager.prototype = { addTransformSequence: function(transforms) { var i, len = transforms.length; var key = '_'; for(i = 0; i < len; i += 1) { key += transforms[i].transform.key + '_'; } var sequence = this.sequences[key]; if(!sequence) { sequence = { transforms: [].concat(transforms), finalTransform: new Matrix(), _mdf: false }; this.sequences[key] = sequence; this.sequenceList.push(sequence); } return sequence; }, processSequence: function(sequence, isFirstFrame) { var i = 0, len = sequence.transforms.length, _mdf = isFirstFrame; while (i < len && !isFirstFrame) { if (sequence.transforms[i].transform.mProps._mdf) { _mdf = true; break; } i += 1 } if (_mdf) { var props; sequence.finalTransform.reset(); for (i = len - 1; i >= 0; i -= 1) { props = sequence.transforms[i].transform.mProps.v.props; sequence.finalTransform.transform(props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7],props[8],props[9],props[10],props[11],props[12],props[13],props[14],props[15]); } } sequence._mdf = _mdf; }, processSequences: function(isFirstFrame) { var i, len = this.sequenceList.length; for (i = 0; i < len; i += 1) { this.processSequence(this.sequenceList[i], isFirstFrame); } }, getNewKey: function() { return '_' + this.transform_key_count++; } } function CVShapeData(element, data, styles, transformsManager) { this.styledShapes = []; this.tr = [0,0,0,0,0,0]; var ty = 4; if(data.ty == 'rc'){ ty = 5; }else if(data.ty == 'el'){ ty = 6; }else if(data.ty == 'sr'){ ty = 7; } this.sh = ShapePropertyFactory.getShapeProp(element,data,ty,element); var i , len = styles.length,styledShape; for (i = 0; i < len; i += 1) { if (!styles[i].closed) { styledShape = { transforms: transformsManager.addTransformSequence(styles[i].transforms), trNodes: [] } this.styledShapes.push(styledShape); styles[i].elements.push(styledShape); } } } CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated; function BaseElement(){ } BaseElement.prototype = { checkMasks: function(){ if(!this.data.hasMask){ return false; } var i = 0, len = this.data.masksProperties.length; while(i=0;i-=1){ this.shapeModifiers[i].processShapes(this._isFirstFrame); } }, lcEnum: { '1': 'butt', '2': 'round', '3': 'square' }, ljEnum: { '1': 'miter', '2': 'round', '3': 'bevel' }, searchProcessedElement: function(elem){ var elements = this.processedElements; var i = 0, len = elements.length; while (i < len) { if (elements[i].elem === elem) { return elements[i].pos; } i += 1; } return 0; }, addProcessedElement: function(elem, pos){ var elements = this.processedElements; var i = elements.length; while(i) { i -= 1; if (elements[i].elem === elem) { elements[i].pos = pos; return; } } elements.push(new ProcessedElement(elem, pos)); }, prepareFrame: function(num) { this.prepareRenderableFrame(num); this.prepareProperties(num, this.isInRange); } }; function ITextElement(){ } ITextElement.prototype.initElement = function(data,globalData,comp){ this.lettersChangedFlag = true; this.initFrame(); this.initBaseData(data, globalData, comp); this.textProperty = new TextProperty(this, data.t, this.dynamicProperties); this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this); this.initTransform(data, globalData, comp); this.initHierarchy(); this.initRenderable(); this.initRendererElement(); this.createContainerElements(); this.createRenderableComponents(); this.createContent(); this.hide(); this.textAnimator.searchProperties(this.dynamicProperties); }; ITextElement.prototype.prepareFrame = function(num) { this._mdf = false; this.prepareRenderableFrame(num); this.prepareProperties(num, this.isInRange); if(this.textProperty._mdf || this.textProperty._isFirstFrame) { this.buildNewText(); this.textProperty._isFirstFrame = false; this.textProperty._mdf = false; } }; ITextElement.prototype.createPathShape = function(matrixHelper, shapes) { var j,jLen = shapes.length; var k, kLen, pathNodes; var shapeStr = ''; for(j=0;j= 0; i -= 1 ){ if(this.completeLayers || this.elements[i]){ this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st); if(this.elements[i]._mdf) { this._mdf = true; } } } }; ICompElement.prototype.renderInnerContent = function() { var i,len = this.layers.length; for( i = 0; i < len; i += 1 ){ if(this.completeLayers || this.elements[i]){ this.elements[i].renderFrame(); } } }; ICompElement.prototype.setElements = function(elems){ this.elements = elems; }; ICompElement.prototype.getElements = function(){ return this.elements; }; ICompElement.prototype.destroyElements = function(){ var i,len = this.layers.length; for( i = 0; i < len; i+=1 ){ if(this.elements[i]){ this.elements[i].destroy(); } } }; ICompElement.prototype.destroy = function(){ this.destroyElements(); this.destroyBaseElement(); }; function IImageElement(data,globalData,comp){ this.assetData = globalData.getAssetData(data.refId); this.initElement(data,globalData,comp); this.sourceRect = {top:0,left:0,width:this.assetData.w,height:this.assetData.h}; } extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement], IImageElement); IImageElement.prototype.createContent = function(){ var assetPath = this.globalData.getAssetsPath(this.assetData); this.innerElem = createNS('image'); this.innerElem.setAttribute('width',this.assetData.w+"px"); this.innerElem.setAttribute('height',this.assetData.h+"px"); this.innerElem.setAttribute('preserveAspectRatio',this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio); this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink','href',assetPath); this.layerElement.appendChild(this.innerElem); }; IImageElement.prototype.sourceRectAtTime = function() { return this.sourceRect; } function ISolidElement(data,globalData,comp){ this.initElement(data,globalData,comp); } extendPrototype([IImageElement], ISolidElement); ISolidElement.prototype.createContent = function(){ var rect = createNS('rect'); ////rect.style.width = this.data.sw; ////rect.style.height = this.data.sh; ////rect.style.fill = this.data.sc; rect.setAttribute('width',this.data.sw); rect.setAttribute('height',this.data.sh); rect.setAttribute('fill',this.data.sc); this.layerElement.appendChild(rect); }; function SVGCompElement(data,globalData,comp){ this.layers = data.layers; this.supports3d = true; this.completeLayers = false; this.pendingElements = []; this.elements = this.layers ? createSizedArray(this.layers.length) : []; //this.layerElement = createNS('g'); this.initElement(data,globalData,comp); this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate,this) : {_placeholder:true}; } extendPrototype([SVGRenderer, ICompElement, SVGBaseElement], SVGCompElement); function SVGTextElement(data,globalData,comp){ this.textSpans = []; this.renderType = 'svg'; this.initElement(data,globalData,comp); } extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement], SVGTextElement); SVGTextElement.prototype.createContent = function(){ if (this.data.singleShape && !this.globalData.fontManager.chars) { this.textContainer = createNS('text'); } }; SVGTextElement.prototype.buildTextContents = function(textArray) { var i = 0, len = textArray.length; var textContents = [], currentTextContent = ''; while (i < len) { if(textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) { textContents.push(currentTextContent); currentTextContent = ''; } else { currentTextContent += textArray[i]; } i += 1; } textContents.push(currentTextContent); return textContents; } SVGTextElement.prototype.buildNewText = function(){ var i, len; var documentData = this.textProperty.currentData; this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0); if(documentData.fc) { this.layerElement.setAttribute('fill', this.buildColor(documentData.fc)); }else{ this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)'); } if(documentData.sc){ this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc)); this.layerElement.setAttribute('stroke-width', documentData.sw); } this.layerElement.setAttribute('font-size', documentData.finalSize); var fontData = this.globalData.fontManager.getFontByName(documentData.f); if(fontData.fClass){ this.layerElement.setAttribute('class',fontData.fClass); } else { this.layerElement.setAttribute('font-family', fontData.fFamily); var fWeight = documentData.fWeight, fStyle = documentData.fStyle; this.layerElement.setAttribute('font-style', fStyle); this.layerElement.setAttribute('font-weight', fWeight); } this.layerElement.setAttribute('aria-label', documentData.t); var letters = documentData.l || []; var usesGlyphs = !!this.globalData.fontManager.chars; len = letters.length; var tSpan; var matrixHelper = this.mHelper; var shapes, shapeStr = '', singleShape = this.data.singleShape; var xPos = 0, yPos = 0, firstLine = true; var trackingOffset = documentData.tr/1000*documentData.finalSize; if(singleShape && !usesGlyphs && !documentData.sz) { var tElement = this.textContainer; var justify = 'start'; switch(documentData.j) { case 1: justify = 'end'; break; case 2: justify = 'middle'; break; } tElement.setAttribute('text-anchor',justify); tElement.setAttribute('letter-spacing',trackingOffset); var textContent = this.buildTextContents(documentData.finalText); len = textContent.length; yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0; for ( i = 0; i < len; i += 1) { tSpan = this.textSpans[i] || createNS('tspan'); tSpan.textContent = textContent[i]; tSpan.setAttribute('x', 0); tSpan.setAttribute('y', yPos); tSpan.style.display = 'inherit'; tElement.appendChild(tSpan); this.textSpans[i] = tSpan; yPos += documentData.finalLineHeight; } this.layerElement.appendChild(tElement); } else { var cachedSpansLength = this.textSpans.length; var shapeData, charData; for (i = 0; i < len; i += 1) { if(!usesGlyphs || !singleShape || i === 0){ tSpan = cachedSpansLength > i ? this.textSpans[i] : createNS(usesGlyphs?'path':'text'); if (cachedSpansLength <= i) { tSpan.setAttribute('stroke-linecap', 'butt'); tSpan.setAttribute('stroke-linejoin','round'); tSpan.setAttribute('stroke-miterlimit','4'); this.textSpans[i] = tSpan; this.layerElement.appendChild(tSpan); } tSpan.style.display = 'inherit'; } matrixHelper.reset(); matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100); if (singleShape) { if(letters[i].n) { xPos = -trackingOffset; yPos += documentData.yOffset; yPos += firstLine ? 1 : 0; firstLine = false; } this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos); xPos += letters[i].l || 0; //xPos += letters[i].val === ' ' ? 0 : trackingOffset; xPos += trackingOffset; } if(usesGlyphs) { charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily); shapeData = charData && charData.data || {}; shapes = shapeData.shapes ? shapeData.shapes[0].it : []; if(!singleShape){ tSpan.setAttribute('d',this.createPathShape(matrixHelper,shapes)); } else { shapeStr += this.createPathShape(matrixHelper,shapes); } } else { if(singleShape) { tSpan.setAttribute("transform", "translate(" + matrixHelper.props[12] + "," + matrixHelper.props[13] + ")"); } tSpan.textContent = letters[i].val; tSpan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve"); } // } if (singleShape && tSpan) { tSpan.setAttribute('d',shapeStr); } } while (i < this.textSpans.length){ this.textSpans[i].style.display = 'none'; i += 1; } this._sizeChanged = true; }; SVGTextElement.prototype.sourceRectAtTime = function(time){ this.prepareFrame(this.comp.renderedFrame - this.data.st); this.renderInnerContent(); if(this._sizeChanged){ this._sizeChanged = false; var textBox = this.layerElement.getBBox(); this.bbox = { top: textBox.y, left: textBox.x, width: textBox.width, height: textBox.height }; } return this.bbox; }; SVGTextElement.prototype.renderInnerContent = function(){ if(!this.data.singleShape){ this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag); if(this.lettersChangedFlag || this.textAnimator.lettersChangedFlag){ this._sizeChanged = true; var i,len; var renderedLetters = this.textAnimator.renderedLetters; var letters = this.textProperty.currentData.l; len = letters.length; var renderedLetter, textSpan; for(i=0;i 1 && areAnimated) { this.setShapesAsAnimated(tempShapes); } } } SVGShapeElement.prototype.setShapesAsAnimated = function(shapes){ var i, len = shapes.length; for(i = 0; i < len; i += 1) { shapes[i].setAsAnimated(); } } SVGShapeElement.prototype.createStyleElement = function(data, level){ //TODO: prevent drawing of hidden styles var elementData; var styleOb = new SVGStyleData(data, level); var pathElement = styleOb.pElem; if(data.ty === 'st') { elementData = new SVGStrokeStyleData(this, data, styleOb); } else if(data.ty === 'fl') { elementData = new SVGFillStyleData(this, data, styleOb); } else if(data.ty === 'gf' || data.ty === 'gs') { var gradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData; elementData = new gradientConstructor(this, data, styleOb); this.globalData.defs.appendChild(elementData.gf); if (elementData.maskId) { this.globalData.defs.appendChild(elementData.ms); this.globalData.defs.appendChild(elementData.of); pathElement.setAttribute('mask','url(' + locationHref + '#' + elementData.maskId + ')'); } } if(data.ty === 'st' || data.ty === 'gs') { pathElement.setAttribute('stroke-linecap', this.lcEnum[data.lc] || 'round'); pathElement.setAttribute('stroke-linejoin',this.ljEnum[data.lj] || 'round'); pathElement.setAttribute('fill-opacity','0'); if(data.lj === 1) { pathElement.setAttribute('stroke-miterlimit',data.ml); } } if(data.r === 2) { pathElement.setAttribute('fill-rule', 'evenodd'); } if(data.ln){ pathElement.setAttribute('id',data.ln); } if(data.cl){ pathElement.setAttribute('class',data.cl); } if(data.bm){ pathElement.style['mix-blend-mode'] = getBlendMode(data.bm); } this.stylesList.push(styleOb); this.addToAnimatedContents(data, elementData); return elementData; }; SVGShapeElement.prototype.createGroupElement = function(data) { var elementData = new ShapeGroupData(); if(data.ln){ elementData.gr.setAttribute('id',data.ln); } if(data.cl){ elementData.gr.setAttribute('class',data.cl); } if(data.bm){ elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm); } return elementData; }; SVGShapeElement.prototype.createTransformElement = function(data, container) { var transformProperty = TransformPropertyFactory.getTransformProperty(this,data,this); var elementData = new SVGTransformData(transformProperty, transformProperty.o, container); this.addToAnimatedContents(data, elementData); return elementData; }; SVGShapeElement.prototype.createShapeElement = function(data, ownTransformers, level) { var ty = 4; if(data.ty === 'rc'){ ty = 5; }else if(data.ty === 'el'){ ty = 6; }else if(data.ty === 'sr'){ ty = 7; } var shapeProperty = ShapePropertyFactory.getShapeProp(this,data,ty,this); var elementData = new SVGShapeData(ownTransformers, level, shapeProperty); this.shapes.push(elementData); this.addShapeToModifiers(elementData); this.addToAnimatedContents(data, elementData); return elementData; }; SVGShapeElement.prototype.addToAnimatedContents = function(data, element) { var i = 0, len = this.animatedContents.length; while(i < len) { if(this.animatedContents[i].element === element) { return; } i += 1; } this.animatedContents.push({ fn: SVGElementsRenderer.createRenderFunction(data), element: element, data: data }); }; SVGShapeElement.prototype.setElementStyles = function(elementData){ var arr = elementData.styles; var j, jLen = this.stylesList.length; for (j = 0; j < jLen; j += 1) { if (!this.stylesList[j].closed) { arr.push(this.stylesList[j]); } } }; SVGShapeElement.prototype.reloadShapes = function(){ this._isFirstFrame = true; var i, len = this.itemsData.length; for( i = 0; i < len; i += 1) { this.prevViewData[i] = this.itemsData[i]; } this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement, 0, [], true); this.filterUniqueShapes(); len = this.dynamicProperties.length; for(i = 0; i < len; i += 1) { this.dynamicProperties[i].getValue(); } this.renderModifiers(); }; SVGShapeElement.prototype.searchShapes = function(arr,itemsData,prevViewData,container, level, transformers, render){ var ownTransformers = [].concat(transformers); var i, len = arr.length - 1; var j, jLen; var ownStyles = [], ownModifiers = [], styleOb, currentTransform, modifier, processedPos; for(i=len;i>=0;i-=1){ processedPos = this.searchProcessedElement(arr[i]); if(!processedPos){ arr[i]._render = render; } else { itemsData[i] = prevViewData[processedPos - 1]; } if(arr[i].ty == 'fl' || arr[i].ty == 'st' || arr[i].ty == 'gf' || arr[i].ty == 'gs'){ if(!processedPos){ itemsData[i] = this.createStyleElement(arr[i], level); } else { itemsData[i].style.closed = false; } if(arr[i]._render){ container.appendChild(itemsData[i].style.pElem); } ownStyles.push(itemsData[i].style); }else if(arr[i].ty == 'gr'){ if(!processedPos){ itemsData[i] = this.createGroupElement(arr[i]); } else { jLen = itemsData[i].it.length; for(j=0;j horizontal & vertical // 2 -> horizontal only // 3 -> vertical only // var dimensions = this.filterManager.effectElements[1].p.v; var sigmaX = (dimensions == 3) ? 0 : sigma; var sigmaY = (dimensions == 2) ? 0 : sigma; this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + " " + sigmaY); // Repeat edges mapping: // // 0 -> off -> duplicate // 1 -> on -> wrap var edgeMode = (this.filterManager.effectElements[2].p.v == 1) ? 'wrap' : 'duplicate'; this.feGaussianBlur.setAttribute('edgeMode', edgeMode); } } function SVGStrokeEffect(elem, filterManager){ this.initialized = false; this.filterManager = filterManager; this.elem = elem; this.paths = []; } SVGStrokeEffect.prototype.initialize = function(){ var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes; var path,groupPath, i, len; if(this.filterManager.effectElements[1].p.v === 1){ len = this.elem.maskManager.masksProperties.length; i = 0; } else { i = this.filterManager.effectElements[0].p.v - 1; len = i + 1; } groupPath = createNS('g'); groupPath.setAttribute('fill','none'); groupPath.setAttribute('stroke-linecap','round'); groupPath.setAttribute('stroke-dashoffset',1); for(i;i= max){ colorValue = inputDelta < 0 ? outputBlack : outputWhite; } else { colorValue = (outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma)); } table[pos++] = colorValue; cnt += 256/(segments-1); } return table.join(' '); }; SVGProLevelsFilter.prototype.renderFrame = function(forceRender){ if(forceRender || this.filterManager._mdf){ var val, cnt, perc, bezier; var effectElements = this.filterManager.effectElements; if(this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)){ val = this.getTableValue(effectElements[3].p.v,effectElements[4].p.v,effectElements[5].p.v,effectElements[6].p.v,effectElements[7].p.v); this.feFuncRComposed.setAttribute('tableValues',val); this.feFuncGComposed.setAttribute('tableValues',val); this.feFuncBComposed.setAttribute('tableValues',val); } if(this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)){ val = this.getTableValue(effectElements[10].p.v,effectElements[11].p.v,effectElements[12].p.v,effectElements[13].p.v,effectElements[14].p.v); this.feFuncR.setAttribute('tableValues',val); } if(this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)){ val = this.getTableValue(effectElements[17].p.v,effectElements[18].p.v,effectElements[19].p.v,effectElements[20].p.v,effectElements[21].p.v); this.feFuncG.setAttribute('tableValues',val); } if(this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)){ val = this.getTableValue(effectElements[24].p.v,effectElements[25].p.v,effectElements[26].p.v,effectElements[27].p.v,effectElements[28].p.v); this.feFuncB.setAttribute('tableValues',val); } if(this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)){ val = this.getTableValue(effectElements[31].p.v,effectElements[32].p.v,effectElements[33].p.v,effectElements[34].p.v,effectElements[35].p.v); this.feFuncA.setAttribute('tableValues',val); } } }; function SVGDropShadowEffect(filter, filterManager){ filter.setAttribute('x','-100%'); filter.setAttribute('y','-100%'); filter.setAttribute('width','400%'); filter.setAttribute('height','400%'); this.filterManager = filterManager; var feGaussianBlur = createNS('feGaussianBlur'); feGaussianBlur.setAttribute('in','SourceAlpha'); feGaussianBlur.setAttribute('result','drop_shadow_1'); feGaussianBlur.setAttribute('stdDeviation','0'); this.feGaussianBlur = feGaussianBlur; filter.appendChild(feGaussianBlur); var feOffset = createNS('feOffset'); feOffset.setAttribute('dx','25'); feOffset.setAttribute('dy','0'); feOffset.setAttribute('in','drop_shadow_1'); feOffset.setAttribute('result','drop_shadow_2'); this.feOffset = feOffset; filter.appendChild(feOffset); var feFlood = createNS('feFlood'); feFlood.setAttribute('flood-color','#00ff00'); feFlood.setAttribute('flood-opacity','1'); feFlood.setAttribute('result','drop_shadow_3'); this.feFlood = feFlood; filter.appendChild(feFlood); var feComposite = createNS('feComposite'); feComposite.setAttribute('in','drop_shadow_3'); feComposite.setAttribute('in2','drop_shadow_2'); feComposite.setAttribute('operator','in'); feComposite.setAttribute('result','drop_shadow_4'); filter.appendChild(feComposite); var feMerge = createNS('feMerge'); filter.appendChild(feMerge); var feMergeNode; feMergeNode = createNS('feMergeNode'); feMerge.appendChild(feMergeNode); feMergeNode = createNS('feMergeNode'); feMergeNode.setAttribute('in','SourceGraphic'); this.feMergeNode = feMergeNode; this.feMerge = feMerge; this.originalNodeAdded = false; feMerge.appendChild(feMergeNode); } SVGDropShadowEffect.prototype.renderFrame = function(forceRender){ if(forceRender || this.filterManager._mdf){ if(forceRender || this.filterManager.effectElements[4].p._mdf){ this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4); } if(forceRender || this.filterManager.effectElements[0].p._mdf){ var col = this.filterManager.effectElements[0].p.v; this.feFlood.setAttribute('flood-color',rgbToHex(Math.round(col[0]*255),Math.round(col[1]*255),Math.round(col[2]*255))); } if(forceRender || this.filterManager.effectElements[1].p._mdf){ this.feFlood.setAttribute('flood-opacity',this.filterManager.effectElements[1].p.v/255); } if(forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf){ var distance = this.filterManager.effectElements[3].p.v; var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads; var x = distance * Math.cos(angle); var y = distance * Math.sin(angle); this.feOffset.setAttribute('dx', x); this.feOffset.setAttribute('dy', y); } /*if(forceRender || this.filterManager.effectElements[5].p._mdf){ if(this.filterManager.effectElements[5].p.v === 1 && this.originalNodeAdded) { this.feMerge.removeChild(this.feMergeNode); this.originalNodeAdded = false; } else if(this.filterManager.effectElements[5].p.v === 0 && !this.originalNodeAdded) { this.feMerge.appendChild(this.feMergeNode); this.originalNodeAdded = true; } }*/ } }; var _svgMatteSymbols = []; function SVGMatte3Effect(filterElem, filterManager, elem){ this.initialized = false; this.filterManager = filterManager; this.filterElem = filterElem; this.elem = elem; elem.matteElement = createNS('g'); elem.matteElement.appendChild(elem.layerElement); elem.matteElement.appendChild(elem.transformedElement); elem.baseElement = elem.matteElement; } SVGMatte3Effect.prototype.findSymbol = function(mask) { var i = 0, len = _svgMatteSymbols.length; while(i < len) { if(_svgMatteSymbols[i] === mask) { return _svgMatteSymbols[i]; } i += 1; } return null; }; SVGMatte3Effect.prototype.replaceInParent = function(mask, symbolId) { var parentNode = mask.layerElement.parentNode; if(!parentNode) { return; } var children = parentNode.children; var i = 0, len = children.length; while (i < len) { if (children[i] === mask.layerElement) { break; } i += 1; } var nextChild; if (i <= len - 2) { nextChild = children[i + 1]; } var useElem = createNS('use'); useElem.setAttribute('href', '#' + symbolId); if(nextChild) { parentNode.insertBefore(useElem, nextChild); } else { parentNode.appendChild(useElem); } }; SVGMatte3Effect.prototype.setElementAsMask = function(elem, mask) { if(!this.findSymbol(mask)) { var symbolId = createElementID(); var masker = createNS('mask'); masker.setAttribute('id', mask.layerId); masker.setAttribute('mask-type', 'alpha'); _svgMatteSymbols.push(mask); var defs = elem.globalData.defs; defs.appendChild(masker); var symbol = createNS('symbol'); symbol.setAttribute('id', symbolId); this.replaceInParent(mask, symbolId); symbol.appendChild(mask.layerElement); defs.appendChild(symbol); var useElem = createNS('use'); useElem.setAttribute('href', '#' + symbolId); masker.appendChild(useElem); mask.data.hd = false; mask.show(); } elem.setMatte(mask.layerId); }; SVGMatte3Effect.prototype.initialize = function() { var ind = this.filterManager.effectElements[0].p.v; var elements = this.elem.comp.elements; var i = 0, len = elements.length; while (i < len) { if (elements[i] && elements[i].data.ind === ind) { this.setElementAsMask(this.elem, elements[i]); } i += 1; } this.initialized = true; }; SVGMatte3Effect.prototype.renderFrame = function() { if(!this.initialized) { this.initialize(); } }; function SVGEffects(elem){ var i, len = elem.data.ef ? elem.data.ef.length : 0; var filId = createElementID(); var fil = filtersFactory.createFilter(filId); var count = 0; this.filters = []; var filterManager; for(i=0;i canvasRel && par === 'xMidYMid slice') || (imgRel < canvasRel && par !== 'xMidYMid slice')) { heightCrop = imgH; widthCrop = heightCrop*canvasRel; } else { widthCrop = imgW; heightCrop = widthCrop/canvasRel; } ctx.drawImage(this.img,(imgW-widthCrop)/2,(imgH-heightCrop)/2,widthCrop,heightCrop,0,0,this.assetData.w,this.assetData.h); this.img = canvas; } }; CVImageElement.prototype.renderInnerContent = function(parentMatrix){ this.canvasContext.drawImage(this.img, 0, 0); }; CVImageElement.prototype.destroy = function(){ this.img = null; }; function CVCompElement(data, globalData, comp) { this.completeLayers = false; this.layers = data.layers; this.pendingElements = []; this.elements = createSizedArray(this.layers.length); this.initElement(data, globalData, comp); this.tm = data.tm ? PropertyFactory.getProp(this,data.tm,0,globalData.frameRate, this) : {_placeholder:true}; } extendPrototype([CanvasRenderer, ICompElement, CVBaseElement], CVCompElement); CVCompElement.prototype.renderInnerContent = function() { var ctx = this.canvasContext; ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(this.data.w, 0); ctx.lineTo(this.data.w, this.data.h); ctx.lineTo(0, this.data.h); ctx.lineTo(0, 0); ctx.clip(); var i,len = this.layers.length; for( i = len - 1; i >= 0; i -= 1 ){ if(this.completeLayers || this.elements[i]){ this.elements[i].renderFrame(); } } }; CVCompElement.prototype.destroy = function(){ var i,len = this.layers.length; for( i = len - 1; i >= 0; i -= 1 ){ if(this.elements[i]) { this.elements[i].destroy(); } } this.layers = null; this.elements = null; }; function CVMaskElement(data,element){ this.data = data; this.element = element; this.masksProperties = this.data.masksProperties || []; this.viewData = createSizedArray(this.masksProperties.length); var i, len = this.masksProperties.length, hasMasks = false; for (i = 0; i < len; i++) { if(this.masksProperties[i].mode !== 'n'){ hasMasks = true; } this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[i],3); } this.hasMasks = hasMasks; if(hasMasks) { this.element.addRenderableComponent(this); } } CVMaskElement.prototype.renderFrame = function () { if(!this.hasMasks){ return; } var transform = this.element.finalTransform.mat; var ctx = this.element.canvasContext; var i, len = this.masksProperties.length; var pt,pts,data; ctx.beginPath(); for (i = 0; i < len; i++) { if(this.masksProperties[i].mode !== 'n'){ if (this.masksProperties[i].inv) { ctx.moveTo(0, 0); ctx.lineTo(this.element.globalData.compSize.w, 0); ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h); ctx.lineTo(0, this.element.globalData.compSize.h); ctx.lineTo(0, 0); } data = this.viewData[i].v; pt = transform.applyToPointArray(data.v[0][0],data.v[0][1],0); ctx.moveTo(pt[0], pt[1]); var j, jLen = data._length; for (j = 1; j < jLen; j++) { pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]); ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); } pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]); ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); } } this.element.globalData.renderer.save(true); ctx.clip(); }; CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty; CVMaskElement.prototype.destroy = function(){ this.element = null; }; function CVShapeElement(data, globalData, comp) { this.shapes = []; this.shapesData = data.shapes; this.stylesList = []; this.itemsData = []; this.prevViewData = []; this.shapeModifiers = []; this.processedElements = []; this.transformsManager = new ShapeTransformManager(); this.initElement(data, globalData, comp); } extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement], CVShapeElement); CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement; CVShapeElement.prototype.transformHelper = {opacity:1,_opMdf:false}; CVShapeElement.prototype.dashResetter = []; CVShapeElement.prototype.createContent = function(){ this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []); }; CVShapeElement.prototype.createStyleElement = function(data, transforms) { var styleElem = { data: data, type: data.ty, preTransforms: this.transformsManager.addTransformSequence(transforms), transforms: [], elements: [], closed: data.hd === true }; var elementData = {}; if(data.ty == 'fl' || data.ty == 'st'){ elementData.c = PropertyFactory.getProp(this,data.c,1,255,this); if(!elementData.c.k){ styleElem.co = 'rgb('+bm_floor(elementData.c.v[0])+','+bm_floor(elementData.c.v[1])+','+bm_floor(elementData.c.v[2])+')'; } } else if (data.ty === 'gf' || data.ty === 'gs') { elementData.s = PropertyFactory.getProp(this,data.s,1,null,this); elementData.e = PropertyFactory.getProp(this,data.e,1,null,this); elementData.h = PropertyFactory.getProp(this,data.h||{k:0},0,0.01,this); elementData.a = PropertyFactory.getProp(this,data.a||{k:0},0,degToRads,this); elementData.g = new GradientProperty(this,data.g,this); } elementData.o = PropertyFactory.getProp(this,data.o,0,0.01,this); if(data.ty == 'st' || data.ty == 'gs') { styleElem.lc = this.lcEnum[data.lc] || 'round'; styleElem.lj = this.ljEnum[data.lj] || 'round'; if(data.lj == 1) { styleElem.ml = data.ml; } elementData.w = PropertyFactory.getProp(this,data.w,0,null,this); if(!elementData.w.k){ styleElem.wi = elementData.w.v; } if(data.d){ var d = new DashProperty(this,data.d,'canvas', this); elementData.d = d; if(!elementData.d.k){ styleElem.da = elementData.d.dashArray; styleElem.do = elementData.d.dashoffset[0]; } } } else { styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero'; } this.stylesList.push(styleElem); elementData.style = styleElem; return elementData; }; CVShapeElement.prototype.createGroupElement = function(data) { var elementData = { it: [], prevViewData: [] }; return elementData; }; CVShapeElement.prototype.createTransformElement = function(data) { var elementData = { transform : { opacity: 1, _opMdf:false, key: this.transformsManager.getNewKey(), op: PropertyFactory.getProp(this,data.o,0,0.01,this), mProps: TransformPropertyFactory.getTransformProperty(this,data,this) } }; return elementData; }; CVShapeElement.prototype.createShapeElement = function(data) { var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager); this.shapes.push(elementData); this.addShapeToModifiers(elementData); return elementData; }; CVShapeElement.prototype.reloadShapes = function() { this._isFirstFrame = true; var i, len = this.itemsData.length; for (i = 0; i < len; i += 1) { this.prevViewData[i] = this.itemsData[i]; } this.searchShapes(this.shapesData,this.itemsData,this.prevViewData, true, []); len = this.dynamicProperties.length; for (i = 0; i < len; i += 1) { this.dynamicProperties[i].getValue(); } this.renderModifiers(); this.transformsManager.processSequences(this._isFirstFrame); }; CVShapeElement.prototype.addTransformToStyleList = function(transform) { var i, len = this.stylesList.length; for (i = 0; i < len; i += 1) { if(!this.stylesList[i].closed) { this.stylesList[i].transforms.push(transform); } } } CVShapeElement.prototype.removeTransformFromStyleList = function() { var i, len = this.stylesList.length; for (i = 0; i < len; i += 1) { if(!this.stylesList[i].closed) { this.stylesList[i].transforms.pop(); } } } CVShapeElement.prototype.closeStyles = function(styles) { var i, len = styles.length, j, jLen; for (i = 0; i < len; i += 1) { styles[i].closed = true; } } CVShapeElement.prototype.searchShapes = function(arr,itemsData, prevViewData, shouldRender, transforms){ var i, len = arr.length - 1; var j, jLen; var ownStyles = [], ownModifiers = [], processedPos, modifier, currentTransform; var ownTransforms = [].concat(transforms); for(i=len;i>=0;i-=1){ processedPos = this.searchProcessedElement(arr[i]); if(!processedPos){ arr[i]._shouldRender = shouldRender; } else { itemsData[i] = prevViewData[processedPos - 1]; } if(arr[i].ty == 'fl' || arr[i].ty == 'st'|| arr[i].ty == 'gf'|| arr[i].ty == 'gs'){ if(!processedPos){ itemsData[i] = this.createStyleElement(arr[i], ownTransforms); } else { itemsData[i].style.closed = false; } ownStyles.push(itemsData[i].style); }else if(arr[i].ty == 'gr'){ if(!processedPos){ itemsData[i] = this.createGroupElement(arr[i]); } else { jLen = itemsData[i].it.length; for(j=0;j=0;i-=1){ if(items[i].ty == 'tr'){ groupTransform = data[i].transform; this.renderShapeTransform(parentTransform, groupTransform); }else if(items[i].ty == 'sh' || items[i].ty == 'el' || items[i].ty == 'rc' || items[i].ty == 'sr'){ this.renderPath(items[i],data[i]); }else if(items[i].ty == 'fl'){ this.renderFill(items[i],data[i],groupTransform); }else if(items[i].ty == 'st'){ this.renderStroke(items[i],data[i],groupTransform); }else if(items[i].ty == 'gf' || items[i].ty == 'gs'){ this.renderGradientFill(items[i],data[i],groupTransform); }else if(items[i].ty == 'gr'){ this.renderShape(groupTransform,items[i].it,data[i].it); }else if(items[i].ty == 'tm'){ // } } if(isMain){ this.drawLayer(); } }; CVShapeElement.prototype.renderStyledShape = function(styledShape, shape){ if(this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) { var shapeNodes = styledShape.trNodes; var paths = shape.paths; var i, len, j, jLen = paths._length; shapeNodes.length = 0; var groupTransformMat = styledShape.transforms.finalTransform; for (j = 0; j < jLen; j += 1) { var pathNodes = paths.shapes[j]; if(pathNodes && pathNodes.v){ len = pathNodes._length; for (i = 1; i < len; i += 1) { if (i === 1) { shapeNodes.push({ t: 'm', p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0) }); } shapeNodes.push({ t: 'c', pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i]) }); } if (len === 1) { shapeNodes.push({ t: 'm', p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0) }); } if (pathNodes.c && len) { shapeNodes.push({ t: 'c', pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0]) }); shapeNodes.push({ t: 'z' }); } } } styledShape.trNodes = shapeNodes; } } CVShapeElement.prototype.renderPath = function(pathData,itemData){ if(pathData.hd !== true && pathData._shouldRender) { var i, len = itemData.styledShapes.length; for (i = 0; i < len; i += 1) { this.renderStyledShape(itemData.styledShapes[i], itemData.sh); } } }; CVShapeElement.prototype.renderFill = function(styleData,itemData, groupTransform){ var styleElem = itemData.style; if (itemData.c._mdf || this._isFirstFrame) { styleElem.co = 'rgb(' + bm_floor(itemData.c.v[0]) + ',' + bm_floor(itemData.c.v[1]) + ',' + bm_floor(itemData.c.v[2]) + ')'; } if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) { styleElem.coOp = itemData.o.v * groupTransform.opacity; } }; CVShapeElement.prototype.renderGradientFill = function(styleData,itemData, groupTransform){ var styleElem = itemData.style; if(!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || (styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf))) { var ctx = this.globalData.canvasContext; var grd; var pt1 = itemData.s.v, pt2 = itemData.e.v; if (styleData.t === 1) { grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]); } else { var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2)); var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]); var percent = itemData.h.v >= 1 ? 0.99 : itemData.h.v <= -1 ? -0.99: itemData.h.v; var dist = rad * percent; var x = Math.cos(ang + itemData.a.v) * dist + pt1[0]; var y = Math.sin(ang + itemData.a.v) * dist + pt1[1]; var grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad); } var i, len = styleData.g.p; var cValues = itemData.g.c; var opacity = 1; for (i = 0; i < len; i += 1){ if(itemData.g._hasOpacity && itemData.g._collapsable) { opacity = itemData.g.o[i*2 + 1]; } grd.addColorStop(cValues[i * 4] / 100,'rgba('+ cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ','+cValues[i * 4 + 3] + ',' + opacity + ')'); } styleElem.grd = grd; } styleElem.coOp = itemData.o.v*groupTransform.opacity; }; CVShapeElement.prototype.renderStroke = function(styleData,itemData, groupTransform){ var styleElem = itemData.style; var d = itemData.d; if(d && (d._mdf || this._isFirstFrame)){ styleElem.da = d.dashArray; styleElem.do = d.dashoffset[0]; } if(itemData.c._mdf || this._isFirstFrame){ styleElem.co = 'rgb('+bm_floor(itemData.c.v[0])+','+bm_floor(itemData.c.v[1])+','+bm_floor(itemData.c.v[2])+')'; } if(itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame){ styleElem.coOp = itemData.o.v*groupTransform.opacity; } if(itemData.w._mdf || this._isFirstFrame){ styleElem.wi = itemData.w.v; } }; CVShapeElement.prototype.destroy = function(){ this.shapesData = null; this.globalData = null; this.canvasContext = null; this.stylesList.length = 0; this.itemsData.length = 0; }; function CVSolidElement(data, globalData, comp) { this.initElement(data,globalData,comp); } extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement); CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement; CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame; CVSolidElement.prototype.renderInnerContent = function() { var ctx = this.canvasContext; ctx.fillStyle = this.data.sc; ctx.fillRect(0, 0, this.data.sw, this.data.sh); // }; function CVTextElement(data, globalData, comp){ this.textSpans = []; this.yOffset = 0; this.fillColorAnim = false; this.strokeColorAnim = false; this.strokeWidthAnim = false; this.stroke = false; this.fill = false; this.justifyOffset = 0; this.currentRender = null; this.renderType = 'canvas'; this.values = { fill: 'rgba(0,0,0,0)', stroke: 'rgba(0,0,0,0)', sWidth: 0, fValue: '' }; this.initElement(data,globalData,comp); } extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement], CVTextElement); CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d'); CVTextElement.prototype.buildNewText = function(){ var documentData = this.textProperty.currentData; this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0); var hasFill = false; if(documentData.fc) { hasFill = true; this.values.fill = this.buildColor(documentData.fc); }else{ this.values.fill = 'rgba(0,0,0,0)'; } this.fill = hasFill; var hasStroke = false; if(documentData.sc){ hasStroke = true; this.values.stroke = this.buildColor(documentData.sc); this.values.sWidth = documentData.sw; } var fontData = this.globalData.fontManager.getFontByName(documentData.f); var i, len; var letters = documentData.l; var matrixHelper = this.mHelper; this.stroke = hasStroke; this.values.fValue = documentData.finalSize + 'px '+ this.globalData.fontManager.getFontByName(documentData.f).fFamily; len = documentData.finalText.length; //this.tHelper.font = this.values.fValue; var charData, shapeData, k, kLen, shapes, j, jLen, pathNodes, commands, pathArr, singleShape = this.data.singleShape; var trackingOffset = documentData.tr/1000*documentData.finalSize; var xPos = 0, yPos = 0, firstLine = true; var cnt = 0; for (i = 0; i < len; i += 1) { charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily); shapeData = charData && charData.data || {}; matrixHelper.reset(); if(singleShape && letters[i].n) { xPos = -trackingOffset; yPos += documentData.yOffset; yPos += firstLine ? 1 : 0; firstLine = false; } shapes = shapeData.shapes ? shapeData.shapes[0].it : []; jLen = shapes.length; matrixHelper.scale(documentData.finalSize/100,documentData.finalSize/100); if(singleShape){ this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos); } commands = createSizedArray(jLen); for(j=0;j