dev-kitty 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../node_modules/matter-js/build/matter.js","../src/index.ts","../src/core/environment.ts","../src/core/overlay.ts","../src/pets/basePet.ts","../src/pets/kitty/sprite.ts","../src/pets/kitty/ai.ts","../src/core/physics.ts","../src/pets/kitty/ball.ts","../src/pets/kitty/poop.ts","../src/pets/kitty/footsteps.ts","../node_modules/gsap/gsap-core.js","../node_modules/gsap/CSSPlugin.js","../node_modules/gsap/index.js","../src/pets/kitty/kitty.ts","../src/core/injector.ts","../src/plugins/vite.ts"],"sourcesContent":["/*!\n * matter-js 0.20.0 by @liabru\n * http://brm.io/matter-js/\n * License MIT\n * \n * The MIT License (MIT)\n * \n * Copyright (c) Liam Brummitt and contributors.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Matter\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Matter\"] = factory();\n\telse\n\t\troot[\"Matter\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 20);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\n/**\n* The `Matter.Common` module contains utility functions that are common to all modules.\n*\n* @class Common\n*/\n\nvar Common = {};\n\nmodule.exports = Common;\n\n(function() {\n\n Common._baseDelta = 1000 / 60;\n Common._nextId = 0;\n Common._seed = 0;\n Common._nowStartTime = +(new Date());\n Common._warnedOnce = {};\n Common._decomp = null;\n \n /**\n * Extends the object in the first argument using the object in the second argument.\n * @method extend\n * @param {} obj\n * @param {boolean} deep\n * @return {} obj extended\n */\n Common.extend = function(obj, deep) {\n var argsStart,\n args,\n deepClone;\n\n if (typeof deep === 'boolean') {\n argsStart = 2;\n deepClone = deep;\n } else {\n argsStart = 1;\n deepClone = true;\n }\n\n for (var i = argsStart; i < arguments.length; i++) {\n var source = arguments[i];\n\n if (source) {\n for (var prop in source) {\n if (deepClone && source[prop] && source[prop].constructor === Object) {\n if (!obj[prop] || obj[prop].constructor === Object) {\n obj[prop] = obj[prop] || {};\n Common.extend(obj[prop], deepClone, source[prop]);\n } else {\n obj[prop] = source[prop];\n }\n } else {\n obj[prop] = source[prop];\n }\n }\n }\n }\n \n return obj;\n };\n\n /**\n * Creates a new clone of the object, if deep is true references will also be cloned.\n * @method clone\n * @param {} obj\n * @param {bool} deep\n * @return {} obj cloned\n */\n Common.clone = function(obj, deep) {\n return Common.extend({}, deep, obj);\n };\n\n /**\n * Returns the list of keys for the given object.\n * @method keys\n * @param {} obj\n * @return {string[]} keys\n */\n Common.keys = function(obj) {\n if (Object.keys)\n return Object.keys(obj);\n\n // avoid hasOwnProperty for performance\n var keys = [];\n for (var key in obj)\n keys.push(key);\n return keys;\n };\n\n /**\n * Returns the list of values for the given object.\n * @method values\n * @param {} obj\n * @return {array} Array of the objects property values\n */\n Common.values = function(obj) {\n var values = [];\n \n if (Object.keys) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n return values;\n }\n \n // avoid hasOwnProperty for performance\n for (var key in obj)\n values.push(obj[key]);\n return values;\n };\n\n /**\n * Gets a value from `base` relative to the `path` string.\n * @method get\n * @param {} obj The base object\n * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz'\n * @param {number} [begin] Path slice begin\n * @param {number} [end] Path slice end\n * @return {} The object at the given path\n */\n Common.get = function(obj, path, begin, end) {\n path = path.split('.').slice(begin, end);\n\n for (var i = 0; i < path.length; i += 1) {\n obj = obj[path[i]];\n }\n\n return obj;\n };\n\n /**\n * Sets a value on `base` relative to the given `path` string.\n * @method set\n * @param {} obj The base object\n * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz'\n * @param {} val The value to set\n * @param {number} [begin] Path slice begin\n * @param {number} [end] Path slice end\n * @return {} Pass through `val` for chaining\n */\n Common.set = function(obj, path, val, begin, end) {\n var parts = path.split('.').slice(begin, end);\n Common.get(obj, path, 0, -1)[parts[parts.length - 1]] = val;\n return val;\n };\n\n /**\n * Shuffles the given array in-place.\n * The function uses a seeded random generator.\n * @method shuffle\n * @param {array} array\n * @return {array} array shuffled randomly\n */\n Common.shuffle = function(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Common.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n };\n\n /**\n * Randomly chooses a value from a list with equal probability.\n * The function uses a seeded random generator.\n * @method choose\n * @param {array} choices\n * @return {object} A random choice object from the array\n */\n Common.choose = function(choices) {\n return choices[Math.floor(Common.random() * choices.length)];\n };\n\n /**\n * Returns true if the object is a HTMLElement, otherwise false.\n * @method isElement\n * @param {object} obj\n * @return {boolean} True if the object is a HTMLElement, otherwise false\n */\n Common.isElement = function(obj) {\n if (typeof HTMLElement !== 'undefined') {\n return obj instanceof HTMLElement;\n }\n\n return !!(obj && obj.nodeType && obj.nodeName);\n };\n\n /**\n * Returns true if the object is an array.\n * @method isArray\n * @param {object} obj\n * @return {boolean} True if the object is an array, otherwise false\n */\n Common.isArray = function(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n\n /**\n * Returns true if the object is a function.\n * @method isFunction\n * @param {object} obj\n * @return {boolean} True if the object is a function, otherwise false\n */\n Common.isFunction = function(obj) {\n return typeof obj === \"function\";\n };\n\n /**\n * Returns true if the object is a plain object.\n * @method isPlainObject\n * @param {object} obj\n * @return {boolean} True if the object is a plain object, otherwise false\n */\n Common.isPlainObject = function(obj) {\n return typeof obj === 'object' && obj.constructor === Object;\n };\n\n /**\n * Returns true if the object is a string.\n * @method isString\n * @param {object} obj\n * @return {boolean} True if the object is a string, otherwise false\n */\n Common.isString = function(obj) {\n return toString.call(obj) === '[object String]';\n };\n \n /**\n * Returns the given value clamped between a minimum and maximum value.\n * @method clamp\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {number} The value clamped between min and max inclusive\n */\n Common.clamp = function(value, min, max) {\n if (value < min)\n return min;\n if (value > max)\n return max;\n return value;\n };\n \n /**\n * Returns the sign of the given value.\n * @method sign\n * @param {number} value\n * @return {number} -1 if negative, +1 if 0 or positive\n */\n Common.sign = function(value) {\n return value < 0 ? -1 : 1;\n };\n \n /**\n * Returns the current timestamp since the time origin (e.g. from page load).\n * The result is in milliseconds and will use high-resolution timing if available.\n * @method now\n * @return {number} the current timestamp in milliseconds\n */\n Common.now = function() {\n if (typeof window !== 'undefined' && window.performance) {\n if (window.performance.now) {\n return window.performance.now();\n } else if (window.performance.webkitNow) {\n return window.performance.webkitNow();\n }\n }\n\n if (Date.now) {\n return Date.now();\n }\n\n return (new Date()) - Common._nowStartTime;\n };\n \n /**\n * Returns a random value between a minimum and a maximum value inclusive.\n * The function uses a seeded random generator.\n * @method random\n * @param {number} min\n * @param {number} max\n * @return {number} A random number between min and max inclusive\n */\n Common.random = function(min, max) {\n min = (typeof min !== \"undefined\") ? min : 0;\n max = (typeof max !== \"undefined\") ? max : 1;\n return min + _seededRandom() * (max - min);\n };\n\n var _seededRandom = function() {\n // https://en.wikipedia.org/wiki/Linear_congruential_generator\n Common._seed = (Common._seed * 9301 + 49297) % 233280;\n return Common._seed / 233280;\n };\n\n /**\n * Converts a CSS hex colour string into an integer.\n * @method colorToNumber\n * @param {string} colorString\n * @return {number} An integer representing the CSS hex string\n */\n Common.colorToNumber = function(colorString) {\n colorString = colorString.replace('#','');\n\n if (colorString.length == 3) {\n colorString = colorString.charAt(0) + colorString.charAt(0)\n + colorString.charAt(1) + colorString.charAt(1)\n + colorString.charAt(2) + colorString.charAt(2);\n }\n\n return parseInt(colorString, 16);\n };\n\n /**\n * The console logging level to use, where each level includes all levels above and excludes the levels below.\n * The default level is 'debug' which shows all console messages. \n *\n * Possible level values are:\n * - 0 = None\n * - 1 = Debug\n * - 2 = Info\n * - 3 = Warn\n * - 4 = Error\n * @static\n * @property logLevel\n * @type {Number}\n * @default 1\n */\n Common.logLevel = 1;\n\n /**\n * Shows a `console.log` message only if the current `Common.logLevel` allows it.\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\n * @method log\n * @param ...objs {} The objects to log.\n */\n Common.log = function() {\n if (console && Common.logLevel > 0 && Common.logLevel <= 3) {\n console.log.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\n }\n };\n\n /**\n * Shows a `console.info` message only if the current `Common.logLevel` allows it.\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\n * @method info\n * @param ...objs {} The objects to log.\n */\n Common.info = function() {\n if (console && Common.logLevel > 0 && Common.logLevel <= 2) {\n console.info.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\n }\n };\n\n /**\n * Shows a `console.warn` message only if the current `Common.logLevel` allows it.\n * The message will be prefixed with 'matter-js' to make it easily identifiable.\n * @method warn\n * @param ...objs {} The objects to log.\n */\n Common.warn = function() {\n if (console && Common.logLevel > 0 && Common.logLevel <= 3) {\n console.warn.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments)));\n }\n };\n\n /**\n * Uses `Common.warn` to log the given message one time only.\n * @method warnOnce\n * @param ...objs {} The objects to log.\n */\n Common.warnOnce = function() {\n var message = Array.prototype.slice.call(arguments).join(' ');\n\n if (!Common._warnedOnce[message]) {\n Common.warn(message);\n Common._warnedOnce[message] = true;\n }\n };\n\n /**\n * Shows a deprecated console warning when the function on the given object is called.\n * The target function will be replaced with a new function that first shows the warning\n * and then calls the original function.\n * @method deprecated\n * @param {object} obj The object or module\n * @param {string} name The property name of the function on obj\n * @param {string} warning The one-time message to show if the function is called\n */\n Common.deprecated = function(obj, prop, warning) {\n obj[prop] = Common.chain(function() {\n Common.warnOnce('🔅 deprecated 🔅', warning);\n }, obj[prop]);\n };\n\n /**\n * Returns the next unique sequential ID.\n * @method nextId\n * @return {Number} Unique sequential ID\n */\n Common.nextId = function() {\n return Common._nextId++;\n };\n\n /**\n * A cross browser compatible indexOf implementation.\n * @method indexOf\n * @param {array} haystack\n * @param {object} needle\n * @return {number} The position of needle in haystack, otherwise -1.\n */\n Common.indexOf = function(haystack, needle) {\n if (haystack.indexOf)\n return haystack.indexOf(needle);\n\n for (var i = 0; i < haystack.length; i++) {\n if (haystack[i] === needle)\n return i;\n }\n\n return -1;\n };\n\n /**\n * A cross browser compatible array map implementation.\n * @method map\n * @param {array} list\n * @param {function} func\n * @return {array} Values from list transformed by func.\n */\n Common.map = function(list, func) {\n if (list.map) {\n return list.map(func);\n }\n\n var mapped = [];\n\n for (var i = 0; i < list.length; i += 1) {\n mapped.push(func(list[i]));\n }\n\n return mapped;\n };\n\n /**\n * Takes a directed graph and returns the partially ordered set of vertices in topological order.\n * Circular dependencies are allowed.\n * @method topologicalSort\n * @param {object} graph\n * @return {array} Partially ordered set of vertices in topological order.\n */\n Common.topologicalSort = function(graph) {\n // https://github.com/mgechev/javascript-algorithms\n // Copyright (c) Minko Gechev (MIT license)\n // Modifications: tidy formatting and naming\n var result = [],\n visited = [],\n temp = [];\n\n for (var node in graph) {\n if (!visited[node] && !temp[node]) {\n Common._topologicalSort(node, visited, temp, graph, result);\n }\n }\n\n return result;\n };\n\n Common._topologicalSort = function(node, visited, temp, graph, result) {\n var neighbors = graph[node] || [];\n temp[node] = true;\n\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = neighbors[i];\n\n if (temp[neighbor]) {\n // skip circular dependencies\n continue;\n }\n\n if (!visited[neighbor]) {\n Common._topologicalSort(neighbor, visited, temp, graph, result);\n }\n }\n\n temp[node] = false;\n visited[node] = true;\n\n result.push(node);\n };\n\n /**\n * Takes _n_ functions as arguments and returns a new function that calls them in order.\n * The arguments applied when calling the new function will also be applied to every function passed.\n * The value of `this` refers to the last value returned in the chain that was not `undefined`.\n * Therefore if a passed function does not return a value, the previously returned value is maintained.\n * After all passed functions have been called the new function returns the last returned value (if any).\n * If any of the passed functions are a chain, then the chain will be flattened.\n * @method chain\n * @param ...funcs {function} The functions to chain.\n * @return {function} A new function that calls the passed functions in order.\n */\n Common.chain = function() {\n var funcs = [];\n\n for (var i = 0; i < arguments.length; i += 1) {\n var func = arguments[i];\n\n if (func._chained) {\n // flatten already chained functions\n funcs.push.apply(funcs, func._chained);\n } else {\n funcs.push(func);\n }\n }\n\n var chain = function() {\n // https://github.com/GoogleChrome/devtools-docs/issues/53#issuecomment-51941358\n var lastResult,\n args = new Array(arguments.length);\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n args[i] = arguments[i];\n }\n\n for (i = 0; i < funcs.length; i += 1) {\n var result = funcs[i].apply(lastResult, args);\n\n if (typeof result !== 'undefined') {\n lastResult = result;\n }\n }\n\n return lastResult;\n };\n\n chain._chained = funcs;\n\n return chain;\n };\n\n /**\n * Chains a function to excute before the original function on the given `path` relative to `base`.\n * See also docs for `Common.chain`.\n * @method chainPathBefore\n * @param {} base The base object\n * @param {string} path The path relative to `base`\n * @param {function} func The function to chain before the original\n * @return {function} The chained function that replaced the original\n */\n Common.chainPathBefore = function(base, path, func) {\n return Common.set(base, path, Common.chain(\n func,\n Common.get(base, path)\n ));\n };\n\n /**\n * Chains a function to excute after the original function on the given `path` relative to `base`.\n * See also docs for `Common.chain`.\n * @method chainPathAfter\n * @param {} base The base object\n * @param {string} path The path relative to `base`\n * @param {function} func The function to chain after the original\n * @return {function} The chained function that replaced the original\n */\n Common.chainPathAfter = function(base, path, func) {\n return Common.set(base, path, Common.chain(\n Common.get(base, path),\n func\n ));\n };\n\n /**\n * Provide the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module to enable\n * concave vertex decomposition support when using `Bodies.fromVertices` e.g. `Common.setDecomp(require('poly-decomp'))`.\n * @method setDecomp\n * @param {} decomp The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module.\n */\n Common.setDecomp = function(decomp) {\n Common._decomp = decomp;\n };\n\n /**\n * Returns the [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module provided through `Common.setDecomp`,\n * otherwise returns the global `decomp` if set.\n * @method getDecomp\n * @return {} The [poly-decomp](https://github.com/schteppe/poly-decomp.js) library module if provided.\n */\n Common.getDecomp = function() {\n // get user provided decomp if set\n var decomp = Common._decomp;\n\n try {\n // otherwise from window global\n if (!decomp && typeof window !== 'undefined') {\n decomp = window.decomp;\n }\n \n // otherwise from node global\n if (!decomp && typeof global !== 'undefined') {\n decomp = global.decomp;\n }\n } catch (e) {\n // decomp not available\n decomp = null;\n }\n\n return decomp;\n };\n})();\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n/**\n* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB).\n*\n* @class Bounds\n*/\n\nvar Bounds = {};\n\nmodule.exports = Bounds;\n\n(function() {\n\n /**\n * Creates a new axis-aligned bounding box (AABB) for the given vertices.\n * @method create\n * @param {vertices} vertices\n * @return {bounds} A new bounds object\n */\n Bounds.create = function(vertices) {\n var bounds = { \n min: { x: 0, y: 0 }, \n max: { x: 0, y: 0 }\n };\n\n if (vertices)\n Bounds.update(bounds, vertices);\n \n return bounds;\n };\n\n /**\n * Updates bounds using the given vertices and extends the bounds given a velocity.\n * @method update\n * @param {bounds} bounds\n * @param {vertices} vertices\n * @param {vector} velocity\n */\n Bounds.update = function(bounds, vertices, velocity) {\n bounds.min.x = Infinity;\n bounds.max.x = -Infinity;\n bounds.min.y = Infinity;\n bounds.max.y = -Infinity;\n\n for (var i = 0; i < vertices.length; i++) {\n var vertex = vertices[i];\n if (vertex.x > bounds.max.x) bounds.max.x = vertex.x;\n if (vertex.x < bounds.min.x) bounds.min.x = vertex.x;\n if (vertex.y > bounds.max.y) bounds.max.y = vertex.y;\n if (vertex.y < bounds.min.y) bounds.min.y = vertex.y;\n }\n \n if (velocity) {\n if (velocity.x > 0) {\n bounds.max.x += velocity.x;\n } else {\n bounds.min.x += velocity.x;\n }\n \n if (velocity.y > 0) {\n bounds.max.y += velocity.y;\n } else {\n bounds.min.y += velocity.y;\n }\n }\n };\n\n /**\n * Returns true if the bounds contains the given point.\n * @method contains\n * @param {bounds} bounds\n * @param {vector} point\n * @return {boolean} True if the bounds contain the point, otherwise false\n */\n Bounds.contains = function(bounds, point) {\n return point.x >= bounds.min.x && point.x <= bounds.max.x \n && point.y >= bounds.min.y && point.y <= bounds.max.y;\n };\n\n /**\n * Returns true if the two bounds intersect.\n * @method overlaps\n * @param {bounds} boundsA\n * @param {bounds} boundsB\n * @return {boolean} True if the bounds overlap, otherwise false\n */\n Bounds.overlaps = function(boundsA, boundsB) {\n return (boundsA.min.x <= boundsB.max.x && boundsA.max.x >= boundsB.min.x\n && boundsA.max.y >= boundsB.min.y && boundsA.min.y <= boundsB.max.y);\n };\n\n /**\n * Translates the bounds by the given vector.\n * @method translate\n * @param {bounds} bounds\n * @param {vector} vector\n */\n Bounds.translate = function(bounds, vector) {\n bounds.min.x += vector.x;\n bounds.max.x += vector.x;\n bounds.min.y += vector.y;\n bounds.max.y += vector.y;\n };\n\n /**\n * Shifts the bounds to the given position.\n * @method shift\n * @param {bounds} bounds\n * @param {vector} position\n */\n Bounds.shift = function(bounds, position) {\n var deltaX = bounds.max.x - bounds.min.x,\n deltaY = bounds.max.y - bounds.min.y;\n \n bounds.min.x = position.x;\n bounds.max.x = position.x + deltaX;\n bounds.min.y = position.y;\n bounds.max.y = position.y + deltaY;\n };\n \n})();\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/**\n* The `Matter.Vector` module contains methods for creating and manipulating vectors.\n* Vectors are the basis of all the geometry related operations in the engine.\n* A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Vector\n*/\n\n// TODO: consider params for reusing vector objects\n\nvar Vector = {};\n\nmodule.exports = Vector;\n\n(function() {\n\n /**\n * Creates a new vector.\n * @method create\n * @param {number} x\n * @param {number} y\n * @return {vector} A new vector\n */\n Vector.create = function(x, y) {\n return { x: x || 0, y: y || 0 };\n };\n\n /**\n * Returns a new vector with `x` and `y` copied from the given `vector`.\n * @method clone\n * @param {vector} vector\n * @return {vector} A new cloned vector\n */\n Vector.clone = function(vector) {\n return { x: vector.x, y: vector.y };\n };\n\n /**\n * Returns the magnitude (length) of a vector.\n * @method magnitude\n * @param {vector} vector\n * @return {number} The magnitude of the vector\n */\n Vector.magnitude = function(vector) {\n return Math.sqrt((vector.x * vector.x) + (vector.y * vector.y));\n };\n\n /**\n * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation).\n * @method magnitudeSquared\n * @param {vector} vector\n * @return {number} The squared magnitude of the vector\n */\n Vector.magnitudeSquared = function(vector) {\n return (vector.x * vector.x) + (vector.y * vector.y);\n };\n\n /**\n * Rotates the vector about (0, 0) by specified angle.\n * @method rotate\n * @param {vector} vector\n * @param {number} angle\n * @param {vector} [output]\n * @return {vector} The vector rotated about (0, 0)\n */\n Vector.rotate = function(vector, angle, output) {\n var cos = Math.cos(angle), sin = Math.sin(angle);\n if (!output) output = {};\n var x = vector.x * cos - vector.y * sin;\n output.y = vector.x * sin + vector.y * cos;\n output.x = x;\n return output;\n };\n\n /**\n * Rotates the vector about a specified point by specified angle.\n * @method rotateAbout\n * @param {vector} vector\n * @param {number} angle\n * @param {vector} point\n * @param {vector} [output]\n * @return {vector} A new vector rotated about the point\n */\n Vector.rotateAbout = function(vector, angle, point, output) {\n var cos = Math.cos(angle), sin = Math.sin(angle);\n if (!output) output = {};\n var x = point.x + ((vector.x - point.x) * cos - (vector.y - point.y) * sin);\n output.y = point.y + ((vector.x - point.x) * sin + (vector.y - point.y) * cos);\n output.x = x;\n return output;\n };\n\n /**\n * Normalises a vector (such that its magnitude is `1`).\n * @method normalise\n * @param {vector} vector\n * @return {vector} A new vector normalised\n */\n Vector.normalise = function(vector) {\n var magnitude = Vector.magnitude(vector);\n if (magnitude === 0)\n return { x: 0, y: 0 };\n return { x: vector.x / magnitude, y: vector.y / magnitude };\n };\n\n /**\n * Returns the dot-product of two vectors.\n * @method dot\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @return {number} The dot product of the two vectors\n */\n Vector.dot = function(vectorA, vectorB) {\n return (vectorA.x * vectorB.x) + (vectorA.y * vectorB.y);\n };\n\n /**\n * Returns the cross-product of two vectors.\n * @method cross\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @return {number} The cross product of the two vectors\n */\n Vector.cross = function(vectorA, vectorB) {\n return (vectorA.x * vectorB.y) - (vectorA.y * vectorB.x);\n };\n\n /**\n * Returns the cross-product of three vectors.\n * @method cross3\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @param {vector} vectorC\n * @return {number} The cross product of the three vectors\n */\n Vector.cross3 = function(vectorA, vectorB, vectorC) {\n return (vectorB.x - vectorA.x) * (vectorC.y - vectorA.y) - (vectorB.y - vectorA.y) * (vectorC.x - vectorA.x);\n };\n\n /**\n * Adds the two vectors.\n * @method add\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @param {vector} [output]\n * @return {vector} A new vector of vectorA and vectorB added\n */\n Vector.add = function(vectorA, vectorB, output) {\n if (!output) output = {};\n output.x = vectorA.x + vectorB.x;\n output.y = vectorA.y + vectorB.y;\n return output;\n };\n\n /**\n * Subtracts the two vectors.\n * @method sub\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @param {vector} [output]\n * @return {vector} A new vector of vectorA and vectorB subtracted\n */\n Vector.sub = function(vectorA, vectorB, output) {\n if (!output) output = {};\n output.x = vectorA.x - vectorB.x;\n output.y = vectorA.y - vectorB.y;\n return output;\n };\n\n /**\n * Multiplies a vector and a scalar.\n * @method mult\n * @param {vector} vector\n * @param {number} scalar\n * @return {vector} A new vector multiplied by scalar\n */\n Vector.mult = function(vector, scalar) {\n return { x: vector.x * scalar, y: vector.y * scalar };\n };\n\n /**\n * Divides a vector and a scalar.\n * @method div\n * @param {vector} vector\n * @param {number} scalar\n * @return {vector} A new vector divided by scalar\n */\n Vector.div = function(vector, scalar) {\n return { x: vector.x / scalar, y: vector.y / scalar };\n };\n\n /**\n * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction.\n * @method perp\n * @param {vector} vector\n * @param {bool} [negate=false]\n * @return {vector} The perpendicular vector\n */\n Vector.perp = function(vector, negate) {\n negate = negate === true ? -1 : 1;\n return { x: negate * -vector.y, y: negate * vector.x };\n };\n\n /**\n * Negates both components of a vector such that it points in the opposite direction.\n * @method neg\n * @param {vector} vector\n * @return {vector} The negated vector\n */\n Vector.neg = function(vector) {\n return { x: -vector.x, y: -vector.y };\n };\n\n /**\n * Returns the angle between the vector `vectorB - vectorA` and the x-axis in radians.\n * @method angle\n * @param {vector} vectorA\n * @param {vector} vectorB\n * @return {number} The angle in radians\n */\n Vector.angle = function(vectorA, vectorB) {\n return Math.atan2(vectorB.y - vectorA.y, vectorB.x - vectorA.x);\n };\n\n /**\n * Temporary vector pool (not thread-safe).\n * @property _temp\n * @type {vector[]}\n * @private\n */\n Vector._temp = [\n Vector.create(), Vector.create(), \n Vector.create(), Vector.create(), \n Vector.create(), Vector.create()\n ];\n\n})();\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices.\n* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`.\n* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull).\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Vertices\n*/\n\nvar Vertices = {};\n\nmodule.exports = Vertices;\n\nvar Vector = __webpack_require__(2);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Creates a new set of `Matter.Body` compatible vertices.\n * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example:\n *\n * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]\n *\n * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects,\n * but with some additional references required for efficient collision detection routines.\n *\n * Vertices must be specified in clockwise order.\n *\n * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided.\n *\n * @method create\n * @param {vector[]} points\n * @param {body} body\n */\n Vertices.create = function(points, body) {\n var vertices = [];\n\n for (var i = 0; i < points.length; i++) {\n var point = points[i],\n vertex = {\n x: point.x,\n y: point.y,\n index: i,\n body: body,\n isInternal: false\n };\n\n vertices.push(vertex);\n }\n\n return vertices;\n };\n\n /**\n * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), \n * into a `Matter.Vertices` object for the given `Matter.Body`.\n * For parsing SVG paths, see `Svg.pathToVertices`.\n * @method fromPath\n * @param {string} path\n * @param {body} body\n * @return {vertices} vertices\n */\n Vertices.fromPath = function(path, body) {\n var pathPattern = /L?\\s*([-\\d.e]+)[\\s,]*([-\\d.e]+)*/ig,\n points = [];\n\n path.replace(pathPattern, function(match, x, y) {\n points.push({ x: parseFloat(x), y: parseFloat(y) });\n });\n\n return Vertices.create(points, body);\n };\n\n /**\n * Returns the centre (centroid) of the set of vertices.\n * @method centre\n * @param {vertices} vertices\n * @return {vector} The centre point\n */\n Vertices.centre = function(vertices) {\n var area = Vertices.area(vertices, true),\n centre = { x: 0, y: 0 },\n cross,\n temp,\n j;\n\n for (var i = 0; i < vertices.length; i++) {\n j = (i + 1) % vertices.length;\n cross = Vector.cross(vertices[i], vertices[j]);\n temp = Vector.mult(Vector.add(vertices[i], vertices[j]), cross);\n centre = Vector.add(centre, temp);\n }\n\n return Vector.div(centre, 6 * area);\n };\n\n /**\n * Returns the average (mean) of the set of vertices.\n * @method mean\n * @param {vertices} vertices\n * @return {vector} The average point\n */\n Vertices.mean = function(vertices) {\n var average = { x: 0, y: 0 };\n\n for (var i = 0; i < vertices.length; i++) {\n average.x += vertices[i].x;\n average.y += vertices[i].y;\n }\n\n return Vector.div(average, vertices.length);\n };\n\n /**\n * Returns the area of the set of vertices.\n * @method area\n * @param {vertices} vertices\n * @param {bool} signed\n * @return {number} The area\n */\n Vertices.area = function(vertices, signed) {\n var area = 0,\n j = vertices.length - 1;\n\n for (var i = 0; i < vertices.length; i++) {\n area += (vertices[j].x - vertices[i].x) * (vertices[j].y + vertices[i].y);\n j = i;\n }\n\n if (signed)\n return area / 2;\n\n return Math.abs(area) / 2;\n };\n\n /**\n * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass.\n * @method inertia\n * @param {vertices} vertices\n * @param {number} mass\n * @return {number} The polygon's moment of inertia\n */\n Vertices.inertia = function(vertices, mass) {\n var numerator = 0,\n denominator = 0,\n v = vertices,\n cross,\n j;\n\n // find the polygon's moment of inertia, using second moment of area\n // from equations at http://www.physicsforums.com/showthread.php?t=25293\n for (var n = 0; n < v.length; n++) {\n j = (n + 1) % v.length;\n cross = Math.abs(Vector.cross(v[j], v[n]));\n numerator += cross * (Vector.dot(v[j], v[j]) + Vector.dot(v[j], v[n]) + Vector.dot(v[n], v[n]));\n denominator += cross;\n }\n\n return (mass / 6) * (numerator / denominator);\n };\n\n /**\n * Translates the set of vertices in-place.\n * @method translate\n * @param {vertices} vertices\n * @param {vector} vector\n * @param {number} scalar\n */\n Vertices.translate = function(vertices, vector, scalar) {\n scalar = typeof scalar !== 'undefined' ? scalar : 1;\n\n var verticesLength = vertices.length,\n translateX = vector.x * scalar,\n translateY = vector.y * scalar,\n i;\n \n for (i = 0; i < verticesLength; i++) {\n vertices[i].x += translateX;\n vertices[i].y += translateY;\n }\n\n return vertices;\n };\n\n /**\n * Rotates the set of vertices in-place.\n * @method rotate\n * @param {vertices} vertices\n * @param {number} angle\n * @param {vector} point\n */\n Vertices.rotate = function(vertices, angle, point) {\n if (angle === 0)\n return;\n\n var cos = Math.cos(angle),\n sin = Math.sin(angle),\n pointX = point.x,\n pointY = point.y,\n verticesLength = vertices.length,\n vertex,\n dx,\n dy,\n i;\n\n for (i = 0; i < verticesLength; i++) {\n vertex = vertices[i];\n dx = vertex.x - pointX;\n dy = vertex.y - pointY;\n vertex.x = pointX + (dx * cos - dy * sin);\n vertex.y = pointY + (dx * sin + dy * cos);\n }\n\n return vertices;\n };\n\n /**\n * Returns `true` if the `point` is inside the set of `vertices`.\n * @method contains\n * @param {vertices} vertices\n * @param {vector} point\n * @return {boolean} True if the vertices contains point, otherwise false\n */\n Vertices.contains = function(vertices, point) {\n var pointX = point.x,\n pointY = point.y,\n verticesLength = vertices.length,\n vertex = vertices[verticesLength - 1],\n nextVertex;\n\n for (var i = 0; i < verticesLength; i++) {\n nextVertex = vertices[i];\n\n if ((pointX - vertex.x) * (nextVertex.y - vertex.y) \n + (pointY - vertex.y) * (vertex.x - nextVertex.x) > 0) {\n return false;\n }\n\n vertex = nextVertex;\n }\n\n return true;\n };\n\n /**\n * Scales the vertices from a point (default is centre) in-place.\n * @method scale\n * @param {vertices} vertices\n * @param {number} scaleX\n * @param {number} scaleY\n * @param {vector} point\n */\n Vertices.scale = function(vertices, scaleX, scaleY, point) {\n if (scaleX === 1 && scaleY === 1)\n return vertices;\n\n point = point || Vertices.centre(vertices);\n\n var vertex,\n delta;\n\n for (var i = 0; i < vertices.length; i++) {\n vertex = vertices[i];\n delta = Vector.sub(vertex, point);\n vertices[i].x = point.x + delta.x * scaleX;\n vertices[i].y = point.y + delta.y * scaleY;\n }\n\n return vertices;\n };\n\n /**\n * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices.\n * The radius parameter is a single number or an array to specify the radius for each vertex.\n * @method chamfer\n * @param {vertices} vertices\n * @param {number[]} radius\n * @param {number} quality\n * @param {number} qualityMin\n * @param {number} qualityMax\n */\n Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) {\n if (typeof radius === 'number') {\n radius = [radius];\n } else {\n radius = radius || [8];\n }\n\n // quality defaults to -1, which is auto\n quality = (typeof quality !== 'undefined') ? quality : -1;\n qualityMin = qualityMin || 2;\n qualityMax = qualityMax || 14;\n\n var newVertices = [];\n\n for (var i = 0; i < vertices.length; i++) {\n var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1],\n vertex = vertices[i],\n nextVertex = vertices[(i + 1) % vertices.length],\n currentRadius = radius[i < radius.length ? i : radius.length - 1];\n\n if (currentRadius === 0) {\n newVertices.push(vertex);\n continue;\n }\n\n var prevNormal = Vector.normalise({ \n x: vertex.y - prevVertex.y, \n y: prevVertex.x - vertex.x\n });\n\n var nextNormal = Vector.normalise({ \n x: nextVertex.y - vertex.y, \n y: vertex.x - nextVertex.x\n });\n\n var diagonalRadius = Math.sqrt(2 * Math.pow(currentRadius, 2)),\n radiusVector = Vector.mult(Common.clone(prevNormal), currentRadius),\n midNormal = Vector.normalise(Vector.mult(Vector.add(prevNormal, nextNormal), 0.5)),\n scaledVertex = Vector.sub(vertex, Vector.mult(midNormal, diagonalRadius));\n\n var precision = quality;\n\n if (quality === -1) {\n // automatically decide precision\n precision = Math.pow(currentRadius, 0.32) * 1.75;\n }\n\n precision = Common.clamp(precision, qualityMin, qualityMax);\n\n // use an even value for precision, more likely to reduce axes by using symmetry\n if (precision % 2 === 1)\n precision += 1;\n\n var alpha = Math.acos(Vector.dot(prevNormal, nextNormal)),\n theta = alpha / precision;\n\n for (var j = 0; j < precision; j++) {\n newVertices.push(Vector.add(Vector.rotate(radiusVector, theta * j), scaledVertex));\n }\n }\n\n return newVertices;\n };\n\n /**\n * Sorts the input vertices into clockwise order in place.\n * @method clockwiseSort\n * @param {vertices} vertices\n * @return {vertices} vertices\n */\n Vertices.clockwiseSort = function(vertices) {\n var centre = Vertices.mean(vertices);\n\n vertices.sort(function(vertexA, vertexB) {\n return Vector.angle(centre, vertexA) - Vector.angle(centre, vertexB);\n });\n\n return vertices;\n };\n\n /**\n * Returns true if the vertices form a convex shape (vertices must be in clockwise order).\n * @method isConvex\n * @param {vertices} vertices\n * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable).\n */\n Vertices.isConvex = function(vertices) {\n // http://paulbourke.net/geometry/polygonmesh/\n // Copyright (c) Paul Bourke (use permitted)\n\n var flag = 0,\n n = vertices.length,\n i,\n j,\n k,\n z;\n\n if (n < 3)\n return null;\n\n for (i = 0; i < n; i++) {\n j = (i + 1) % n;\n k = (i + 2) % n;\n z = (vertices[j].x - vertices[i].x) * (vertices[k].y - vertices[j].y);\n z -= (vertices[j].y - vertices[i].y) * (vertices[k].x - vertices[j].x);\n\n if (z < 0) {\n flag |= 1;\n } else if (z > 0) {\n flag |= 2;\n }\n\n if (flag === 3) {\n return false;\n }\n }\n\n if (flag !== 0){\n return true;\n } else {\n return null;\n }\n };\n\n /**\n * Returns the convex hull of the input vertices as a new array of points.\n * @method hull\n * @param {vertices} vertices\n * @return [vertex] vertices\n */\n Vertices.hull = function(vertices) {\n // http://geomalgorithms.com/a10-_hull-1.html\n\n var upper = [],\n lower = [], \n vertex,\n i;\n\n // sort vertices on x-axis (y-axis for ties)\n vertices = vertices.slice(0);\n vertices.sort(function(vertexA, vertexB) {\n var dx = vertexA.x - vertexB.x;\n return dx !== 0 ? dx : vertexA.y - vertexB.y;\n });\n\n // build lower hull\n for (i = 0; i < vertices.length; i += 1) {\n vertex = vertices[i];\n\n while (lower.length >= 2 \n && Vector.cross3(lower[lower.length - 2], lower[lower.length - 1], vertex) <= 0) {\n lower.pop();\n }\n\n lower.push(vertex);\n }\n\n // build upper hull\n for (i = vertices.length - 1; i >= 0; i -= 1) {\n vertex = vertices[i];\n\n while (upper.length >= 2 \n && Vector.cross3(upper[upper.length - 2], upper[upper.length - 1], vertex) <= 0) {\n upper.pop();\n }\n\n upper.push(vertex);\n }\n\n // concatenation of the lower and upper hulls gives the convex hull\n // omit last points because they are repeated at the beginning of the other list\n upper.pop();\n lower.pop();\n\n return upper.concat(lower);\n };\n\n})();\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Body` module contains methods for creating and manipulating rigid bodies.\n* For creating bodies with common configurations such as rectangles, circles and other polygons see the module `Matter.Bodies`.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n\n* @class Body\n*/\n\nvar Body = {};\n\nmodule.exports = Body;\n\nvar Vertices = __webpack_require__(3);\nvar Vector = __webpack_require__(2);\nvar Sleeping = __webpack_require__(7);\nvar Common = __webpack_require__(0);\nvar Bounds = __webpack_require__(1);\nvar Axes = __webpack_require__(11);\n\n(function() {\n\n Body._timeCorrection = true;\n Body._inertiaScale = 4;\n Body._nextCollidingGroupId = 1;\n Body._nextNonCollidingGroupId = -1;\n Body._nextCategory = 0x0001;\n Body._baseDelta = 1000 / 60;\n\n /**\n * Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.\n * All properties have default values, and many are pre-calculated automatically based on other properties.\n * Vertices must be specified in clockwise order.\n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {} options\n * @return {body} body\n */\n Body.create = function(options) {\n var defaults = {\n id: Common.nextId(),\n type: 'body',\n label: 'Body',\n parts: [],\n plugin: {},\n angle: 0,\n vertices: Vertices.fromPath('L 0 0 L 40 0 L 40 40 L 0 40'),\n position: { x: 0, y: 0 },\n force: { x: 0, y: 0 },\n torque: 0,\n positionImpulse: { x: 0, y: 0 },\n constraintImpulse: { x: 0, y: 0, angle: 0 },\n totalContacts: 0,\n speed: 0,\n angularSpeed: 0,\n velocity: { x: 0, y: 0 },\n angularVelocity: 0,\n isSensor: false,\n isStatic: false,\n isSleeping: false,\n motion: 0,\n sleepThreshold: 60,\n density: 0.001,\n restitution: 0,\n friction: 0.1,\n frictionStatic: 0.5,\n frictionAir: 0.01,\n collisionFilter: {\n category: 0x0001,\n mask: 0xFFFFFFFF,\n group: 0\n },\n slop: 0.05,\n timeScale: 1,\n render: {\n visible: true,\n opacity: 1,\n strokeStyle: null,\n fillStyle: null,\n lineWidth: null,\n sprite: {\n xScale: 1,\n yScale: 1,\n xOffset: 0,\n yOffset: 0\n }\n },\n events: null,\n bounds: null,\n chamfer: null,\n circleRadius: 0,\n positionPrev: null,\n anglePrev: 0,\n parent: null,\n axes: null,\n area: 0,\n mass: 0,\n inertia: 0,\n deltaTime: 1000 / 60,\n _original: null\n };\n\n var body = Common.extend(defaults, options);\n\n _initProperties(body, options);\n\n return body;\n };\n\n /**\n * Returns the next unique group index for which bodies will collide.\n * If `isNonColliding` is `true`, returns the next unique group index for which bodies will _not_ collide.\n * See `body.collisionFilter` for more information.\n * @method nextGroup\n * @param {bool} [isNonColliding=false]\n * @return {Number} Unique group index\n */\n Body.nextGroup = function(isNonColliding) {\n if (isNonColliding)\n return Body._nextNonCollidingGroupId--;\n\n return Body._nextCollidingGroupId++;\n };\n\n /**\n * Returns the next unique category bitfield (starting after the initial default category `0x0001`).\n * There are 32 available. See `body.collisionFilter` for more information.\n * @method nextCategory\n * @return {Number} Unique category bitfield\n */\n Body.nextCategory = function() {\n Body._nextCategory = Body._nextCategory << 1;\n return Body._nextCategory;\n };\n\n /**\n * Initialises body properties.\n * @method _initProperties\n * @private\n * @param {body} body\n * @param {} [options]\n */\n var _initProperties = function(body, options) {\n options = options || {};\n\n // init required properties (order is important)\n Body.set(body, {\n bounds: body.bounds || Bounds.create(body.vertices),\n positionPrev: body.positionPrev || Vector.clone(body.position),\n anglePrev: body.anglePrev || body.angle,\n vertices: body.vertices,\n parts: body.parts || [body],\n isStatic: body.isStatic,\n isSleeping: body.isSleeping,\n parent: body.parent || body\n });\n\n Vertices.rotate(body.vertices, body.angle, body.position);\n Axes.rotate(body.axes, body.angle);\n Bounds.update(body.bounds, body.vertices, body.velocity);\n\n // allow options to override the automatically calculated properties\n Body.set(body, {\n axes: options.axes || body.axes,\n area: options.area || body.area,\n mass: options.mass || body.mass,\n inertia: options.inertia || body.inertia\n });\n\n // render properties\n var defaultFillStyle = (body.isStatic ? '#14151f' : Common.choose(['#f19648', '#f5d259', '#f55a3c', '#063e7b', '#ececd1'])),\n defaultStrokeStyle = body.isStatic ? '#555' : '#ccc',\n defaultLineWidth = body.isStatic && body.render.fillStyle === null ? 1 : 0;\n body.render.fillStyle = body.render.fillStyle || defaultFillStyle;\n body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle;\n body.render.lineWidth = body.render.lineWidth || defaultLineWidth;\n body.render.sprite.xOffset += -(body.bounds.min.x - body.position.x) / (body.bounds.max.x - body.bounds.min.x);\n body.render.sprite.yOffset += -(body.bounds.min.y - body.position.y) / (body.bounds.max.y - body.bounds.min.y);\n };\n\n /**\n * Given a property and a value (or map of), sets the property(s) on the body, using the appropriate setter functions if they exist.\n * Prefer to use the actual setter functions in performance critical situations.\n * @method set\n * @param {body} body\n * @param {} settings A property name (or map of properties and values) to set on the body.\n * @param {} value The value to set if `settings` is a single property name.\n */\n Body.set = function(body, settings, value) {\n var property;\n\n if (typeof settings === 'string') {\n property = settings;\n settings = {};\n settings[property] = value;\n }\n\n for (property in settings) {\n if (!Object.prototype.hasOwnProperty.call(settings, property))\n continue;\n\n value = settings[property];\n switch (property) {\n\n case 'isStatic':\n Body.setStatic(body, value);\n break;\n case 'isSleeping':\n Sleeping.set(body, value);\n break;\n case 'mass':\n Body.setMass(body, value);\n break;\n case 'density':\n Body.setDensity(body, value);\n break;\n case 'inertia':\n Body.setInertia(body, value);\n break;\n case 'vertices':\n Body.setVertices(body, value);\n break;\n case 'position':\n Body.setPosition(body, value);\n break;\n case 'angle':\n Body.setAngle(body, value);\n break;\n case 'velocity':\n Body.setVelocity(body, value);\n break;\n case 'angularVelocity':\n Body.setAngularVelocity(body, value);\n break;\n case 'speed':\n Body.setSpeed(body, value);\n break;\n case 'angularSpeed':\n Body.setAngularSpeed(body, value);\n break;\n case 'parts':\n Body.setParts(body, value);\n break;\n case 'centre':\n Body.setCentre(body, value);\n break;\n default:\n body[property] = value;\n\n }\n }\n };\n\n /**\n * Sets the body as static, including isStatic flag and setting mass and inertia to Infinity.\n * @method setStatic\n * @param {body} body\n * @param {bool} isStatic\n */\n Body.setStatic = function(body, isStatic) {\n for (var i = 0; i < body.parts.length; i++) {\n var part = body.parts[i];\n\n if (isStatic) {\n if (!part.isStatic) {\n part._original = {\n restitution: part.restitution,\n friction: part.friction,\n mass: part.mass,\n inertia: part.inertia,\n density: part.density,\n inverseMass: part.inverseMass,\n inverseInertia: part.inverseInertia\n };\n }\n\n part.restitution = 0;\n part.friction = 1;\n part.mass = part.inertia = part.density = Infinity;\n part.inverseMass = part.inverseInertia = 0;\n\n part.positionPrev.x = part.position.x;\n part.positionPrev.y = part.position.y;\n part.anglePrev = part.angle;\n part.angularVelocity = 0;\n part.speed = 0;\n part.angularSpeed = 0;\n part.motion = 0;\n } else if (part._original) {\n part.restitution = part._original.restitution;\n part.friction = part._original.friction;\n part.mass = part._original.mass;\n part.inertia = part._original.inertia;\n part.density = part._original.density;\n part.inverseMass = part._original.inverseMass;\n part.inverseInertia = part._original.inverseInertia;\n\n part._original = null;\n }\n\n part.isStatic = isStatic;\n }\n };\n\n /**\n * Sets the mass of the body. Inverse mass, density and inertia are automatically updated to reflect the change.\n * @method setMass\n * @param {body} body\n * @param {number} mass\n */\n Body.setMass = function(body, mass) {\n var moment = body.inertia / (body.mass / 6);\n body.inertia = moment * (mass / 6);\n body.inverseInertia = 1 / body.inertia;\n\n body.mass = mass;\n body.inverseMass = 1 / body.mass;\n body.density = body.mass / body.area;\n };\n\n /**\n * Sets the density of the body. Mass and inertia are automatically updated to reflect the change.\n * @method setDensity\n * @param {body} body\n * @param {number} density\n */\n Body.setDensity = function(body, density) {\n Body.setMass(body, density * body.area);\n body.density = density;\n };\n\n /**\n * Sets the moment of inertia of the body. This is the second moment of area in two dimensions.\n * Inverse inertia is automatically updated to reflect the change. Mass is not changed.\n * @method setInertia\n * @param {body} body\n * @param {number} inertia\n */\n Body.setInertia = function(body, inertia) {\n body.inertia = inertia;\n body.inverseInertia = 1 / body.inertia;\n };\n\n /**\n * Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to `body.density`).\n * Vertices will be automatically transformed to be orientated around their centre of mass as the origin.\n * They are then automatically translated to world space based on `body.position`.\n *\n * The `vertices` argument should be passed as an array of `Matter.Vector` points (or a `Matter.Vertices` array).\n * Vertices must form a convex hull. Concave vertices must be decomposed into convex parts.\n * \n * @method setVertices\n * @param {body} body\n * @param {vector[]} vertices\n */\n Body.setVertices = function(body, vertices) {\n // change vertices\n if (vertices[0].body === body) {\n body.vertices = vertices;\n } else {\n body.vertices = Vertices.create(vertices, body);\n }\n\n // update properties\n body.axes = Axes.fromVertices(body.vertices);\n body.area = Vertices.area(body.vertices);\n Body.setMass(body, body.density * body.area);\n\n // orient vertices around the centre of mass at origin (0, 0)\n var centre = Vertices.centre(body.vertices);\n Vertices.translate(body.vertices, centre, -1);\n\n // update inertia while vertices are at origin (0, 0)\n Body.setInertia(body, Body._inertiaScale * Vertices.inertia(body.vertices, body.mass));\n\n // update geometry\n Vertices.translate(body.vertices, body.position);\n Bounds.update(body.bounds, body.vertices, body.velocity);\n };\n\n /**\n * Sets the parts of the `body`. \n * \n * See `body.parts` for details and requirements on how parts are used.\n * \n * See Bodies.fromVertices for a related utility.\n * \n * This function updates `body` mass, inertia and centroid based on the parts geometry. \n * Sets each `part.parent` to be this `body`. \n * \n * The convex hull is computed and set on this `body` (unless `autoHull` is `false`). \n * Automatically ensures that the first part in `body.parts` is the `body`.\n * @method setParts\n * @param {body} body\n * @param {body[]} parts\n * @param {bool} [autoHull=true]\n */\n Body.setParts = function(body, parts, autoHull) {\n var i;\n\n // add all the parts, ensuring that the first part is always the parent body\n parts = parts.slice(0);\n body.parts.length = 0;\n body.parts.push(body);\n body.parent = body;\n\n for (i = 0; i < parts.length; i++) {\n var part = parts[i];\n if (part !== body) {\n part.parent = body;\n body.parts.push(part);\n }\n }\n\n if (body.parts.length === 1)\n return;\n\n autoHull = typeof autoHull !== 'undefined' ? autoHull : true;\n\n // find the convex hull of all parts to set on the parent body\n if (autoHull) {\n var vertices = [];\n for (i = 0; i < parts.length; i++) {\n vertices = vertices.concat(parts[i].vertices);\n }\n\n Vertices.clockwiseSort(vertices);\n\n var hull = Vertices.hull(vertices),\n hullCentre = Vertices.centre(hull);\n\n Body.setVertices(body, hull);\n Vertices.translate(body.vertices, hullCentre);\n }\n\n // sum the properties of all compound parts of the parent body\n var total = Body._totalProperties(body);\n\n body.area = total.area;\n body.parent = body;\n body.position.x = total.centre.x;\n body.position.y = total.centre.y;\n body.positionPrev.x = total.centre.x;\n body.positionPrev.y = total.centre.y;\n\n Body.setMass(body, total.mass);\n Body.setInertia(body, total.inertia);\n Body.setPosition(body, total.centre);\n };\n\n /**\n * Set the centre of mass of the body. \n * The `centre` is a vector in world-space unless `relative` is set, in which case it is a translation.\n * The centre of mass is the point the body rotates about and can be used to simulate non-uniform density.\n * This is equal to moving `body.position` but not the `body.vertices`.\n * Invalid if the `centre` falls outside the body's convex hull.\n * @method setCentre\n * @param {body} body\n * @param {vector} centre\n * @param {bool} relative\n */\n Body.setCentre = function(body, centre, relative) {\n if (!relative) {\n body.positionPrev.x = centre.x - (body.position.x - body.positionPrev.x);\n body.positionPrev.y = centre.y - (body.position.y - body.positionPrev.y);\n body.position.x = centre.x;\n body.position.y = centre.y;\n } else {\n body.positionPrev.x += centre.x;\n body.positionPrev.y += centre.y;\n body.position.x += centre.x;\n body.position.y += centre.y;\n }\n };\n\n /**\n * Sets the position of the body. By default velocity is unchanged.\n * If `updateVelocity` is `true` then velocity is inferred from the change in position.\n * @method setPosition\n * @param {body} body\n * @param {vector} position\n * @param {boolean} [updateVelocity=false]\n */\n Body.setPosition = function(body, position, updateVelocity) {\n var delta = Vector.sub(position, body.position);\n\n if (updateVelocity) {\n body.positionPrev.x = body.position.x;\n body.positionPrev.y = body.position.y;\n body.velocity.x = delta.x;\n body.velocity.y = delta.y;\n body.speed = Vector.magnitude(delta);\n } else {\n body.positionPrev.x += delta.x;\n body.positionPrev.y += delta.y;\n }\n\n for (var i = 0; i < body.parts.length; i++) {\n var part = body.parts[i];\n part.position.x += delta.x;\n part.position.y += delta.y;\n Vertices.translate(part.vertices, delta);\n Bounds.update(part.bounds, part.vertices, body.velocity);\n }\n };\n\n /**\n * Sets the angle of the body. By default angular velocity is unchanged.\n * If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.\n * @method setAngle\n * @param {body} body\n * @param {number} angle\n * @param {boolean} [updateVelocity=false]\n */\n Body.setAngle = function(body, angle, updateVelocity) {\n var delta = angle - body.angle;\n \n if (updateVelocity) {\n body.anglePrev = body.angle;\n body.angularVelocity = delta;\n body.angularSpeed = Math.abs(delta);\n } else {\n body.anglePrev += delta;\n }\n\n for (var i = 0; i < body.parts.length; i++) {\n var part = body.parts[i];\n part.angle += delta;\n Vertices.rotate(part.vertices, delta, body.position);\n Axes.rotate(part.axes, delta);\n Bounds.update(part.bounds, part.vertices, body.velocity);\n if (i > 0) {\n Vector.rotateAbout(part.position, delta, body.position, part.position);\n }\n }\n };\n\n /**\n * Sets the current linear velocity of the body. \n * Affects body speed.\n * @method setVelocity\n * @param {body} body\n * @param {vector} velocity\n */\n Body.setVelocity = function(body, velocity) {\n var timeScale = body.deltaTime / Body._baseDelta;\n body.positionPrev.x = body.position.x - velocity.x * timeScale;\n body.positionPrev.y = body.position.y - velocity.y * timeScale;\n body.velocity.x = (body.position.x - body.positionPrev.x) / timeScale;\n body.velocity.y = (body.position.y - body.positionPrev.y) / timeScale;\n body.speed = Vector.magnitude(body.velocity);\n };\n\n /**\n * Gets the current linear velocity of the body.\n * @method getVelocity\n * @param {body} body\n * @return {vector} velocity\n */\n Body.getVelocity = function(body) {\n var timeScale = Body._baseDelta / body.deltaTime;\n\n return {\n x: (body.position.x - body.positionPrev.x) * timeScale,\n y: (body.position.y - body.positionPrev.y) * timeScale\n };\n };\n\n /**\n * Gets the current linear speed of the body. \n * Equivalent to the magnitude of its velocity.\n * @method getSpeed\n * @param {body} body\n * @return {number} speed\n */\n Body.getSpeed = function(body) {\n return Vector.magnitude(Body.getVelocity(body));\n };\n\n /**\n * Sets the current linear speed of the body. \n * Direction is maintained. Affects body velocity.\n * @method setSpeed\n * @param {body} body\n * @param {number} speed\n */\n Body.setSpeed = function(body, speed) {\n Body.setVelocity(body, Vector.mult(Vector.normalise(Body.getVelocity(body)), speed));\n };\n\n /**\n * Sets the current rotational velocity of the body. \n * Affects body angular speed.\n * @method setAngularVelocity\n * @param {body} body\n * @param {number} velocity\n */\n Body.setAngularVelocity = function(body, velocity) {\n var timeScale = body.deltaTime / Body._baseDelta;\n body.anglePrev = body.angle - velocity * timeScale;\n body.angularVelocity = (body.angle - body.anglePrev) / timeScale;\n body.angularSpeed = Math.abs(body.angularVelocity);\n };\n\n /**\n * Gets the current rotational velocity of the body.\n * @method getAngularVelocity\n * @param {body} body\n * @return {number} angular velocity\n */\n Body.getAngularVelocity = function(body) {\n return (body.angle - body.anglePrev) * Body._baseDelta / body.deltaTime;\n };\n\n /**\n * Gets the current rotational speed of the body. \n * Equivalent to the magnitude of its angular velocity.\n * @method getAngularSpeed\n * @param {body} body\n * @return {number} angular speed\n */\n Body.getAngularSpeed = function(body) {\n return Math.abs(Body.getAngularVelocity(body));\n };\n\n /**\n * Sets the current rotational speed of the body. \n * Direction is maintained. Affects body angular velocity.\n * @method setAngularSpeed\n * @param {body} body\n * @param {number} speed\n */\n Body.setAngularSpeed = function(body, speed) {\n Body.setAngularVelocity(body, Common.sign(Body.getAngularVelocity(body)) * speed);\n };\n\n /**\n * Moves a body by a given vector relative to its current position. By default velocity is unchanged.\n * If `updateVelocity` is `true` then velocity is inferred from the change in position.\n * @method translate\n * @param {body} body\n * @param {vector} translation\n * @param {boolean} [updateVelocity=false]\n */\n Body.translate = function(body, translation, updateVelocity) {\n Body.setPosition(body, Vector.add(body.position, translation), updateVelocity);\n };\n\n /**\n * Rotates a body by a given angle relative to its current angle. By default angular velocity is unchanged.\n * If `updateVelocity` is `true` then angular velocity is inferred from the change in angle.\n * @method rotate\n * @param {body} body\n * @param {number} rotation\n * @param {vector} [point]\n * @param {boolean} [updateVelocity=false]\n */\n Body.rotate = function(body, rotation, point, updateVelocity) {\n if (!point) {\n Body.setAngle(body, body.angle + rotation, updateVelocity);\n } else {\n var cos = Math.cos(rotation),\n sin = Math.sin(rotation),\n dx = body.position.x - point.x,\n dy = body.position.y - point.y;\n \n Body.setPosition(body, {\n x: point.x + (dx * cos - dy * sin),\n y: point.y + (dx * sin + dy * cos)\n }, updateVelocity);\n\n Body.setAngle(body, body.angle + rotation, updateVelocity);\n }\n };\n\n /**\n * Scales the body, including updating physical properties (mass, area, axes, inertia), from a world-space point (default is body centre).\n * @method scale\n * @param {body} body\n * @param {number} scaleX\n * @param {number} scaleY\n * @param {vector} [point]\n */\n Body.scale = function(body, scaleX, scaleY, point) {\n var totalArea = 0,\n totalInertia = 0;\n\n point = point || body.position;\n\n for (var i = 0; i < body.parts.length; i++) {\n var part = body.parts[i];\n\n // scale vertices\n Vertices.scale(part.vertices, scaleX, scaleY, point);\n\n // update properties\n part.axes = Axes.fromVertices(part.vertices);\n part.area = Vertices.area(part.vertices);\n Body.setMass(part, body.density * part.area);\n\n // update inertia (requires vertices to be at origin)\n Vertices.translate(part.vertices, { x: -part.position.x, y: -part.position.y });\n Body.setInertia(part, Body._inertiaScale * Vertices.inertia(part.vertices, part.mass));\n Vertices.translate(part.vertices, { x: part.position.x, y: part.position.y });\n\n if (i > 0) {\n totalArea += part.area;\n totalInertia += part.inertia;\n }\n\n // scale position\n part.position.x = point.x + (part.position.x - point.x) * scaleX;\n part.position.y = point.y + (part.position.y - point.y) * scaleY;\n\n // update bounds\n Bounds.update(part.bounds, part.vertices, body.velocity);\n }\n\n // handle parent body\n if (body.parts.length > 1) {\n body.area = totalArea;\n\n if (!body.isStatic) {\n Body.setMass(body, body.density * totalArea);\n Body.setInertia(body, totalInertia);\n }\n }\n\n // handle circles\n if (body.circleRadius) { \n if (scaleX === scaleY) {\n body.circleRadius *= scaleX;\n } else {\n // body is no longer a circle\n body.circleRadius = null;\n }\n }\n };\n\n /**\n * Performs an update by integrating the equations of motion on the `body`.\n * This is applied every update by `Matter.Engine` automatically.\n * @method update\n * @param {body} body\n * @param {number} [deltaTime=16.666]\n */\n Body.update = function(body, deltaTime) {\n deltaTime = (typeof deltaTime !== 'undefined' ? deltaTime : (1000 / 60)) * body.timeScale;\n\n var deltaTimeSquared = deltaTime * deltaTime,\n correction = Body._timeCorrection ? deltaTime / (body.deltaTime || deltaTime) : 1;\n\n // from the previous step\n var frictionAir = 1 - body.frictionAir * (deltaTime / Common._baseDelta),\n velocityPrevX = (body.position.x - body.positionPrev.x) * correction,\n velocityPrevY = (body.position.y - body.positionPrev.y) * correction;\n\n // update velocity with Verlet integration\n body.velocity.x = (velocityPrevX * frictionAir) + (body.force.x / body.mass) * deltaTimeSquared;\n body.velocity.y = (velocityPrevY * frictionAir) + (body.force.y / body.mass) * deltaTimeSquared;\n\n body.positionPrev.x = body.position.x;\n body.positionPrev.y = body.position.y;\n body.position.x += body.velocity.x;\n body.position.y += body.velocity.y;\n body.deltaTime = deltaTime;\n\n // update angular velocity with Verlet integration\n body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared;\n body.anglePrev = body.angle;\n body.angle += body.angularVelocity;\n\n // transform the body geometry\n for (var i = 0; i < body.parts.length; i++) {\n var part = body.parts[i];\n\n Vertices.translate(part.vertices, body.velocity);\n \n if (i > 0) {\n part.position.x += body.velocity.x;\n part.position.y += body.velocity.y;\n }\n\n if (body.angularVelocity !== 0) {\n Vertices.rotate(part.vertices, body.angularVelocity, body.position);\n Axes.rotate(part.axes, body.angularVelocity);\n if (i > 0) {\n Vector.rotateAbout(part.position, body.angularVelocity, body.position, part.position);\n }\n }\n\n Bounds.update(part.bounds, part.vertices, body.velocity);\n }\n };\n\n /**\n * Updates properties `body.velocity`, `body.speed`, `body.angularVelocity` and `body.angularSpeed` which are normalised in relation to `Body._baseDelta`.\n * @method updateVelocities\n * @param {body} body\n */\n Body.updateVelocities = function(body) {\n var timeScale = Body._baseDelta / body.deltaTime,\n bodyVelocity = body.velocity;\n\n bodyVelocity.x = (body.position.x - body.positionPrev.x) * timeScale;\n bodyVelocity.y = (body.position.y - body.positionPrev.y) * timeScale;\n body.speed = Math.sqrt((bodyVelocity.x * bodyVelocity.x) + (bodyVelocity.y * bodyVelocity.y));\n\n body.angularVelocity = (body.angle - body.anglePrev) * timeScale;\n body.angularSpeed = Math.abs(body.angularVelocity);\n };\n\n /**\n * Applies the `force` to the `body` from the force origin `position` in world-space, over a single timestep, including applying any resulting angular torque.\n * \n * Forces are useful for effects like gravity, wind or rocket thrust, but can be difficult in practice when precise control is needed. In these cases see `Body.setVelocity` and `Body.setPosition` as an alternative.\n * \n * The force from this function is only applied once for the duration of a single timestep, in other words the duration depends directly on the current engine update `delta` and the rate of calls to this function.\n * \n * Therefore to account for time, you should apply the force constantly over as many engine updates as equivalent to the intended duration.\n * \n * If all or part of the force duration is some fraction of a timestep, first multiply the force by `duration / timestep`.\n * \n * The force origin `position` in world-space must also be specified. Passing `body.position` will result in zero angular effect as the force origin would be at the centre of mass.\n * \n * The `body` will take time to accelerate under a force, the resulting effect depends on duration of the force, the body mass and other forces on the body including friction combined.\n * @method applyForce\n * @param {body} body\n * @param {vector} position The force origin in world-space. Pass `body.position` to avoid angular torque.\n * @param {vector} force\n */\n Body.applyForce = function(body, position, force) {\n var offset = { x: position.x - body.position.x, y: position.y - body.position.y };\n body.force.x += force.x;\n body.force.y += force.y;\n body.torque += offset.x * force.y - offset.y * force.x;\n };\n\n /**\n * Returns the sums of the properties of all compound parts of the parent body.\n * @method _totalProperties\n * @private\n * @param {body} body\n * @return {}\n */\n Body._totalProperties = function(body) {\n // from equations at:\n // https://ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=st&chap_sec=07.2&page=theory\n // http://output.to/sideway/default.asp?qno=121100087\n\n var properties = {\n mass: 0,\n area: 0,\n inertia: 0,\n centre: { x: 0, y: 0 }\n };\n\n // sum the properties of all compound parts of the parent body\n for (var i = body.parts.length === 1 ? 0 : 1; i < body.parts.length; i++) {\n var part = body.parts[i],\n mass = part.mass !== Infinity ? part.mass : 1;\n\n properties.mass += mass;\n properties.area += part.area;\n properties.inertia += part.inertia;\n properties.centre = Vector.add(properties.centre, Vector.mult(part.position, mass));\n }\n\n properties.centre = Vector.div(properties.centre, properties.mass);\n\n return properties;\n };\n\n /*\n *\n * Events Documentation\n *\n */\n\n /**\n * Fired when a body starts sleeping (where `this` is the body).\n *\n * @event sleepStart\n * @this {body} The body that has started sleeping\n * @param {} event An event object\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when a body ends sleeping (where `this` is the body).\n *\n * @event sleepEnd\n * @this {body} The body that has ended sleeping\n * @param {} event An event object\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * An integer `Number` uniquely identifying number generated in `Body.create` by `Common.nextId`.\n *\n * @property id\n * @type number\n */\n\n /**\n * _Read only_. Set by `Body.create`.\n * \n * A `String` denoting the type of object.\n *\n * @readOnly\n * @property type\n * @type string\n * @default \"body\"\n */\n\n /**\n * An arbitrary `String` name to help the user identify and manage bodies.\n *\n * @property label\n * @type string\n * @default \"Body\"\n */\n\n /**\n * _Read only_. Use `Body.setParts` to set. \n * \n * See `Bodies.fromVertices` for a related utility.\n * \n * An array of bodies (the 'parts') that make up this body (the 'parent'). The first body in this array must always be a self-reference to this `body`. \n * \n * The parts are fixed together and therefore perform as a single unified rigid body.\n * \n * Parts in relation to each other are allowed to overlap, as well as form gaps or holes, so can be used to create complex concave bodies unlike when using a single part. \n * \n * Use properties and functions on the parent `body` rather than on parts.\n * \n * Outside of their geometry, most properties on parts are not considered or updated. \n * As such 'per-part' material properties among others are not currently considered.\n * \n * Parts should be created specifically for their parent body. \n * Parts should not be shared or reused between bodies, only one parent is supported. \n * Parts should not have their own parts, they are not handled recursively. \n * Parts should not be added to the world directly or any other composite. \n * Parts own vertices must be convex and in clockwise order. \n * \n * A body with more than one part is sometimes referred to as a 'compound' body. \n * \n * Use `Body.setParts` when setting parts to ensure correct updates of all properties. \n *\n * @readOnly\n * @property parts\n * @type body[]\n */\n\n /**\n * An object reserved for storing plugin-specific properties.\n *\n * @property plugin\n * @type {}\n */\n\n /**\n * _Read only_. Updated by `Body.setParts`.\n * \n * A reference to the body that this is a part of. See `body.parts`.\n * This is a self reference if the body is not a part of another body.\n *\n * @readOnly\n * @property parent\n * @type body\n */\n\n /**\n * A `Number` specifying the angle of the body, in radians.\n *\n * @property angle\n * @type number\n * @default 0\n */\n\n /**\n * _Read only_. Use `Body.setVertices` or `Body.setParts` to set. See also `Bodies.fromVertices`.\n * \n * An array of `Vector` objects that specify the convex hull of the rigid body.\n * These should be provided about the origin `(0, 0)`. E.g.\n *\n * `[{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]`\n * \n * Vertices must always be convex, in clockwise order and must not contain any duplicate points.\n * \n * Concave vertices should be decomposed into convex `parts`, see `Bodies.fromVertices` and `Body.setParts`.\n *\n * When set the vertices are translated such that `body.position` is at the centre of mass.\n * Many other body properties are automatically calculated from these vertices when set including `density`, `area` and `inertia`.\n * \n * The module `Matter.Vertices` contains useful methods for working with vertices.\n *\n * @readOnly\n * @property vertices\n * @type vector[]\n */\n\n /**\n * _Read only_. Use `Body.setPosition` to set. \n * \n * A `Vector` that specifies the current world-space position of the body.\n * \n * @readOnly\n * @property position\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A `Vector` that accumulates the total force applied to the body for a single update.\n * Force is zeroed after every `Engine.update`, so constant forces should be applied for every update they are needed. See also `Body.applyForce`.\n * \n * @property force\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A `Number` that accumulates the total torque (turning force) applied to the body for a single update. See also `Body.applyForce`.\n * Torque is zeroed after every `Engine.update`, so constant torques should be applied for every update they are needed.\n *\n * Torques result in angular acceleration on every update, which depends on body inertia and the engine update delta.\n * \n * @property torque\n * @type number\n * @default 0\n */\n\n /**\n * _Read only_. Use `Body.setSpeed` to set. \n * \n * See `Body.getSpeed` for details.\n * \n * Equivalent to the magnitude of `body.velocity` (always positive).\n * \n * @readOnly\n * @property speed\n * @type number\n * @default 0\n */\n\n /**\n * _Read only_. Use `Body.setVelocity` to set. \n * \n * See `Body.getVelocity` for details.\n * \n * Equivalent to the magnitude of `body.angularVelocity` (always positive).\n * \n * @readOnly\n * @property velocity\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * _Read only_. Use `Body.setAngularSpeed` to set. \n * \n * See `Body.getAngularSpeed` for details.\n * \n * \n * @readOnly\n * @property angularSpeed\n * @type number\n * @default 0\n */\n\n /**\n * _Read only_. Use `Body.setAngularVelocity` to set. \n * \n * See `Body.getAngularVelocity` for details.\n * \n *\n * @readOnly\n * @property angularVelocity\n * @type number\n * @default 0\n */\n\n /**\n * _Read only_. Use `Body.setStatic` to set. \n * \n * A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed.\n *\n * @readOnly\n * @property isStatic\n * @type boolean\n * @default false\n */\n\n /**\n * A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically.\n *\n * @property isSensor\n * @type boolean\n * @default false\n */\n\n /**\n * _Read only_. Use `Sleeping.set` to set. \n * \n * A flag that indicates whether the body is considered sleeping. A sleeping body acts similar to a static body, except it is only temporary and can be awoken.\n *\n * @readOnly\n * @property isSleeping\n * @type boolean\n * @default false\n */\n\n /**\n * _Read only_. Calculated during engine update only when sleeping is enabled.\n * \n * A `Number` that loosely measures the amount of movement a body currently has.\n *\n * Derived from `body.speed^2 + body.angularSpeed^2`. See `Sleeping.update`.\n * \n * @readOnly\n * @property motion\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that defines the length of time during which this body must have near-zero velocity before it is set as sleeping by the `Matter.Sleeping` module (if sleeping is enabled by the engine).\n * \n * @property sleepThreshold\n * @type number\n * @default 60\n */\n\n /**\n * _Read only_. Use `Body.setDensity` to set. \n * \n * A `Number` that defines the density of the body (mass per unit area).\n * \n * Mass will also be updated when set.\n *\n * @readOnly\n * @property density\n * @type number\n * @default 0.001\n */\n\n /**\n * _Read only_. Use `Body.setMass` to set. \n * \n * A `Number` that defines the mass of the body.\n * \n * Density will also be updated when set.\n * \n * @readOnly\n * @property mass\n * @type number\n */\n\n /**\n * _Read only_. Use `Body.setMass` to set. \n * \n * A `Number` that defines the inverse mass of the body (`1 / mass`).\n *\n * @readOnly\n * @property inverseMass\n * @type number\n */\n\n /**\n * _Read only_. Automatically calculated when vertices, mass or density are set or set through `Body.setInertia`.\n * \n * A `Number` that defines the moment of inertia of the body. This is the second moment of area in two dimensions.\n * \n * Can be manually set to `Infinity` to prevent rotation of the body. See `Body.setInertia`.\n * \n * @readOnly\n * @property inertia\n * @type number\n */\n\n /**\n * _Read only_. Automatically calculated when vertices, mass or density are set or calculated by `Body.setInertia`.\n * \n * A `Number` that defines the inverse moment of inertia of the body (`1 / inertia`).\n * \n * @readOnly\n * @property inverseInertia\n * @type number\n */\n\n /**\n * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`.\n * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. \n * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy.\n * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula:\n *\n * `Math.max(bodyA.restitution, bodyB.restitution)`\n *\n * @property restitution\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that defines the friction of the body. The value is always positive and is in the range `(0, 1)`.\n * A value of `0` means that the body may slide indefinitely.\n * A value of `1` means the body may come to a stop almost instantly after a force is applied.\n *\n * The effects of the value may be non-linear. \n * High values may be unstable depending on the body.\n * The engine uses a Coulomb friction model including static and kinetic friction.\n * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula:\n *\n * `Math.min(bodyA.friction, bodyB.friction)`\n *\n * @property friction\n * @type number\n * @default 0.1\n */\n\n /**\n * A `Number` that defines the static friction of the body (in the Coulomb friction model). \n * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used.\n * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary.\n * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction.\n *\n * @property frictionStatic\n * @type number\n * @default 0.5\n */\n\n /**\n * A `Number` that defines the air friction of the body (air resistance). \n * A value of `0` means the body will never slow as it moves through space.\n * The higher the value, the faster a body slows when moving through space.\n * The effects of the value are non-linear. \n *\n * @property frictionAir\n * @type number\n * @default 0.01\n */\n\n /**\n * An `Object` that specifies the collision filtering properties of this body.\n *\n * Collisions between two bodies will obey the following rules:\n * - If the two bodies have the same non-zero value of `collisionFilter.group`,\n * they will always collide if the value is positive, and they will never collide\n * if the value is negative.\n * - If the two bodies have different values of `collisionFilter.group` or if one\n * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows:\n *\n * Each body belongs to a collision category, given by `collisionFilter.category`. This\n * value is used as a bit field and the category should have only one bit set, meaning that\n * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32\n * different collision categories available.\n *\n * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies\n * the categories it collides with (the value is the bitwise AND value of all these categories).\n *\n * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's\n * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0`\n * are both true.\n *\n * @property collisionFilter\n * @type object\n */\n\n /**\n * An Integer `Number`, that specifies the collision group this body belongs to.\n * See `body.collisionFilter` for more information.\n *\n * @property collisionFilter.group\n * @type object\n * @default 0\n */\n\n /**\n * A bit field that specifies the collision category this body belongs to.\n * The category value should have only one bit set, for example `0x0001`.\n * This means there are up to 32 unique collision categories available.\n * See `body.collisionFilter` for more information.\n *\n * @property collisionFilter.category\n * @type object\n * @default 1\n */\n\n /**\n * A bit mask that specifies the collision categories this body may collide with.\n * See `body.collisionFilter` for more information.\n *\n * @property collisionFilter.mask\n * @type object\n * @default -1\n */\n\n /**\n * A `Number` that specifies a thin boundary around the body where it is allowed to slightly sink into other bodies.\n * \n * This is required for proper collision response, including friction and restitution effects.\n * \n * The default should generally suffice in most cases. You may need to decrease this value for very small bodies that are nearing the default value in scale.\n *\n * @property slop\n * @type number\n * @default 0.05\n */\n\n /**\n * A `Number` that specifies per-body time scaling.\n *\n * @property timeScale\n * @type number\n * @default 1\n */\n\n /**\n * _Read only_. Updated during engine update.\n * \n * A `Number` that records the last delta time value used to update this body.\n * Used to calculate speed and velocity.\n *\n * @readOnly\n * @property deltaTime\n * @type number\n * @default 1000 / 60\n */\n\n /**\n * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`.\n *\n * @property render\n * @type object\n */\n\n /**\n * A flag that indicates if the body should be rendered.\n *\n * @property render.visible\n * @type boolean\n * @default true\n */\n\n /**\n * Sets the opacity to use when rendering.\n *\n * @property render.opacity\n * @type number\n * @default 1\n */\n\n /**\n * An `Object` that defines the sprite properties to use when rendering, if any.\n *\n * @property render.sprite\n * @type object\n */\n\n /**\n * An `String` that defines the path to the image to use as the sprite texture, if any.\n *\n * @property render.sprite.texture\n * @type string\n */\n \n /**\n * A `Number` that defines the scaling in the x-axis for the sprite, if any.\n *\n * @property render.sprite.xScale\n * @type number\n * @default 1\n */\n\n /**\n * A `Number` that defines the scaling in the y-axis for the sprite, if any.\n *\n * @property render.sprite.yScale\n * @type number\n * @default 1\n */\n\n /**\n * A `Number` that defines the offset in the x-axis for the sprite (normalised by texture width).\n *\n * @property render.sprite.xOffset\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height).\n *\n * @property render.sprite.yOffset\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that defines the line width to use when rendering the body outline (if a sprite is not defined).\n * A value of `0` means no outline will be rendered.\n *\n * @property render.lineWidth\n * @type number\n * @default 0\n */\n\n /**\n * A `String` that defines the fill style to use when rendering the body (if a sprite is not defined).\n * It is the same as when using a canvas, so it accepts CSS style property values.\n *\n * @property render.fillStyle\n * @type string\n * @default a random colour\n */\n\n /**\n * A `String` that defines the stroke style to use when rendering the body outline (if a sprite is not defined).\n * It is the same as when using a canvas, so it accepts CSS style property values.\n *\n * @property render.strokeStyle\n * @type string\n * @default a random colour\n */\n\n /**\n * _Read only_. Calculated automatically when vertices are set.\n * \n * An array of unique axis vectors (edge normals) used for collision detection.\n * These are automatically calculated when vertices are set.\n * They are constantly updated by `Body.update` during the simulation.\n *\n * @readOnly\n * @property axes\n * @type vector[]\n */\n \n /**\n * _Read only_. Calculated automatically when vertices are set.\n * \n * A `Number` that measures the area of the body's convex hull.\n * \n * @readOnly\n * @property area\n * @type string\n * @default \n */\n\n /**\n * A `Bounds` object that defines the AABB region for the body.\n * It is automatically calculated when vertices are set and constantly updated by `Body.update` during simulation.\n * \n * @property bounds\n * @type bounds\n */\n\n /**\n * Temporarily may hold parameters to be passed to `Vertices.chamfer` where supported by external functions.\n * \n * See `Vertices.chamfer` for possible parameters this object may hold.\n * \n * Currently only functions inside `Matter.Bodies` provide a utility using this property as a vertices pre-processing option.\n * \n * Alternatively consider using `Vertices.chamfer` directly on vertices before passing them to a body creation function.\n * \n * @property chamfer\n * @type object|null|undefined\n */\n\n})();\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Events` module contains methods to fire and listen to events on other objects.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Events\n*/\n\nvar Events = {};\n\nmodule.exports = Events;\n\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Subscribes a callback function to the given object's `eventName`.\n * @method on\n * @param {} object\n * @param {string} eventNames\n * @param {function} callback\n */\n Events.on = function(object, eventNames, callback) {\n var names = eventNames.split(' '),\n name;\n\n for (var i = 0; i < names.length; i++) {\n name = names[i];\n object.events = object.events || {};\n object.events[name] = object.events[name] || [];\n object.events[name].push(callback);\n }\n\n return callback;\n };\n\n /**\n * Removes the given event callback. If no callback, clears all callbacks in `eventNames`. If no `eventNames`, clears all events.\n * @method off\n * @param {} object\n * @param {string} eventNames\n * @param {function} callback\n */\n Events.off = function(object, eventNames, callback) {\n if (!eventNames) {\n object.events = {};\n return;\n }\n\n // handle Events.off(object, callback)\n if (typeof eventNames === 'function') {\n callback = eventNames;\n eventNames = Common.keys(object.events).join(' ');\n }\n\n var names = eventNames.split(' ');\n\n for (var i = 0; i < names.length; i++) {\n var callbacks = object.events[names[i]],\n newCallbacks = [];\n\n if (callback && callbacks) {\n for (var j = 0; j < callbacks.length; j++) {\n if (callbacks[j] !== callback)\n newCallbacks.push(callbacks[j]);\n }\n }\n\n object.events[names[i]] = newCallbacks;\n }\n };\n\n /**\n * Fires all the callbacks subscribed to the given object's `eventName`, in the order they subscribed, if any.\n * @method trigger\n * @param {} object\n * @param {string} eventNames\n * @param {} event\n */\n Events.trigger = function(object, eventNames, event) {\n var names,\n name,\n callbacks,\n eventClone;\n\n var events = object.events;\n \n if (events && Common.keys(events).length > 0) {\n if (!event)\n event = {};\n\n names = eventNames.split(' ');\n\n for (var i = 0; i < names.length; i++) {\n name = names[i];\n callbacks = events[name];\n\n if (callbacks) {\n eventClone = Common.clone(event, false);\n eventClone.name = name;\n eventClone.source = object;\n\n for (var j = 0; j < callbacks.length; j++) {\n callbacks[j].apply(object, [eventClone]);\n }\n }\n }\n }\n };\n\n})();\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* A composite is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite` objects.\n*\n* They are a container that can represent complex objects made of multiple parts, even if they are not physically connected.\n* A composite could contain anything from a single body all the way up to a whole world.\n* \n* When making any changes to composites, use the included functions rather than changing their properties directly.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Composite\n*/\n\nvar Composite = {};\n\nmodule.exports = Composite;\n\nvar Events = __webpack_require__(5);\nvar Common = __webpack_require__(0);\nvar Bounds = __webpack_require__(1);\nvar Body = __webpack_require__(4);\n\n(function() {\n\n /**\n * Creates a new composite. The options parameter is an object that specifies any properties you wish to override the defaults.\n * See the properites section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {} [options]\n * @return {composite} A new composite\n */\n Composite.create = function(options) {\n return Common.extend({ \n id: Common.nextId(),\n type: 'composite',\n parent: null,\n isModified: false,\n bodies: [], \n constraints: [], \n composites: [],\n label: 'Composite',\n plugin: {},\n cache: {\n allBodies: null,\n allConstraints: null,\n allComposites: null\n }\n }, options);\n };\n\n /**\n * Sets the composite's `isModified` flag. \n * If `updateParents` is true, all parents will be set (default: false).\n * If `updateChildren` is true, all children will be set (default: false).\n * @private\n * @method setModified\n * @param {composite} composite\n * @param {boolean} isModified\n * @param {boolean} [updateParents=false]\n * @param {boolean} [updateChildren=false]\n */\n Composite.setModified = function(composite, isModified, updateParents, updateChildren) {\n composite.isModified = isModified;\n\n if (isModified && composite.cache) {\n composite.cache.allBodies = null;\n composite.cache.allConstraints = null;\n composite.cache.allComposites = null;\n }\n\n if (updateParents && composite.parent) {\n Composite.setModified(composite.parent, isModified, updateParents, updateChildren);\n }\n\n if (updateChildren) {\n for (var i = 0; i < composite.composites.length; i++) {\n var childComposite = composite.composites[i];\n Composite.setModified(childComposite, isModified, updateParents, updateChildren);\n }\n }\n };\n\n /**\n * Generic single or multi-add function. Adds a single or an array of body(s), constraint(s) or composite(s) to the given composite.\n * Triggers `beforeAdd` and `afterAdd` events on the `composite`.\n * @method add\n * @param {composite} composite\n * @param {object|array} object A single or an array of body(s), constraint(s) or composite(s)\n * @return {composite} The original composite with the objects added\n */\n Composite.add = function(composite, object) {\n var objects = [].concat(object);\n\n Events.trigger(composite, 'beforeAdd', { object: object });\n\n for (var i = 0; i < objects.length; i++) {\n var obj = objects[i];\n\n switch (obj.type) {\n\n case 'body':\n // skip adding compound parts\n if (obj.parent !== obj) {\n Common.warn('Composite.add: skipped adding a compound body part (you must add its parent instead)');\n break;\n }\n\n Composite.addBody(composite, obj);\n break;\n case 'constraint':\n Composite.addConstraint(composite, obj);\n break;\n case 'composite':\n Composite.addComposite(composite, obj);\n break;\n case 'mouseConstraint':\n Composite.addConstraint(composite, obj.constraint);\n break;\n\n }\n }\n\n Events.trigger(composite, 'afterAdd', { object: object });\n\n return composite;\n };\n\n /**\n * Generic remove function. Removes one or many body(s), constraint(s) or a composite(s) to the given composite.\n * Optionally searching its children recursively.\n * Triggers `beforeRemove` and `afterRemove` events on the `composite`.\n * @method remove\n * @param {composite} composite\n * @param {object|array} object\n * @param {boolean} [deep=false]\n * @return {composite} The original composite with the objects removed\n */\n Composite.remove = function(composite, object, deep) {\n var objects = [].concat(object);\n\n Events.trigger(composite, 'beforeRemove', { object: object });\n\n for (var i = 0; i < objects.length; i++) {\n var obj = objects[i];\n\n switch (obj.type) {\n\n case 'body':\n Composite.removeBody(composite, obj, deep);\n break;\n case 'constraint':\n Composite.removeConstraint(composite, obj, deep);\n break;\n case 'composite':\n Composite.removeComposite(composite, obj, deep);\n break;\n case 'mouseConstraint':\n Composite.removeConstraint(composite, obj.constraint);\n break;\n\n }\n }\n\n Events.trigger(composite, 'afterRemove', { object: object });\n\n return composite;\n };\n\n /**\n * Adds a composite to the given composite.\n * @private\n * @method addComposite\n * @param {composite} compositeA\n * @param {composite} compositeB\n * @return {composite} The original compositeA with the objects from compositeB added\n */\n Composite.addComposite = function(compositeA, compositeB) {\n compositeA.composites.push(compositeB);\n compositeB.parent = compositeA;\n Composite.setModified(compositeA, true, true, false);\n return compositeA;\n };\n\n /**\n * Removes a composite from the given composite, and optionally searching its children recursively.\n * @private\n * @method removeComposite\n * @param {composite} compositeA\n * @param {composite} compositeB\n * @param {boolean} [deep=false]\n * @return {composite} The original compositeA with the composite removed\n */\n Composite.removeComposite = function(compositeA, compositeB, deep) {\n var position = Common.indexOf(compositeA.composites, compositeB);\n\n if (position !== -1) {\n var bodies = Composite.allBodies(compositeB);\n\n Composite.removeCompositeAt(compositeA, position);\n\n for (var i = 0; i < bodies.length; i++) {\n bodies[i].sleepCounter = 0;\n }\n }\n\n if (deep) {\n for (var i = 0; i < compositeA.composites.length; i++){\n Composite.removeComposite(compositeA.composites[i], compositeB, true);\n }\n }\n\n return compositeA;\n };\n\n /**\n * Removes a composite from the given composite.\n * @private\n * @method removeCompositeAt\n * @param {composite} composite\n * @param {number} position\n * @return {composite} The original composite with the composite removed\n */\n Composite.removeCompositeAt = function(composite, position) {\n composite.composites.splice(position, 1);\n Composite.setModified(composite, true, true, false);\n return composite;\n };\n\n /**\n * Adds a body to the given composite.\n * @private\n * @method addBody\n * @param {composite} composite\n * @param {body} body\n * @return {composite} The original composite with the body added\n */\n Composite.addBody = function(composite, body) {\n composite.bodies.push(body);\n Composite.setModified(composite, true, true, false);\n return composite;\n };\n\n /**\n * Removes a body from the given composite, and optionally searching its children recursively.\n * @private\n * @method removeBody\n * @param {composite} composite\n * @param {body} body\n * @param {boolean} [deep=false]\n * @return {composite} The original composite with the body removed\n */\n Composite.removeBody = function(composite, body, deep) {\n var position = Common.indexOf(composite.bodies, body);\n\n if (position !== -1) {\n Composite.removeBodyAt(composite, position);\n body.sleepCounter = 0;\n }\n\n if (deep) {\n for (var i = 0; i < composite.composites.length; i++){\n Composite.removeBody(composite.composites[i], body, true);\n }\n }\n\n return composite;\n };\n\n /**\n * Removes a body from the given composite.\n * @private\n * @method removeBodyAt\n * @param {composite} composite\n * @param {number} position\n * @return {composite} The original composite with the body removed\n */\n Composite.removeBodyAt = function(composite, position) {\n composite.bodies.splice(position, 1);\n Composite.setModified(composite, true, true, false);\n return composite;\n };\n\n /**\n * Adds a constraint to the given composite.\n * @private\n * @method addConstraint\n * @param {composite} composite\n * @param {constraint} constraint\n * @return {composite} The original composite with the constraint added\n */\n Composite.addConstraint = function(composite, constraint) {\n composite.constraints.push(constraint);\n Composite.setModified(composite, true, true, false);\n return composite;\n };\n\n /**\n * Removes a constraint from the given composite, and optionally searching its children recursively.\n * @private\n * @method removeConstraint\n * @param {composite} composite\n * @param {constraint} constraint\n * @param {boolean} [deep=false]\n * @return {composite} The original composite with the constraint removed\n */\n Composite.removeConstraint = function(composite, constraint, deep) {\n var position = Common.indexOf(composite.constraints, constraint);\n \n if (position !== -1) {\n Composite.removeConstraintAt(composite, position);\n }\n\n if (deep) {\n for (var i = 0; i < composite.composites.length; i++){\n Composite.removeConstraint(composite.composites[i], constraint, true);\n }\n }\n\n return composite;\n };\n\n /**\n * Removes a body from the given composite.\n * @private\n * @method removeConstraintAt\n * @param {composite} composite\n * @param {number} position\n * @return {composite} The original composite with the constraint removed\n */\n Composite.removeConstraintAt = function(composite, position) {\n composite.constraints.splice(position, 1);\n Composite.setModified(composite, true, true, false);\n return composite;\n };\n\n /**\n * Removes all bodies, constraints and composites from the given composite.\n * Optionally clearing its children recursively.\n * @method clear\n * @param {composite} composite\n * @param {boolean} keepStatic\n * @param {boolean} [deep=false]\n */\n Composite.clear = function(composite, keepStatic, deep) {\n if (deep) {\n for (var i = 0; i < composite.composites.length; i++){\n Composite.clear(composite.composites[i], keepStatic, true);\n }\n }\n \n if (keepStatic) {\n composite.bodies = composite.bodies.filter(function(body) { return body.isStatic; });\n } else {\n composite.bodies.length = 0;\n }\n\n composite.constraints.length = 0;\n composite.composites.length = 0;\n\n Composite.setModified(composite, true, true, false);\n\n return composite;\n };\n\n /**\n * Returns all bodies in the given composite, including all bodies in its children, recursively.\n * @method allBodies\n * @param {composite} composite\n * @return {body[]} All the bodies\n */\n Composite.allBodies = function(composite) {\n if (composite.cache && composite.cache.allBodies) {\n return composite.cache.allBodies;\n }\n\n var bodies = [].concat(composite.bodies);\n\n for (var i = 0; i < composite.composites.length; i++)\n bodies = bodies.concat(Composite.allBodies(composite.composites[i]));\n\n if (composite.cache) {\n composite.cache.allBodies = bodies;\n }\n\n return bodies;\n };\n\n /**\n * Returns all constraints in the given composite, including all constraints in its children, recursively.\n * @method allConstraints\n * @param {composite} composite\n * @return {constraint[]} All the constraints\n */\n Composite.allConstraints = function(composite) {\n if (composite.cache && composite.cache.allConstraints) {\n return composite.cache.allConstraints;\n }\n\n var constraints = [].concat(composite.constraints);\n\n for (var i = 0; i < composite.composites.length; i++)\n constraints = constraints.concat(Composite.allConstraints(composite.composites[i]));\n\n if (composite.cache) {\n composite.cache.allConstraints = constraints;\n }\n\n return constraints;\n };\n\n /**\n * Returns all composites in the given composite, including all composites in its children, recursively.\n * @method allComposites\n * @param {composite} composite\n * @return {composite[]} All the composites\n */\n Composite.allComposites = function(composite) {\n if (composite.cache && composite.cache.allComposites) {\n return composite.cache.allComposites;\n }\n\n var composites = [].concat(composite.composites);\n\n for (var i = 0; i < composite.composites.length; i++)\n composites = composites.concat(Composite.allComposites(composite.composites[i]));\n\n if (composite.cache) {\n composite.cache.allComposites = composites;\n }\n\n return composites;\n };\n\n /**\n * Searches the composite recursively for an object matching the type and id supplied, null if not found.\n * @method get\n * @param {composite} composite\n * @param {number} id\n * @param {string} type\n * @return {object} The requested object, if found\n */\n Composite.get = function(composite, id, type) {\n var objects,\n object;\n\n switch (type) {\n case 'body':\n objects = Composite.allBodies(composite);\n break;\n case 'constraint':\n objects = Composite.allConstraints(composite);\n break;\n case 'composite':\n objects = Composite.allComposites(composite).concat(composite);\n break;\n }\n\n if (!objects)\n return null;\n\n object = objects.filter(function(object) { \n return object.id.toString() === id.toString(); \n });\n\n return object.length === 0 ? null : object[0];\n };\n\n /**\n * Moves the given object(s) from compositeA to compositeB (equal to a remove followed by an add).\n * @method move\n * @param {compositeA} compositeA\n * @param {object[]} objects\n * @param {compositeB} compositeB\n * @return {composite} Returns compositeA\n */\n Composite.move = function(compositeA, objects, compositeB) {\n Composite.remove(compositeA, objects);\n Composite.add(compositeB, objects);\n return compositeA;\n };\n\n /**\n * Assigns new ids for all objects in the composite, recursively.\n * @method rebase\n * @param {composite} composite\n * @return {composite} Returns composite\n */\n Composite.rebase = function(composite) {\n var objects = Composite.allBodies(composite)\n .concat(Composite.allConstraints(composite))\n .concat(Composite.allComposites(composite));\n\n for (var i = 0; i < objects.length; i++) {\n objects[i].id = Common.nextId();\n }\n\n return composite;\n };\n\n /**\n * Translates all children in the composite by a given vector relative to their current positions, \n * without imparting any velocity.\n * @method translate\n * @param {composite} composite\n * @param {vector} translation\n * @param {bool} [recursive=true]\n */\n Composite.translate = function(composite, translation, recursive) {\n var bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\n\n for (var i = 0; i < bodies.length; i++) {\n Body.translate(bodies[i], translation);\n }\n\n return composite;\n };\n\n /**\n * Rotates all children in the composite by a given angle about the given point, without imparting any angular velocity.\n * @method rotate\n * @param {composite} composite\n * @param {number} rotation\n * @param {vector} point\n * @param {bool} [recursive=true]\n */\n Composite.rotate = function(composite, rotation, point, recursive) {\n var cos = Math.cos(rotation),\n sin = Math.sin(rotation),\n bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n dx = body.position.x - point.x,\n dy = body.position.y - point.y;\n \n Body.setPosition(body, {\n x: point.x + (dx * cos - dy * sin),\n y: point.y + (dx * sin + dy * cos)\n });\n\n Body.rotate(body, rotation);\n }\n\n return composite;\n };\n\n /**\n * Scales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point.\n * @method scale\n * @param {composite} composite\n * @param {number} scaleX\n * @param {number} scaleY\n * @param {vector} point\n * @param {bool} [recursive=true]\n */\n Composite.scale = function(composite, scaleX, scaleY, point, recursive) {\n var bodies = recursive ? Composite.allBodies(composite) : composite.bodies;\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n dx = body.position.x - point.x,\n dy = body.position.y - point.y;\n \n Body.setPosition(body, {\n x: point.x + dx * scaleX,\n y: point.y + dy * scaleY\n });\n\n Body.scale(body, scaleX, scaleY);\n }\n\n return composite;\n };\n\n /**\n * Returns the union of the bounds of all of the composite's bodies.\n * @method bounds\n * @param {composite} composite The composite.\n * @returns {bounds} The composite bounds.\n */\n Composite.bounds = function(composite) {\n var bodies = Composite.allBodies(composite),\n vertices = [];\n\n for (var i = 0; i < bodies.length; i += 1) {\n var body = bodies[i];\n vertices.push(body.bounds.min, body.bounds.max);\n }\n\n return Bounds.create(vertices);\n };\n\n /*\n *\n * Events Documentation\n *\n */\n\n /**\n * Fired when a call to `Composite.add` is made, before objects have been added.\n *\n * @event beforeAdd\n * @param {} event An event object\n * @param {} event.object The object(s) to be added (may be a single body, constraint, composite or a mixed array of these)\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when a call to `Composite.add` is made, after objects have been added.\n *\n * @event afterAdd\n * @param {} event An event object\n * @param {} event.object The object(s) that have been added (may be a single body, constraint, composite or a mixed array of these)\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when a call to `Composite.remove` is made, before objects have been removed.\n *\n * @event beforeRemove\n * @param {} event An event object\n * @param {} event.object The object(s) to be removed (may be a single body, constraint, composite or a mixed array of these)\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when a call to `Composite.remove` is made, after objects have been removed.\n *\n * @event afterRemove\n * @param {} event An event object\n * @param {} event.object The object(s) that have been removed (may be a single body, constraint, composite or a mixed array of these)\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`.\n *\n * @property id\n * @type number\n */\n\n /**\n * A `String` denoting the type of object.\n *\n * @property type\n * @type string\n * @default \"composite\"\n * @readOnly\n */\n\n /**\n * An arbitrary `String` name to help the user identify and manage composites.\n *\n * @property label\n * @type string\n * @default \"Composite\"\n */\n\n /**\n * A flag that specifies whether the composite has been modified during the current step.\n * This is automatically managed when bodies, constraints or composites are added or removed.\n *\n * @property isModified\n * @type boolean\n * @default false\n */\n\n /**\n * The `Composite` that is the parent of this composite. It is automatically managed by the `Matter.Composite` methods.\n *\n * @property parent\n * @type composite\n * @default null\n */\n\n /**\n * An array of `Body` that are _direct_ children of this composite.\n * To add or remove bodies you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\n * If you wish to recursively find all descendants, you should use the `Composite.allBodies` method.\n *\n * @property bodies\n * @type body[]\n * @default []\n */\n\n /**\n * An array of `Constraint` that are _direct_ children of this composite.\n * To add or remove constraints you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\n * If you wish to recursively find all descendants, you should use the `Composite.allConstraints` method.\n *\n * @property constraints\n * @type constraint[]\n * @default []\n */\n\n /**\n * An array of `Composite` that are _direct_ children of this composite.\n * To add or remove composites you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property.\n * If you wish to recursively find all descendants, you should use the `Composite.allComposites` method.\n *\n * @property composites\n * @type composite[]\n * @default []\n */\n\n /**\n * An object reserved for storing plugin-specific properties.\n *\n * @property plugin\n * @type {}\n */\n\n /**\n * An object used for storing cached results for performance reasons.\n * This is used internally only and is automatically managed.\n *\n * @private\n * @property cache\n * @type {}\n */\n\n})();\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies.\n*\n* @class Sleeping\n*/\n\nvar Sleeping = {};\n\nmodule.exports = Sleeping;\n\nvar Body = __webpack_require__(4);\nvar Events = __webpack_require__(5);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n Sleeping._motionWakeThreshold = 0.18;\n Sleeping._motionSleepThreshold = 0.08;\n Sleeping._minBias = 0.9;\n\n /**\n * Puts bodies to sleep or wakes them up depending on their motion.\n * @method update\n * @param {body[]} bodies\n * @param {number} delta\n */\n Sleeping.update = function(bodies, delta) {\n var timeScale = delta / Common._baseDelta,\n motionSleepThreshold = Sleeping._motionSleepThreshold;\n \n // update bodies sleeping status\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n speed = Body.getSpeed(body),\n angularSpeed = Body.getAngularSpeed(body),\n motion = speed * speed + angularSpeed * angularSpeed;\n\n // wake up bodies if they have a force applied\n if (body.force.x !== 0 || body.force.y !== 0) {\n Sleeping.set(body, false);\n continue;\n }\n\n var minMotion = Math.min(body.motion, motion),\n maxMotion = Math.max(body.motion, motion);\n \n // biased average motion estimation between frames\n body.motion = Sleeping._minBias * minMotion + (1 - Sleeping._minBias) * maxMotion;\n\n if (body.sleepThreshold > 0 && body.motion < motionSleepThreshold) {\n body.sleepCounter += 1;\n \n if (body.sleepCounter >= body.sleepThreshold / timeScale) {\n Sleeping.set(body, true);\n }\n } else if (body.sleepCounter > 0) {\n body.sleepCounter -= 1;\n }\n }\n };\n\n /**\n * Given a set of colliding pairs, wakes the sleeping bodies involved.\n * @method afterCollisions\n * @param {pair[]} pairs\n */\n Sleeping.afterCollisions = function(pairs) {\n var motionSleepThreshold = Sleeping._motionSleepThreshold;\n\n // wake up bodies involved in collisions\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n \n // don't wake inactive pairs\n if (!pair.isActive)\n continue;\n\n var collision = pair.collision,\n bodyA = collision.bodyA.parent, \n bodyB = collision.bodyB.parent;\n \n // don't wake if at least one body is static\n if ((bodyA.isSleeping && bodyB.isSleeping) || bodyA.isStatic || bodyB.isStatic)\n continue;\n \n if (bodyA.isSleeping || bodyB.isSleeping) {\n var sleepingBody = (bodyA.isSleeping && !bodyA.isStatic) ? bodyA : bodyB,\n movingBody = sleepingBody === bodyA ? bodyB : bodyA;\n\n if (!sleepingBody.isStatic && movingBody.motion > motionSleepThreshold) {\n Sleeping.set(sleepingBody, false);\n }\n }\n }\n };\n \n /**\n * Set a body as sleeping or awake.\n * @method set\n * @param {body} body\n * @param {boolean} isSleeping\n */\n Sleeping.set = function(body, isSleeping) {\n var wasSleeping = body.isSleeping;\n\n if (isSleeping) {\n body.isSleeping = true;\n body.sleepCounter = body.sleepThreshold;\n\n body.positionImpulse.x = 0;\n body.positionImpulse.y = 0;\n\n body.positionPrev.x = body.position.x;\n body.positionPrev.y = body.position.y;\n\n body.anglePrev = body.angle;\n body.speed = 0;\n body.angularSpeed = 0;\n body.motion = 0;\n\n if (!wasSleeping) {\n Events.trigger(body, 'sleepStart');\n }\n } else {\n body.isSleeping = false;\n body.sleepCounter = 0;\n\n if (wasSleeping) {\n Events.trigger(body, 'sleepEnd');\n }\n }\n };\n\n})();\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Collision` module contains methods for detecting collisions between a given pair of bodies.\n*\n* For efficient detection between a list of bodies, see `Matter.Detector` and `Matter.Query`.\n*\n* See `Matter.Engine` for collision events.\n*\n* @class Collision\n*/\n\nvar Collision = {};\n\nmodule.exports = Collision;\n\nvar Vertices = __webpack_require__(3);\nvar Pair = __webpack_require__(9);\n\n(function() {\n var _supports = [];\n\n var _overlapAB = {\n overlap: 0,\n axis: null\n };\n\n var _overlapBA = {\n overlap: 0,\n axis: null\n };\n\n /**\n * Creates a new collision record.\n * @method create\n * @param {body} bodyA The first body part represented by the collision record\n * @param {body} bodyB The second body part represented by the collision record\n * @return {collision} A new collision record\n */\n Collision.create = function(bodyA, bodyB) {\n return { \n pair: null,\n collided: false,\n bodyA: bodyA,\n bodyB: bodyB,\n parentA: bodyA.parent,\n parentB: bodyB.parent,\n depth: 0,\n normal: { x: 0, y: 0 },\n tangent: { x: 0, y: 0 },\n penetration: { x: 0, y: 0 },\n supports: [null, null],\n supportCount: 0\n };\n };\n\n /**\n * Detect collision between two bodies.\n * @method collides\n * @param {body} bodyA\n * @param {body} bodyB\n * @param {pairs} [pairs] Optionally reuse collision records from existing pairs.\n * @return {collision|null} A collision record if detected, otherwise null\n */\n Collision.collides = function(bodyA, bodyB, pairs) {\n Collision._overlapAxes(_overlapAB, bodyA.vertices, bodyB.vertices, bodyA.axes);\n\n if (_overlapAB.overlap <= 0) {\n return null;\n }\n\n Collision._overlapAxes(_overlapBA, bodyB.vertices, bodyA.vertices, bodyB.axes);\n\n if (_overlapBA.overlap <= 0) {\n return null;\n }\n\n // reuse collision records for gc efficiency\n var pair = pairs && pairs.table[Pair.id(bodyA, bodyB)],\n collision;\n\n if (!pair) {\n collision = Collision.create(bodyA, bodyB);\n collision.collided = true;\n collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB;\n collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA;\n collision.parentA = collision.bodyA.parent;\n collision.parentB = collision.bodyB.parent;\n } else {\n collision = pair.collision;\n }\n\n bodyA = collision.bodyA;\n bodyB = collision.bodyB;\n\n var minOverlap;\n\n if (_overlapAB.overlap < _overlapBA.overlap) {\n minOverlap = _overlapAB;\n } else {\n minOverlap = _overlapBA;\n }\n\n var normal = collision.normal,\n tangent = collision.tangent,\n penetration = collision.penetration,\n supports = collision.supports,\n depth = minOverlap.overlap,\n minAxis = minOverlap.axis,\n normalX = minAxis.x,\n normalY = minAxis.y,\n deltaX = bodyB.position.x - bodyA.position.x,\n deltaY = bodyB.position.y - bodyA.position.y;\n\n // ensure normal is facing away from bodyA\n if (normalX * deltaX + normalY * deltaY >= 0) {\n normalX = -normalX;\n normalY = -normalY;\n }\n\n normal.x = normalX;\n normal.y = normalY;\n \n tangent.x = -normalY;\n tangent.y = normalX;\n\n penetration.x = normalX * depth;\n penetration.y = normalY * depth;\n\n collision.depth = depth;\n\n // find support points, there is always either exactly one or two\n var supportsB = Collision._findSupports(bodyA, bodyB, normal, 1),\n supportCount = 0;\n\n // find the supports from bodyB that are inside bodyA\n if (Vertices.contains(bodyA.vertices, supportsB[0])) {\n supports[supportCount++] = supportsB[0];\n }\n\n if (Vertices.contains(bodyA.vertices, supportsB[1])) {\n supports[supportCount++] = supportsB[1];\n }\n\n // find the supports from bodyA that are inside bodyB\n if (supportCount < 2) {\n var supportsA = Collision._findSupports(bodyB, bodyA, normal, -1);\n\n if (Vertices.contains(bodyB.vertices, supportsA[0])) {\n supports[supportCount++] = supportsA[0];\n }\n\n if (supportCount < 2 && Vertices.contains(bodyB.vertices, supportsA[1])) {\n supports[supportCount++] = supportsA[1];\n }\n }\n\n // account for the edge case of overlapping but no vertex containment\n if (supportCount === 0) {\n supports[supportCount++] = supportsB[0];\n }\n\n // update support count\n collision.supportCount = supportCount;\n\n return collision;\n };\n\n /**\n * Find the overlap between two sets of vertices.\n * @method _overlapAxes\n * @private\n * @param {object} result\n * @param {vertices} verticesA\n * @param {vertices} verticesB\n * @param {axes} axes\n */\n Collision._overlapAxes = function(result, verticesA, verticesB, axes) {\n var verticesALength = verticesA.length,\n verticesBLength = verticesB.length,\n verticesAX = verticesA[0].x,\n verticesAY = verticesA[0].y,\n verticesBX = verticesB[0].x,\n verticesBY = verticesB[0].y,\n axesLength = axes.length,\n overlapMin = Number.MAX_VALUE,\n overlapAxisNumber = 0,\n overlap,\n overlapAB,\n overlapBA,\n dot,\n i,\n j;\n\n for (i = 0; i < axesLength; i++) {\n var axis = axes[i],\n axisX = axis.x,\n axisY = axis.y,\n minA = verticesAX * axisX + verticesAY * axisY,\n minB = verticesBX * axisX + verticesBY * axisY,\n maxA = minA,\n maxB = minB;\n \n for (j = 1; j < verticesALength; j += 1) {\n dot = verticesA[j].x * axisX + verticesA[j].y * axisY;\n\n if (dot > maxA) { \n maxA = dot;\n } else if (dot < minA) { \n minA = dot;\n }\n }\n\n for (j = 1; j < verticesBLength; j += 1) {\n dot = verticesB[j].x * axisX + verticesB[j].y * axisY;\n\n if (dot > maxB) { \n maxB = dot;\n } else if (dot < minB) { \n minB = dot;\n }\n }\n\n overlapAB = maxA - minB;\n overlapBA = maxB - minA;\n overlap = overlapAB < overlapBA ? overlapAB : overlapBA;\n\n if (overlap < overlapMin) {\n overlapMin = overlap;\n overlapAxisNumber = i;\n\n if (overlap <= 0) {\n // can not be intersecting\n break;\n }\n } \n }\n\n result.axis = axes[overlapAxisNumber];\n result.overlap = overlapMin;\n };\n\n /**\n * Finds supporting vertices given two bodies along a given direction using hill-climbing.\n * @method _findSupports\n * @private\n * @param {body} bodyA\n * @param {body} bodyB\n * @param {vector} normal\n * @param {number} direction\n * @return [vector]\n */\n Collision._findSupports = function(bodyA, bodyB, normal, direction) {\n var vertices = bodyB.vertices,\n verticesLength = vertices.length,\n bodyAPositionX = bodyA.position.x,\n bodyAPositionY = bodyA.position.y,\n normalX = normal.x * direction,\n normalY = normal.y * direction,\n vertexA = vertices[0],\n vertexB = vertexA,\n nearestDistance = normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y),\n vertexC,\n distance,\n j;\n\n // find deepest vertex relative to the axis\n for (j = 1; j < verticesLength; j += 1) {\n vertexB = vertices[j];\n distance = normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y);\n\n // convex hill-climbing\n if (distance < nearestDistance) {\n nearestDistance = distance;\n vertexA = vertexB;\n }\n }\n\n // measure next vertex\n vertexC = vertices[(verticesLength + vertexA.index - 1) % verticesLength];\n nearestDistance = normalX * (bodyAPositionX - vertexC.x) + normalY * (bodyAPositionY - vertexC.y);\n\n // compare with previous vertex\n vertexB = vertices[(vertexA.index + 1) % verticesLength];\n if (normalX * (bodyAPositionX - vertexB.x) + normalY * (bodyAPositionY - vertexB.y) < nearestDistance) {\n _supports[0] = vertexA;\n _supports[1] = vertexB;\n\n return _supports;\n }\n\n _supports[0] = vertexA;\n _supports[1] = vertexC;\n\n return _supports;\n };\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * A reference to the pair using this collision record, if there is one.\n *\n * @property pair\n * @type {pair|null}\n * @default null\n */\n\n /**\n * A flag that indicates if the bodies were colliding when the collision was last updated.\n * \n * @property collided\n * @type boolean\n * @default false\n */\n\n /**\n * The first body part represented by the collision (see also `collision.parentA`).\n * \n * @property bodyA\n * @type body\n */\n\n /**\n * The second body part represented by the collision (see also `collision.parentB`).\n * \n * @property bodyB\n * @type body\n */\n\n /**\n * The first body represented by the collision (i.e. `collision.bodyA.parent`).\n * \n * @property parentA\n * @type body\n */\n\n /**\n * The second body represented by the collision (i.e. `collision.bodyB.parent`).\n * \n * @property parentB\n * @type body\n */\n\n /**\n * A `Number` that represents the minimum separating distance between the bodies along the collision normal.\n *\n * @readOnly\n * @property depth\n * @type number\n * @default 0\n */\n\n /**\n * A normalised `Vector` that represents the direction between the bodies that provides the minimum separating distance.\n *\n * @property normal\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A normalised `Vector` that is the tangent direction to the collision normal.\n *\n * @property tangent\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A `Vector` that represents the direction and depth of the collision.\n *\n * @property penetration\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * An array of body vertices that represent the support points in the collision.\n * \n * _Note:_ Only the first `collision.supportCount` items of `collision.supports` are active.\n * Therefore use `collision.supportCount` instead of `collision.supports.length` when iterating the active supports.\n * \n * These are the deepest vertices (along the collision normal) of each body that are contained by the other body's vertices.\n *\n * @property supports\n * @type vector[]\n * @default []\n */\n\n /**\n * The number of active supports for this collision found in `collision.supports`.\n * \n * _Note:_ Only the first `collision.supportCount` items of `collision.supports` are active.\n * Therefore use `collision.supportCount` instead of `collision.supports.length` when iterating the active supports.\n *\n * @property supportCount\n * @type number\n * @default 0\n */\n\n})();\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Pair` module contains methods for creating and manipulating collision pairs.\n*\n* @class Pair\n*/\n\nvar Pair = {};\n\nmodule.exports = Pair;\n\nvar Contact = __webpack_require__(16);\n\n(function() {\n \n /**\n * Creates a pair.\n * @method create\n * @param {collision} collision\n * @param {number} timestamp\n * @return {pair} A new pair\n */\n Pair.create = function(collision, timestamp) {\n var bodyA = collision.bodyA,\n bodyB = collision.bodyB;\n\n var pair = {\n id: Pair.id(bodyA, bodyB),\n bodyA: bodyA,\n bodyB: bodyB,\n collision: collision,\n contacts: [Contact.create(), Contact.create()],\n contactCount: 0,\n separation: 0,\n isActive: true,\n isSensor: bodyA.isSensor || bodyB.isSensor,\n timeCreated: timestamp,\n timeUpdated: timestamp,\n inverseMass: 0,\n friction: 0,\n frictionStatic: 0,\n restitution: 0,\n slop: 0\n };\n\n Pair.update(pair, collision, timestamp);\n\n return pair;\n };\n\n /**\n * Updates a pair given a collision.\n * @method update\n * @param {pair} pair\n * @param {collision} collision\n * @param {number} timestamp\n */\n Pair.update = function(pair, collision, timestamp) {\n var supports = collision.supports,\n supportCount = collision.supportCount,\n contacts = pair.contacts,\n parentA = collision.parentA,\n parentB = collision.parentB;\n \n pair.isActive = true;\n pair.timeUpdated = timestamp;\n pair.collision = collision;\n pair.separation = collision.depth;\n pair.inverseMass = parentA.inverseMass + parentB.inverseMass;\n pair.friction = parentA.friction < parentB.friction ? parentA.friction : parentB.friction;\n pair.frictionStatic = parentA.frictionStatic > parentB.frictionStatic ? parentA.frictionStatic : parentB.frictionStatic;\n pair.restitution = parentA.restitution > parentB.restitution ? parentA.restitution : parentB.restitution;\n pair.slop = parentA.slop > parentB.slop ? parentA.slop : parentB.slop;\n\n pair.contactCount = supportCount;\n collision.pair = pair;\n\n var supportA = supports[0],\n contactA = contacts[0],\n supportB = supports[1],\n contactB = contacts[1];\n\n // match contacts to supports\n if (contactB.vertex === supportA || contactA.vertex === supportB) {\n contacts[1] = contactA;\n contacts[0] = contactA = contactB;\n contactB = contacts[1];\n }\n\n // update contacts\n contactA.vertex = supportA;\n contactB.vertex = supportB;\n };\n \n /**\n * Set a pair as active or inactive.\n * @method setActive\n * @param {pair} pair\n * @param {bool} isActive\n * @param {number} timestamp\n */\n Pair.setActive = function(pair, isActive, timestamp) {\n if (isActive) {\n pair.isActive = true;\n pair.timeUpdated = timestamp;\n } else {\n pair.isActive = false;\n pair.contactCount = 0;\n }\n };\n\n /**\n * Get the id for the given pair.\n * @method id\n * @param {body} bodyA\n * @param {body} bodyB\n * @return {string} Unique pairId\n */\n Pair.id = function(bodyA, bodyB) {\n return bodyA.id < bodyB.id ? bodyA.id.toString(36) + ':' + bodyB.id.toString(36) \n : bodyB.id.toString(36) + ':' + bodyA.id.toString(36);\n };\n\n})();\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Constraint` module contains methods for creating and manipulating constraints.\n* Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position).\n* The stiffness of constraints can be modified to create springs or elastic.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Constraint\n*/\n\nvar Constraint = {};\n\nmodule.exports = Constraint;\n\nvar Vertices = __webpack_require__(3);\nvar Vector = __webpack_require__(2);\nvar Sleeping = __webpack_require__(7);\nvar Bounds = __webpack_require__(1);\nvar Axes = __webpack_require__(11);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n Constraint._warming = 0.4;\n Constraint._torqueDampen = 1;\n Constraint._minLength = 0.000001;\n\n /**\n * Creates a new constraint.\n * All properties have default values, and many are pre-calculated automatically based on other properties.\n * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness` value (e.g. `0.7` or above).\n * If the constraint is unstable, try lowering the `stiffness` value and / or increasing `engine.constraintIterations`.\n * For compound bodies, constraints must be applied to the parent body (not one of its parts).\n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {} options\n * @return {constraint} constraint\n */\n Constraint.create = function(options) {\n var constraint = options;\n\n // if bodies defined but no points, use body centre\n if (constraint.bodyA && !constraint.pointA)\n constraint.pointA = { x: 0, y: 0 };\n if (constraint.bodyB && !constraint.pointB)\n constraint.pointB = { x: 0, y: 0 };\n\n // calculate static length using initial world space points\n var initialPointA = constraint.bodyA ? Vector.add(constraint.bodyA.position, constraint.pointA) : constraint.pointA,\n initialPointB = constraint.bodyB ? Vector.add(constraint.bodyB.position, constraint.pointB) : constraint.pointB,\n length = Vector.magnitude(Vector.sub(initialPointA, initialPointB));\n \n constraint.length = typeof constraint.length !== 'undefined' ? constraint.length : length;\n\n // option defaults\n constraint.id = constraint.id || Common.nextId();\n constraint.label = constraint.label || 'Constraint';\n constraint.type = 'constraint';\n constraint.stiffness = constraint.stiffness || (constraint.length > 0 ? 1 : 0.7);\n constraint.damping = constraint.damping || 0;\n constraint.angularStiffness = constraint.angularStiffness || 0;\n constraint.angleA = constraint.bodyA ? constraint.bodyA.angle : constraint.angleA;\n constraint.angleB = constraint.bodyB ? constraint.bodyB.angle : constraint.angleB;\n constraint.plugin = {};\n\n // render\n var render = {\n visible: true,\n lineWidth: 2,\n strokeStyle: '#ffffff',\n type: 'line',\n anchors: true\n };\n\n if (constraint.length === 0 && constraint.stiffness > 0.1) {\n render.type = 'pin';\n render.anchors = false;\n } else if (constraint.stiffness < 0.9) {\n render.type = 'spring';\n }\n\n constraint.render = Common.extend(render, constraint.render);\n\n return constraint;\n };\n\n /**\n * Prepares for solving by constraint warming.\n * @private\n * @method preSolveAll\n * @param {body[]} bodies\n */\n Constraint.preSolveAll = function(bodies) {\n for (var i = 0; i < bodies.length; i += 1) {\n var body = bodies[i],\n impulse = body.constraintImpulse;\n\n if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) {\n continue;\n }\n\n body.position.x += impulse.x;\n body.position.y += impulse.y;\n body.angle += impulse.angle;\n }\n };\n\n /**\n * Solves all constraints in a list of collisions.\n * @private\n * @method solveAll\n * @param {constraint[]} constraints\n * @param {number} delta\n */\n Constraint.solveAll = function(constraints, delta) {\n var timeScale = Common.clamp(delta / Common._baseDelta, 0, 1);\n\n // Solve fixed constraints first.\n for (var i = 0; i < constraints.length; i += 1) {\n var constraint = constraints[i],\n fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic),\n fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic);\n\n if (fixedA || fixedB) {\n Constraint.solve(constraints[i], timeScale);\n }\n }\n\n // Solve free constraints last.\n for (i = 0; i < constraints.length; i += 1) {\n constraint = constraints[i];\n fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic);\n fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic);\n\n if (!fixedA && !fixedB) {\n Constraint.solve(constraints[i], timeScale);\n }\n }\n };\n\n /**\n * Solves a distance constraint with Gauss-Siedel method.\n * @private\n * @method solve\n * @param {constraint} constraint\n * @param {number} timeScale\n */\n Constraint.solve = function(constraint, timeScale) {\n var bodyA = constraint.bodyA,\n bodyB = constraint.bodyB,\n pointA = constraint.pointA,\n pointB = constraint.pointB;\n\n if (!bodyA && !bodyB)\n return;\n\n // update reference angle\n if (bodyA && !bodyA.isStatic) {\n Vector.rotate(pointA, bodyA.angle - constraint.angleA, pointA);\n constraint.angleA = bodyA.angle;\n }\n \n // update reference angle\n if (bodyB && !bodyB.isStatic) {\n Vector.rotate(pointB, bodyB.angle - constraint.angleB, pointB);\n constraint.angleB = bodyB.angle;\n }\n\n var pointAWorld = pointA,\n pointBWorld = pointB;\n\n if (bodyA) pointAWorld = Vector.add(bodyA.position, pointA);\n if (bodyB) pointBWorld = Vector.add(bodyB.position, pointB);\n\n if (!pointAWorld || !pointBWorld)\n return;\n\n var delta = Vector.sub(pointAWorld, pointBWorld),\n currentLength = Vector.magnitude(delta);\n\n // prevent singularity\n if (currentLength < Constraint._minLength) {\n currentLength = Constraint._minLength;\n }\n\n // solve distance constraint with Gauss-Siedel method\n var difference = (currentLength - constraint.length) / currentLength,\n isRigid = constraint.stiffness >= 1 || constraint.length === 0,\n stiffness = isRigid ? constraint.stiffness * timeScale \n : constraint.stiffness * timeScale * timeScale,\n damping = constraint.damping * timeScale,\n force = Vector.mult(delta, difference * stiffness),\n massTotal = (bodyA ? bodyA.inverseMass : 0) + (bodyB ? bodyB.inverseMass : 0),\n inertiaTotal = (bodyA ? bodyA.inverseInertia : 0) + (bodyB ? bodyB.inverseInertia : 0),\n resistanceTotal = massTotal + inertiaTotal,\n torque,\n share,\n normal,\n normalVelocity,\n relativeVelocity;\n \n if (damping > 0) {\n var zero = Vector.create();\n normal = Vector.div(delta, currentLength);\n\n relativeVelocity = Vector.sub(\n bodyB && Vector.sub(bodyB.position, bodyB.positionPrev) || zero,\n bodyA && Vector.sub(bodyA.position, bodyA.positionPrev) || zero\n );\n\n normalVelocity = Vector.dot(normal, relativeVelocity);\n }\n\n if (bodyA && !bodyA.isStatic) {\n share = bodyA.inverseMass / massTotal;\n\n // keep track of applied impulses for post solving\n bodyA.constraintImpulse.x -= force.x * share;\n bodyA.constraintImpulse.y -= force.y * share;\n\n // apply forces\n bodyA.position.x -= force.x * share;\n bodyA.position.y -= force.y * share;\n\n // apply damping\n if (damping > 0) {\n bodyA.positionPrev.x -= damping * normal.x * normalVelocity * share;\n bodyA.positionPrev.y -= damping * normal.y * normalVelocity * share;\n }\n\n // apply torque\n torque = (Vector.cross(pointA, force) / resistanceTotal) * Constraint._torqueDampen * bodyA.inverseInertia * (1 - constraint.angularStiffness);\n bodyA.constraintImpulse.angle -= torque;\n bodyA.angle -= torque;\n }\n\n if (bodyB && !bodyB.isStatic) {\n share = bodyB.inverseMass / massTotal;\n\n // keep track of applied impulses for post solving\n bodyB.constraintImpulse.x += force.x * share;\n bodyB.constraintImpulse.y += force.y * share;\n \n // apply forces\n bodyB.position.x += force.x * share;\n bodyB.position.y += force.y * share;\n\n // apply damping\n if (damping > 0) {\n bodyB.positionPrev.x += damping * normal.x * normalVelocity * share;\n bodyB.positionPrev.y += damping * normal.y * normalVelocity * share;\n }\n\n // apply torque\n torque = (Vector.cross(pointB, force) / resistanceTotal) * Constraint._torqueDampen * bodyB.inverseInertia * (1 - constraint.angularStiffness);\n bodyB.constraintImpulse.angle += torque;\n bodyB.angle += torque;\n }\n\n };\n\n /**\n * Performs body updates required after solving constraints.\n * @private\n * @method postSolveAll\n * @param {body[]} bodies\n */\n Constraint.postSolveAll = function(bodies) {\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n impulse = body.constraintImpulse;\n\n if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) {\n continue;\n }\n\n Sleeping.set(body, false);\n\n // update geometry and reset\n for (var j = 0; j < body.parts.length; j++) {\n var part = body.parts[j];\n \n Vertices.translate(part.vertices, impulse);\n\n if (j > 0) {\n part.position.x += impulse.x;\n part.position.y += impulse.y;\n }\n\n if (impulse.angle !== 0) {\n Vertices.rotate(part.vertices, impulse.angle, body.position);\n Axes.rotate(part.axes, impulse.angle);\n if (j > 0) {\n Vector.rotateAbout(part.position, impulse.angle, body.position, part.position);\n }\n }\n\n Bounds.update(part.bounds, part.vertices, body.velocity);\n }\n\n // dampen the cached impulse for warming next step\n impulse.angle *= Constraint._warming;\n impulse.x *= Constraint._warming;\n impulse.y *= Constraint._warming;\n }\n };\n\n /**\n * Returns the world-space position of `constraint.pointA`, accounting for `constraint.bodyA`.\n * @method pointAWorld\n * @param {constraint} constraint\n * @returns {vector} the world-space position\n */\n Constraint.pointAWorld = function(constraint) {\n return {\n x: (constraint.bodyA ? constraint.bodyA.position.x : 0) \n + (constraint.pointA ? constraint.pointA.x : 0),\n y: (constraint.bodyA ? constraint.bodyA.position.y : 0) \n + (constraint.pointA ? constraint.pointA.y : 0)\n };\n };\n\n /**\n * Returns the world-space position of `constraint.pointB`, accounting for `constraint.bodyB`.\n * @method pointBWorld\n * @param {constraint} constraint\n * @returns {vector} the world-space position\n */\n Constraint.pointBWorld = function(constraint) {\n return {\n x: (constraint.bodyB ? constraint.bodyB.position.x : 0) \n + (constraint.pointB ? constraint.pointB.x : 0),\n y: (constraint.bodyB ? constraint.bodyB.position.y : 0) \n + (constraint.pointB ? constraint.pointB.y : 0)\n };\n };\n\n /**\n * Returns the current length of the constraint. \n * This is the distance between both of the constraint's end points.\n * See `constraint.length` for the target rest length.\n * @method currentLength\n * @param {constraint} constraint\n * @returns {number} the current length\n */\n Constraint.currentLength = function(constraint) {\n var pointAX = (constraint.bodyA ? constraint.bodyA.position.x : 0) \n + (constraint.pointA ? constraint.pointA.x : 0);\n\n var pointAY = (constraint.bodyA ? constraint.bodyA.position.y : 0) \n + (constraint.pointA ? constraint.pointA.y : 0);\n\n var pointBX = (constraint.bodyB ? constraint.bodyB.position.x : 0) \n + (constraint.pointB ? constraint.pointB.x : 0);\n \n var pointBY = (constraint.bodyB ? constraint.bodyB.position.y : 0) \n + (constraint.pointB ? constraint.pointB.y : 0);\n\n var deltaX = pointAX - pointBX;\n var deltaY = pointAY - pointBY;\n\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n };\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`.\n *\n * @property id\n * @type number\n */\n\n /**\n * A `String` denoting the type of object.\n *\n * @property type\n * @type string\n * @default \"constraint\"\n * @readOnly\n */\n\n /**\n * An arbitrary `String` name to help the user identify and manage bodies.\n *\n * @property label\n * @type string\n * @default \"Constraint\"\n */\n\n /**\n * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`.\n *\n * @property render\n * @type object\n */\n\n /**\n * A flag that indicates if the constraint should be rendered.\n *\n * @property render.visible\n * @type boolean\n * @default true\n */\n\n /**\n * A `Number` that defines the line width to use when rendering the constraint outline.\n * A value of `0` means no outline will be rendered.\n *\n * @property render.lineWidth\n * @type number\n * @default 2\n */\n\n /**\n * A `String` that defines the stroke style to use when rendering the constraint outline.\n * It is the same as when using a canvas, so it accepts CSS style property values.\n *\n * @property render.strokeStyle\n * @type string\n * @default a random colour\n */\n\n /**\n * A `String` that defines the constraint rendering type. \n * The possible values are 'line', 'pin', 'spring'.\n * An appropriate render type will be automatically chosen unless one is given in options.\n *\n * @property render.type\n * @type string\n * @default 'line'\n */\n\n /**\n * A `Boolean` that defines if the constraint's anchor points should be rendered.\n *\n * @property render.anchors\n * @type boolean\n * @default true\n */\n\n /**\n * The first possible `Body` that this constraint is attached to.\n *\n * @property bodyA\n * @type body\n * @default null\n */\n\n /**\n * The second possible `Body` that this constraint is attached to.\n *\n * @property bodyB\n * @type body\n * @default null\n */\n\n /**\n * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position.\n *\n * @property pointA\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyB` if defined, otherwise a world-space position.\n *\n * @property pointB\n * @type vector\n * @default { x: 0, y: 0 }\n */\n\n /**\n * A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`.\n * A value of `1` means the constraint should be very stiff.\n * A value of `0.2` means the constraint acts like a soft spring.\n *\n * @property stiffness\n * @type number\n * @default 1\n */\n\n /**\n * A `Number` that specifies the damping of the constraint, \n * i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation.\n * Damping will only be apparent when the constraint also has a very low `stiffness`.\n * A value of `0.1` means the constraint will apply heavy damping, resulting in little to no oscillation.\n * A value of `0` means the constraint will apply no damping.\n *\n * @property damping\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that specifies the target resting length of the constraint. \n * It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.\n *\n * @property length\n * @type number\n */\n\n /**\n * An object reserved for storing plugin-specific properties.\n *\n * @property plugin\n * @type {}\n */\n\n})();\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Axes` module contains methods for creating and manipulating sets of axes.\n*\n* @class Axes\n*/\n\nvar Axes = {};\n\nmodule.exports = Axes;\n\nvar Vector = __webpack_require__(2);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Creates a new set of axes from the given vertices.\n * @method fromVertices\n * @param {vertices} vertices\n * @return {axes} A new axes from the given vertices\n */\n Axes.fromVertices = function(vertices) {\n var axes = {};\n\n // find the unique axes, using edge normal gradients\n for (var i = 0; i < vertices.length; i++) {\n var j = (i + 1) % vertices.length, \n normal = Vector.normalise({ \n x: vertices[j].y - vertices[i].y, \n y: vertices[i].x - vertices[j].x\n }),\n gradient = (normal.y === 0) ? Infinity : (normal.x / normal.y);\n \n // limit precision\n gradient = gradient.toFixed(3).toString();\n axes[gradient] = normal;\n }\n\n return Common.values(axes);\n };\n\n /**\n * Rotates a set of axes by the given angle.\n * @method rotate\n * @param {axes} axes\n * @param {number} angle\n */\n Axes.rotate = function(axes, angle) {\n if (angle === 0)\n return;\n \n var cos = Math.cos(angle),\n sin = Math.sin(angle);\n\n for (var i = 0; i < axes.length; i++) {\n var axis = axes[i],\n xx;\n xx = axis.x * cos - axis.y * sin;\n axis.y = axis.x * sin + axis.y * cos;\n axis.x = xx;\n }\n };\n\n})();\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Bodies` module contains factory methods for creating rigid body models \n* with commonly used body configurations (such as rectangles, circles and other polygons).\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Bodies\n*/\n\n// TODO: true circle bodies\n\nvar Bodies = {};\n\nmodule.exports = Bodies;\n\nvar Vertices = __webpack_require__(3);\nvar Common = __webpack_require__(0);\nvar Body = __webpack_require__(4);\nvar Bounds = __webpack_require__(1);\nvar Vector = __webpack_require__(2);\n\n(function() {\n\n /**\n * Creates a new rigid body model with a rectangle hull. \n * The options parameter is an object that specifies any properties you wish to override the defaults.\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\n * @method rectangle\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {object} [options]\n * @return {body} A new rectangle body\n */\n Bodies.rectangle = function(x, y, width, height, options) {\n options = options || {};\n\n var rectangle = { \n label: 'Rectangle Body',\n position: { x: x, y: y },\n vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height)\n };\n\n if (options.chamfer) {\n var chamfer = options.chamfer;\n rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, \n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\n delete options.chamfer;\n }\n\n return Body.create(Common.extend({}, rectangle, options));\n };\n \n /**\n * Creates a new rigid body model with a trapezoid hull. \n * The `slope` is parameterised as a fraction of `width` and must be < 1 to form a valid trapezoid. \n * The options parameter is an object that specifies any properties you wish to override the defaults.\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\n * @method trapezoid\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {number} slope Must be a number < 1.\n * @param {object} [options]\n * @return {body} A new trapezoid body\n */\n Bodies.trapezoid = function(x, y, width, height, slope, options) {\n options = options || {};\n\n if (slope >= 1) {\n Common.warn('Bodies.trapezoid: slope parameter must be < 1.');\n }\n\n slope *= 0.5;\n var roof = (1 - (slope * 2)) * width;\n \n var x1 = width * slope,\n x2 = x1 + roof,\n x3 = x2 + x1,\n verticesPath;\n\n if (slope < 0.5) {\n verticesPath = 'L 0 0 L ' + x1 + ' ' + (-height) + ' L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0';\n } else {\n verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0';\n }\n\n var trapezoid = { \n label: 'Trapezoid Body',\n position: { x: x, y: y },\n vertices: Vertices.fromPath(verticesPath)\n };\n\n if (options.chamfer) {\n var chamfer = options.chamfer;\n trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, \n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\n delete options.chamfer;\n }\n\n return Body.create(Common.extend({}, trapezoid, options));\n };\n\n /**\n * Creates a new rigid body model with a circle hull. \n * The options parameter is an object that specifies any properties you wish to override the defaults.\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\n * @method circle\n * @param {number} x\n * @param {number} y\n * @param {number} radius\n * @param {object} [options]\n * @param {number} [maxSides]\n * @return {body} A new circle body\n */\n Bodies.circle = function(x, y, radius, options, maxSides) {\n options = options || {};\n\n var circle = {\n label: 'Circle Body',\n circleRadius: radius\n };\n \n // approximate circles with polygons until true circles implemented in SAT\n maxSides = maxSides || 25;\n var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius)));\n\n // optimisation: always use even number of sides (half the number of unique axes)\n if (sides % 2 === 1)\n sides += 1;\n\n return Bodies.polygon(x, y, sides, radius, Common.extend({}, circle, options));\n };\n\n /**\n * Creates a new rigid body model with a regular polygon hull with the given number of sides. \n * The options parameter is an object that specifies any properties you wish to override the defaults.\n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\n * @method polygon\n * @param {number} x\n * @param {number} y\n * @param {number} sides\n * @param {number} radius\n * @param {object} [options]\n * @return {body} A new regular polygon body\n */\n Bodies.polygon = function(x, y, sides, radius, options) {\n options = options || {};\n\n if (sides < 3)\n return Bodies.circle(x, y, radius, options);\n\n var theta = 2 * Math.PI / sides,\n path = '',\n offset = theta * 0.5;\n\n for (var i = 0; i < sides; i += 1) {\n var angle = offset + (i * theta),\n xx = Math.cos(angle) * radius,\n yy = Math.sin(angle) * radius;\n\n path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' ';\n }\n\n var polygon = { \n label: 'Polygon Body',\n position: { x: x, y: y },\n vertices: Vertices.fromPath(path)\n };\n\n if (options.chamfer) {\n var chamfer = options.chamfer;\n polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, \n chamfer.quality, chamfer.qualityMin, chamfer.qualityMax);\n delete options.chamfer;\n }\n\n return Body.create(Common.extend({}, polygon, options));\n };\n\n /**\n * Utility to create a compound body based on set(s) of vertices.\n * \n * _Note:_ To optionally enable automatic concave vertices decomposition the [poly-decomp](https://github.com/schteppe/poly-decomp.js) \n * package must be first installed and provided see `Common.setDecomp`, otherwise the convex hull of each vertex set will be used.\n * \n * The resulting vertices are reorientated about their centre of mass,\n * and offset such that `body.position` corresponds to this point.\n * \n * The resulting offset may be found if needed by subtracting `body.bounds` from the original input bounds.\n * To later move the centre of mass see `Body.setCentre`.\n * \n * Note that automatic conconcave decomposition results are not always optimal. \n * For best results, simplify the input vertices as much as possible first.\n * By default this function applies some addtional simplification to help.\n * \n * Some outputs may also require further manual processing afterwards to be robust.\n * In particular some parts may need to be overlapped to avoid collision gaps.\n * Thin parts and sharp points should be avoided or removed where possible.\n *\n * The options parameter object specifies any `Matter.Body` properties you wish to override the defaults.\n * \n * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.\n * @method fromVertices\n * @param {number} x\n * @param {number} y\n * @param {array} vertexSets One or more arrays of vertex points e.g. `[[{ x: 0, y: 0 }...], ...]`.\n * @param {object} [options] The body options.\n * @param {bool} [flagInternal=false] Optionally marks internal edges with `isInternal`.\n * @param {number} [removeCollinear=0.01] Threshold when simplifying vertices along the same edge.\n * @param {number} [minimumArea=10] Threshold when removing small parts.\n * @param {number} [removeDuplicatePoints=0.01] Threshold when simplifying nearby vertices.\n * @return {body}\n */\n Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea, removeDuplicatePoints) {\n var decomp = Common.getDecomp(),\n canDecomp,\n body,\n parts,\n isConvex,\n isConcave,\n vertices,\n i,\n j,\n k,\n v,\n z;\n\n // check decomp is as expected\n canDecomp = Boolean(decomp && decomp.quickDecomp);\n\n options = options || {};\n parts = [];\n\n flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false;\n removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01;\n minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10;\n removeDuplicatePoints = typeof removeDuplicatePoints !== 'undefined' ? removeDuplicatePoints : 0.01;\n\n // ensure vertexSets is an array of arrays\n if (!Common.isArray(vertexSets[0])) {\n vertexSets = [vertexSets];\n }\n\n for (v = 0; v < vertexSets.length; v += 1) {\n vertices = vertexSets[v];\n isConvex = Vertices.isConvex(vertices);\n isConcave = !isConvex;\n\n if (isConcave && !canDecomp) {\n Common.warnOnce(\n 'Bodies.fromVertices: Install the \\'poly-decomp\\' library and use Common.setDecomp or provide \\'decomp\\' as a global to decompose concave vertices.'\n );\n }\n\n if (isConvex || !canDecomp) {\n if (isConvex) {\n vertices = Vertices.clockwiseSort(vertices);\n } else {\n // fallback to convex hull when decomposition is not possible\n vertices = Vertices.hull(vertices);\n }\n\n parts.push({\n position: { x: x, y: y },\n vertices: vertices\n });\n } else {\n // initialise a decomposition\n var concave = vertices.map(function(vertex) {\n return [vertex.x, vertex.y];\n });\n\n // vertices are concave and simple, we can decompose into parts\n decomp.makeCCW(concave);\n if (removeCollinear !== false)\n decomp.removeCollinearPoints(concave, removeCollinear);\n if (removeDuplicatePoints !== false && decomp.removeDuplicatePoints)\n decomp.removeDuplicatePoints(concave, removeDuplicatePoints);\n\n // use the quick decomposition algorithm (Bayazit)\n var decomposed = decomp.quickDecomp(concave);\n\n // for each decomposed chunk\n for (i = 0; i < decomposed.length; i++) {\n var chunk = decomposed[i];\n\n // convert vertices into the correct structure\n var chunkVertices = chunk.map(function(vertices) {\n return {\n x: vertices[0],\n y: vertices[1]\n };\n });\n\n // skip small chunks\n if (minimumArea > 0 && Vertices.area(chunkVertices) < minimumArea)\n continue;\n\n // create a compound part\n parts.push({\n position: Vertices.centre(chunkVertices),\n vertices: chunkVertices\n });\n }\n }\n }\n\n // create body parts\n for (i = 0; i < parts.length; i++) {\n parts[i] = Body.create(Common.extend(parts[i], options));\n }\n\n // flag internal edges (coincident part edges)\n if (flagInternal) {\n var coincident_max_dist = 5;\n\n for (i = 0; i < parts.length; i++) {\n var partA = parts[i];\n\n for (j = i + 1; j < parts.length; j++) {\n var partB = parts[j];\n\n if (Bounds.overlaps(partA.bounds, partB.bounds)) {\n var pav = partA.vertices,\n pbv = partB.vertices;\n\n // iterate vertices of both parts\n for (k = 0; k < partA.vertices.length; k++) {\n for (z = 0; z < partB.vertices.length; z++) {\n // find distances between the vertices\n var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])),\n db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length]));\n\n // if both vertices are very close, consider the edge concident (internal)\n if (da < coincident_max_dist && db < coincident_max_dist) {\n pav[k].isInternal = true;\n pbv[z].isInternal = true;\n }\n }\n }\n\n }\n }\n }\n }\n\n if (parts.length > 1) {\n // create the parent body to be returned, that contains generated compound parts\n body = Body.create(Common.extend({ parts: parts.slice(0) }, options));\n\n // offset such that body.position is at the centre off mass\n Body.setPosition(body, { x: x, y: y });\n\n return body;\n } else {\n return parts[0];\n }\n };\n\n})();\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Detector` module contains methods for efficiently detecting collisions between a list of bodies using a broadphase algorithm.\n*\n* @class Detector\n*/\n\nvar Detector = {};\n\nmodule.exports = Detector;\n\nvar Common = __webpack_require__(0);\nvar Collision = __webpack_require__(8);\n\n(function() {\n\n /**\n * Creates a new collision detector.\n * @method create\n * @param {} options\n * @return {detector} A new collision detector\n */\n Detector.create = function(options) {\n var defaults = {\n bodies: [],\n collisions: [],\n pairs: null\n };\n\n return Common.extend(defaults, options);\n };\n\n /**\n * Sets the list of bodies in the detector.\n * @method setBodies\n * @param {detector} detector\n * @param {body[]} bodies\n */\n Detector.setBodies = function(detector, bodies) {\n detector.bodies = bodies.slice(0);\n };\n\n /**\n * Clears the detector including its list of bodies.\n * @method clear\n * @param {detector} detector\n */\n Detector.clear = function(detector) {\n detector.bodies = [];\n detector.collisions = [];\n };\n\n /**\n * Efficiently finds all collisions among all the bodies in `detector.bodies` using a broadphase algorithm.\n * \n * _Note:_ The specific ordering of collisions returned is not guaranteed between releases and may change for performance reasons.\n * If a specific ordering is required then apply a sort to the resulting array.\n * @method collisions\n * @param {detector} detector\n * @return {collision[]} collisions\n */\n Detector.collisions = function(detector) {\n var pairs = detector.pairs,\n bodies = detector.bodies,\n bodiesLength = bodies.length,\n canCollide = Detector.canCollide,\n collides = Collision.collides,\n collisions = detector.collisions,\n collisionIndex = 0,\n i,\n j;\n\n bodies.sort(Detector._compareBoundsX);\n\n for (i = 0; i < bodiesLength; i++) {\n var bodyA = bodies[i],\n boundsA = bodyA.bounds,\n boundXMax = bodyA.bounds.max.x,\n boundYMax = bodyA.bounds.max.y,\n boundYMin = bodyA.bounds.min.y,\n bodyAStatic = bodyA.isStatic || bodyA.isSleeping,\n partsALength = bodyA.parts.length,\n partsASingle = partsALength === 1;\n\n for (j = i + 1; j < bodiesLength; j++) {\n var bodyB = bodies[j],\n boundsB = bodyB.bounds;\n\n if (boundsB.min.x > boundXMax) {\n break;\n }\n\n if (boundYMax < boundsB.min.y || boundYMin > boundsB.max.y) {\n continue;\n }\n\n if (bodyAStatic && (bodyB.isStatic || bodyB.isSleeping)) {\n continue;\n }\n\n if (!canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) {\n continue;\n }\n\n var partsBLength = bodyB.parts.length;\n\n if (partsASingle && partsBLength === 1) {\n var collision = collides(bodyA, bodyB, pairs);\n\n if (collision) {\n collisions[collisionIndex++] = collision;\n }\n } else {\n var partsAStart = partsALength > 1 ? 1 : 0,\n partsBStart = partsBLength > 1 ? 1 : 0;\n \n for (var k = partsAStart; k < partsALength; k++) {\n var partA = bodyA.parts[k],\n boundsA = partA.bounds;\n\n for (var z = partsBStart; z < partsBLength; z++) {\n var partB = bodyB.parts[z],\n boundsB = partB.bounds;\n\n if (boundsA.min.x > boundsB.max.x || boundsA.max.x < boundsB.min.x\n || boundsA.max.y < boundsB.min.y || boundsA.min.y > boundsB.max.y) {\n continue;\n }\n\n var collision = collides(partA, partB, pairs);\n\n if (collision) {\n collisions[collisionIndex++] = collision;\n }\n }\n }\n }\n }\n }\n\n if (collisions.length !== collisionIndex) {\n collisions.length = collisionIndex;\n }\n\n return collisions;\n };\n\n /**\n * Returns `true` if both supplied collision filters will allow a collision to occur.\n * See `body.collisionFilter` for more information.\n * @method canCollide\n * @param {} filterA\n * @param {} filterB\n * @return {bool} `true` if collision can occur\n */\n Detector.canCollide = function(filterA, filterB) {\n if (filterA.group === filterB.group && filterA.group !== 0)\n return filterA.group > 0;\n\n return (filterA.mask & filterB.category) !== 0 && (filterB.mask & filterA.category) !== 0;\n };\n\n /**\n * The comparison function used in the broadphase algorithm.\n * Returns the signed delta of the bodies bounds on the x-axis.\n * @private\n * @method _sortCompare\n * @param {body} bodyA\n * @param {body} bodyB\n * @return {number} The signed delta used for sorting\n */\n Detector._compareBoundsX = function(bodyA, bodyB) {\n return bodyA.bounds.min.x - bodyB.bounds.min.x;\n };\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * The array of `Matter.Body` between which the detector finds collisions.\n * \n * _Note:_ The order of bodies in this array _is not fixed_ and will be continually managed by the detector.\n * @property bodies\n * @type body[]\n * @default []\n */\n\n /**\n * The array of `Matter.Collision` found in the last call to `Detector.collisions` on this detector.\n * @property collisions\n * @type collision[]\n * @default []\n */\n\n /**\n * Optional. A `Matter.Pairs` object from which previous collision objects may be reused. Intended for internal `Matter.Engine` usage.\n * @property pairs\n * @type {pairs|null}\n * @default null\n */\n\n})();\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Mouse` module contains methods for creating and manipulating mouse inputs.\n*\n* @class Mouse\n*/\n\nvar Mouse = {};\n\nmodule.exports = Mouse;\n\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Creates a mouse input.\n * @method create\n * @param {HTMLElement} element\n * @return {mouse} A new mouse\n */\n Mouse.create = function(element) {\n var mouse = {};\n\n if (!element) {\n Common.log('Mouse.create: element was undefined, defaulting to document.body', 'warn');\n }\n \n mouse.element = element || document.body;\n mouse.absolute = { x: 0, y: 0 };\n mouse.position = { x: 0, y: 0 };\n mouse.mousedownPosition = { x: 0, y: 0 };\n mouse.mouseupPosition = { x: 0, y: 0 };\n mouse.offset = { x: 0, y: 0 };\n mouse.scale = { x: 1, y: 1 };\n mouse.wheelDelta = 0;\n mouse.button = -1;\n mouse.pixelRatio = parseInt(mouse.element.getAttribute('data-pixel-ratio'), 10) || 1;\n\n mouse.sourceEvents = {\n mousemove: null,\n mousedown: null,\n mouseup: null,\n mousewheel: null\n };\n \n mouse.mousemove = function(event) { \n var position = Mouse._getRelativeMousePosition(event, mouse.element, mouse.pixelRatio),\n touches = event.changedTouches;\n\n if (touches) {\n mouse.button = 0;\n event.preventDefault();\n }\n\n mouse.absolute.x = position.x;\n mouse.absolute.y = position.y;\n mouse.position.x = mouse.absolute.x * mouse.scale.x + mouse.offset.x;\n mouse.position.y = mouse.absolute.y * mouse.scale.y + mouse.offset.y;\n mouse.sourceEvents.mousemove = event;\n };\n \n mouse.mousedown = function(event) {\n var position = Mouse._getRelativeMousePosition(event, mouse.element, mouse.pixelRatio),\n touches = event.changedTouches;\n\n if (touches) {\n mouse.button = 0;\n event.preventDefault();\n } else {\n mouse.button = event.button;\n }\n\n mouse.absolute.x = position.x;\n mouse.absolute.y = position.y;\n mouse.position.x = mouse.absolute.x * mouse.scale.x + mouse.offset.x;\n mouse.position.y = mouse.absolute.y * mouse.scale.y + mouse.offset.y;\n mouse.mousedownPosition.x = mouse.position.x;\n mouse.mousedownPosition.y = mouse.position.y;\n mouse.sourceEvents.mousedown = event;\n };\n \n mouse.mouseup = function(event) {\n var position = Mouse._getRelativeMousePosition(event, mouse.element, mouse.pixelRatio),\n touches = event.changedTouches;\n\n if (touches) {\n event.preventDefault();\n }\n \n mouse.button = -1;\n mouse.absolute.x = position.x;\n mouse.absolute.y = position.y;\n mouse.position.x = mouse.absolute.x * mouse.scale.x + mouse.offset.x;\n mouse.position.y = mouse.absolute.y * mouse.scale.y + mouse.offset.y;\n mouse.mouseupPosition.x = mouse.position.x;\n mouse.mouseupPosition.y = mouse.position.y;\n mouse.sourceEvents.mouseup = event;\n };\n\n mouse.mousewheel = function(event) {\n mouse.wheelDelta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail));\n event.preventDefault();\n mouse.sourceEvents.mousewheel = event;\n };\n\n Mouse.setElement(mouse, mouse.element);\n\n return mouse;\n };\n\n /**\n * Sets the element the mouse is bound to (and relative to).\n * @method setElement\n * @param {mouse} mouse\n * @param {HTMLElement} element\n */\n Mouse.setElement = function(mouse, element) {\n mouse.element = element;\n\n element.addEventListener('mousemove', mouse.mousemove, { passive: true });\n element.addEventListener('mousedown', mouse.mousedown, { passive: true });\n element.addEventListener('mouseup', mouse.mouseup, { passive: true });\n \n element.addEventListener('wheel', mouse.mousewheel, { passive: false });\n \n element.addEventListener('touchmove', mouse.mousemove, { passive: false });\n element.addEventListener('touchstart', mouse.mousedown, { passive: false });\n element.addEventListener('touchend', mouse.mouseup, { passive: false });\n };\n\n /**\n * Clears all captured source events.\n * @method clearSourceEvents\n * @param {mouse} mouse\n */\n Mouse.clearSourceEvents = function(mouse) {\n mouse.sourceEvents.mousemove = null;\n mouse.sourceEvents.mousedown = null;\n mouse.sourceEvents.mouseup = null;\n mouse.sourceEvents.mousewheel = null;\n mouse.wheelDelta = 0;\n };\n\n /**\n * Sets the mouse position offset.\n * @method setOffset\n * @param {mouse} mouse\n * @param {vector} offset\n */\n Mouse.setOffset = function(mouse, offset) {\n mouse.offset.x = offset.x;\n mouse.offset.y = offset.y;\n mouse.position.x = mouse.absolute.x * mouse.scale.x + mouse.offset.x;\n mouse.position.y = mouse.absolute.y * mouse.scale.y + mouse.offset.y;\n };\n\n /**\n * Sets the mouse position scale.\n * @method setScale\n * @param {mouse} mouse\n * @param {vector} scale\n */\n Mouse.setScale = function(mouse, scale) {\n mouse.scale.x = scale.x;\n mouse.scale.y = scale.y;\n mouse.position.x = mouse.absolute.x * mouse.scale.x + mouse.offset.x;\n mouse.position.y = mouse.absolute.y * mouse.scale.y + mouse.offset.y;\n };\n \n /**\n * Gets the mouse position relative to an element given a screen pixel ratio.\n * @method _getRelativeMousePosition\n * @private\n * @param {} event\n * @param {} element\n * @param {number} pixelRatio\n * @return {}\n */\n Mouse._getRelativeMousePosition = function(event, element, pixelRatio) {\n var elementBounds = element.getBoundingClientRect(),\n rootNode = (document.documentElement || document.body.parentNode || document.body),\n scrollX = (window.pageXOffset !== undefined) ? window.pageXOffset : rootNode.scrollLeft,\n scrollY = (window.pageYOffset !== undefined) ? window.pageYOffset : rootNode.scrollTop,\n touches = event.changedTouches,\n x, y;\n \n if (touches) {\n x = touches[0].pageX - elementBounds.left - scrollX;\n y = touches[0].pageY - elementBounds.top - scrollY;\n } else {\n x = event.pageX - elementBounds.left - scrollX;\n y = event.pageY - elementBounds.top - scrollY;\n }\n\n return { \n x: x / (element.clientWidth / (element.width || element.clientWidth) * pixelRatio),\n y: y / (element.clientHeight / (element.height || element.clientHeight) * pixelRatio)\n };\n };\n\n})();\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Plugin` module contains functions for registering and installing plugins on modules.\n*\n* @class Plugin\n*/\n\nvar Plugin = {};\n\nmodule.exports = Plugin;\n\nvar Common = __webpack_require__(0);\n\n(function() {\n\n Plugin._registry = {};\n\n /**\n * Registers a plugin object so it can be resolved later by name.\n * @method register\n * @param plugin {} The plugin to register.\n * @return {object} The plugin.\n */\n Plugin.register = function(plugin) {\n if (!Plugin.isPlugin(plugin)) {\n Common.warn('Plugin.register:', Plugin.toString(plugin), 'does not implement all required fields.');\n }\n\n if (plugin.name in Plugin._registry) {\n var registered = Plugin._registry[plugin.name],\n pluginVersion = Plugin.versionParse(plugin.version).number,\n registeredVersion = Plugin.versionParse(registered.version).number;\n\n if (pluginVersion > registeredVersion) {\n Common.warn('Plugin.register:', Plugin.toString(registered), 'was upgraded to', Plugin.toString(plugin));\n Plugin._registry[plugin.name] = plugin;\n } else if (pluginVersion < registeredVersion) {\n Common.warn('Plugin.register:', Plugin.toString(registered), 'can not be downgraded to', Plugin.toString(plugin));\n } else if (plugin !== registered) {\n Common.warn('Plugin.register:', Plugin.toString(plugin), 'is already registered to different plugin object');\n }\n } else {\n Plugin._registry[plugin.name] = plugin;\n }\n\n return plugin;\n };\n\n /**\n * Resolves a dependency to a plugin object from the registry if it exists. \n * The `dependency` may contain a version, but only the name matters when resolving.\n * @method resolve\n * @param dependency {string} The dependency.\n * @return {object} The plugin if resolved, otherwise `undefined`.\n */\n Plugin.resolve = function(dependency) {\n return Plugin._registry[Plugin.dependencyParse(dependency).name];\n };\n\n /**\n * Returns a pretty printed plugin name and version.\n * @method toString\n * @param plugin {} The plugin.\n * @return {string} Pretty printed plugin name and version.\n */\n Plugin.toString = function(plugin) {\n return typeof plugin === 'string' ? plugin : (plugin.name || 'anonymous') + '@' + (plugin.version || plugin.range || '0.0.0');\n };\n\n /**\n * Returns `true` if the object meets the minimum standard to be considered a plugin.\n * This means it must define the following properties:\n * - `name`\n * - `version`\n * - `install`\n * @method isPlugin\n * @param obj {} The obj to test.\n * @return {boolean} `true` if the object can be considered a plugin otherwise `false`.\n */\n Plugin.isPlugin = function(obj) {\n return obj && obj.name && obj.version && obj.install;\n };\n\n /**\n * Returns `true` if a plugin with the given `name` been installed on `module`.\n * @method isUsed\n * @param module {} The module.\n * @param name {string} The plugin name.\n * @return {boolean} `true` if a plugin with the given `name` been installed on `module`, otherwise `false`.\n */\n Plugin.isUsed = function(module, name) {\n return module.used.indexOf(name) > -1;\n };\n\n /**\n * Returns `true` if `plugin.for` is applicable to `module` by comparing against `module.name` and `module.version`.\n * If `plugin.for` is not specified then it is assumed to be applicable.\n * The value of `plugin.for` is a string of the format `'module-name'` or `'module-name@version'`.\n * @method isFor\n * @param plugin {} The plugin.\n * @param module {} The module.\n * @return {boolean} `true` if `plugin.for` is applicable to `module`, otherwise `false`.\n */\n Plugin.isFor = function(plugin, module) {\n var parsed = plugin.for && Plugin.dependencyParse(plugin.for);\n return !plugin.for || (module.name === parsed.name && Plugin.versionSatisfies(module.version, parsed.range));\n };\n\n /**\n * Installs the plugins by calling `plugin.install` on each plugin specified in `plugins` if passed, otherwise `module.uses`.\n * For installing plugins on `Matter` see the convenience function `Matter.use`.\n * Plugins may be specified either by their name or a reference to the plugin object.\n * Plugins themselves may specify further dependencies, but each plugin is installed only once.\n * Order is important, a topological sort is performed to find the best resulting order of installation.\n * This sorting attempts to satisfy every dependency's requested ordering, but may not be exact in all cases.\n * This function logs the resulting status of each dependency in the console, along with any warnings.\n * - A green tick ✅ indicates a dependency was resolved and installed.\n * - An orange diamond 🔶 indicates a dependency was resolved but a warning was thrown for it or one if its dependencies.\n * - A red cross ❌ indicates a dependency could not be resolved.\n * Avoid calling this function multiple times on the same module unless you intend to manually control installation order.\n * @method use\n * @param module {} The module install plugins on.\n * @param [plugins=module.uses] {} The plugins to install on module (optional, defaults to `module.uses`).\n */\n Plugin.use = function(module, plugins) {\n module.uses = (module.uses || []).concat(plugins || []);\n\n if (module.uses.length === 0) {\n Common.warn('Plugin.use:', Plugin.toString(module), 'does not specify any dependencies to install.');\n return;\n }\n\n var dependencies = Plugin.dependencies(module),\n sortedDependencies = Common.topologicalSort(dependencies),\n status = [];\n\n for (var i = 0; i < sortedDependencies.length; i += 1) {\n if (sortedDependencies[i] === module.name) {\n continue;\n }\n\n var plugin = Plugin.resolve(sortedDependencies[i]);\n\n if (!plugin) {\n status.push('❌ ' + sortedDependencies[i]);\n continue;\n }\n\n if (Plugin.isUsed(module, plugin.name)) {\n continue;\n }\n\n if (!Plugin.isFor(plugin, module)) {\n Common.warn('Plugin.use:', Plugin.toString(plugin), 'is for', plugin.for, 'but installed on', Plugin.toString(module) + '.');\n plugin._warned = true;\n }\n\n if (plugin.install) {\n plugin.install(module);\n } else {\n Common.warn('Plugin.use:', Plugin.toString(plugin), 'does not specify an install function.');\n plugin._warned = true;\n }\n\n if (plugin._warned) {\n status.push('🔶 ' + Plugin.toString(plugin));\n delete plugin._warned;\n } else {\n status.push('✅ ' + Plugin.toString(plugin));\n }\n\n module.used.push(plugin.name);\n }\n\n if (status.length > 0) {\n Common.info(status.join(' '));\n }\n };\n\n /**\n * Recursively finds all of a module's dependencies and returns a flat dependency graph.\n * @method dependencies\n * @param module {} The module.\n * @return {object} A dependency graph.\n */\n Plugin.dependencies = function(module, tracked) {\n var parsedBase = Plugin.dependencyParse(module),\n name = parsedBase.name;\n\n tracked = tracked || {};\n\n if (name in tracked) {\n return;\n }\n\n module = Plugin.resolve(module) || module;\n\n tracked[name] = Common.map(module.uses || [], function(dependency) {\n if (Plugin.isPlugin(dependency)) {\n Plugin.register(dependency);\n }\n\n var parsed = Plugin.dependencyParse(dependency),\n resolved = Plugin.resolve(dependency);\n\n if (resolved && !Plugin.versionSatisfies(resolved.version, parsed.range)) {\n Common.warn(\n 'Plugin.dependencies:', Plugin.toString(resolved), 'does not satisfy',\n Plugin.toString(parsed), 'used by', Plugin.toString(parsedBase) + '.'\n );\n\n resolved._warned = true;\n module._warned = true;\n } else if (!resolved) {\n Common.warn(\n 'Plugin.dependencies:', Plugin.toString(dependency), 'used by',\n Plugin.toString(parsedBase), 'could not be resolved.'\n );\n\n module._warned = true;\n }\n\n return parsed.name;\n });\n\n for (var i = 0; i < tracked[name].length; i += 1) {\n Plugin.dependencies(tracked[name][i], tracked);\n }\n\n return tracked;\n };\n\n /**\n * Parses a dependency string into its components.\n * The `dependency` is a string of the format `'module-name'` or `'module-name@version'`.\n * See documentation for `Plugin.versionParse` for a description of the format.\n * This function can also handle dependencies that are already resolved (e.g. a module object).\n * @method dependencyParse\n * @param dependency {string} The dependency of the format `'module-name'` or `'module-name@version'`.\n * @return {object} The dependency parsed into its components.\n */\n Plugin.dependencyParse = function(dependency) {\n if (Common.isString(dependency)) {\n var pattern = /^[\\w-]+(@(\\*|[\\^~]?\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z-+]+)?))?$/;\n\n if (!pattern.test(dependency)) {\n Common.warn('Plugin.dependencyParse:', dependency, 'is not a valid dependency string.');\n }\n\n return {\n name: dependency.split('@')[0],\n range: dependency.split('@')[1] || '*'\n };\n }\n\n return {\n name: dependency.name,\n range: dependency.range || dependency.version\n };\n };\n\n /**\n * Parses a version string into its components. \n * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)).\n * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`.\n * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax).\n * Only the following range types are supported:\n * - Tilde ranges e.g. `~1.2.3`\n * - Caret ranges e.g. `^1.2.3`\n * - Greater than ranges e.g. `>1.2.3`\n * - Greater than or equal ranges e.g. `>=1.2.3`\n * - Exact version e.g. `1.2.3`\n * - Any version `*`\n * @method versionParse\n * @param range {string} The version string.\n * @return {object} The version range parsed into its components.\n */\n Plugin.versionParse = function(range) {\n var pattern = /^(\\*)|(\\^|~|>=|>)?\\s*((\\d+)\\.(\\d+)\\.(\\d+))(-[0-9A-Za-z-+]+)?$/;\n\n if (!pattern.test(range)) {\n Common.warn('Plugin.versionParse:', range, 'is not a valid version or range.');\n }\n\n var parts = pattern.exec(range);\n var major = Number(parts[4]);\n var minor = Number(parts[5]);\n var patch = Number(parts[6]);\n\n return {\n isRange: Boolean(parts[1] || parts[2]),\n version: parts[3],\n range: range,\n operator: parts[1] || parts[2] || '',\n major: major,\n minor: minor,\n patch: patch,\n parts: [major, minor, patch],\n prerelease: parts[7],\n number: major * 1e8 + minor * 1e4 + patch\n };\n };\n\n /**\n * Returns `true` if `version` satisfies the given `range`.\n * See documentation for `Plugin.versionParse` for a description of the format.\n * If a version or range is not specified, then any version (`*`) is assumed to satisfy.\n * @method versionSatisfies\n * @param version {string} The version string.\n * @param range {string} The range string.\n * @return {boolean} `true` if `version` satisfies `range`, otherwise `false`.\n */\n Plugin.versionSatisfies = function(version, range) {\n range = range || '*';\n\n var r = Plugin.versionParse(range),\n v = Plugin.versionParse(version);\n\n if (r.isRange) {\n if (r.operator === '*' || version === '*') {\n return true;\n }\n\n if (r.operator === '>') {\n return v.number > r.number;\n }\n\n if (r.operator === '>=') {\n return v.number >= r.number;\n }\n\n if (r.operator === '~') {\n return v.major === r.major && v.minor === r.minor && v.patch >= r.patch;\n }\n\n if (r.operator === '^') {\n if (r.major > 0) {\n return v.major === r.major && v.number >= r.number;\n }\n\n if (r.minor > 0) {\n return v.minor === r.minor && v.patch >= r.patch;\n }\n\n return v.patch === r.patch;\n }\n }\n\n return version === range || version === '*';\n };\n\n})();\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n/**\n* The `Matter.Contact` module contains methods for creating and manipulating collision contacts.\n*\n* @class Contact\n*/\n\nvar Contact = {};\n\nmodule.exports = Contact;\n\n(function() {\n\n /**\n * Creates a new contact.\n * @method create\n * @param {vertex} [vertex]\n * @return {contact} A new contact\n */\n Contact.create = function(vertex) {\n return {\n vertex: vertex,\n normalImpulse: 0,\n tangentImpulse: 0\n };\n };\n\n})();\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Engine` module contains methods for creating and manipulating engines.\n* An engine is a controller that manages updating the simulation of the world.\n* See `Matter.Runner` for an optional game loop utility.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Engine\n*/\n\nvar Engine = {};\n\nmodule.exports = Engine;\n\nvar Sleeping = __webpack_require__(7);\nvar Resolver = __webpack_require__(18);\nvar Detector = __webpack_require__(13);\nvar Pairs = __webpack_require__(19);\nvar Events = __webpack_require__(5);\nvar Composite = __webpack_require__(6);\nvar Constraint = __webpack_require__(10);\nvar Common = __webpack_require__(0);\nvar Body = __webpack_require__(4);\n\n(function() {\n\n Engine._deltaMax = 1000 / 60;\n\n /**\n * Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults.\n * All properties have default values, and many are pre-calculated automatically based on other properties.\n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {object} [options]\n * @return {engine} engine\n */\n Engine.create = function(options) {\n options = options || {};\n\n var defaults = {\n positionIterations: 6,\n velocityIterations: 4,\n constraintIterations: 2,\n enableSleeping: false,\n events: [],\n plugin: {},\n gravity: {\n x: 0,\n y: 1,\n scale: 0.001\n },\n timing: {\n timestamp: 0,\n timeScale: 1,\n lastDelta: 0,\n lastElapsed: 0,\n lastUpdatesPerFrame: 0\n }\n };\n\n var engine = Common.extend(defaults, options);\n\n engine.world = options.world || Composite.create({ label: 'World' });\n engine.pairs = options.pairs || Pairs.create();\n engine.detector = options.detector || Detector.create();\n engine.detector.pairs = engine.pairs;\n\n // for temporary back compatibility only\n engine.grid = { buckets: [] };\n engine.world.gravity = engine.gravity;\n engine.broadphase = engine.grid;\n engine.metrics = {};\n \n return engine;\n };\n\n /**\n * Moves the simulation forward in time by `delta` milliseconds.\n * Triggers `beforeUpdate`, `beforeSolve` and `afterUpdate` events.\n * Triggers `collisionStart`, `collisionActive` and `collisionEnd` events.\n * @method update\n * @param {engine} engine\n * @param {number} [delta=16.666]\n */\n Engine.update = function(engine, delta) {\n var startTime = Common.now();\n\n var world = engine.world,\n detector = engine.detector,\n pairs = engine.pairs,\n timing = engine.timing,\n timestamp = timing.timestamp,\n i;\n\n // warn if high delta\n if (delta > Engine._deltaMax) {\n Common.warnOnce(\n 'Matter.Engine.update: delta argument is recommended to be less than or equal to', Engine._deltaMax.toFixed(3), 'ms.'\n );\n }\n\n delta = typeof delta !== 'undefined' ? delta : Common._baseDelta;\n delta *= timing.timeScale;\n\n // increment timestamp\n timing.timestamp += delta;\n timing.lastDelta = delta;\n\n // create an event object\n var event = {\n timestamp: timing.timestamp,\n delta: delta\n };\n\n Events.trigger(engine, 'beforeUpdate', event);\n\n // get all bodies and all constraints in the world\n var allBodies = Composite.allBodies(world),\n allConstraints = Composite.allConstraints(world);\n\n // if the world has changed\n if (world.isModified) {\n // update the detector bodies\n Detector.setBodies(detector, allBodies);\n\n // reset all composite modified flags\n Composite.setModified(world, false, false, true);\n }\n\n // update sleeping if enabled\n if (engine.enableSleeping)\n Sleeping.update(allBodies, delta);\n\n // apply gravity to all bodies\n Engine._bodiesApplyGravity(allBodies, engine.gravity);\n\n // update all body position and rotation by integration\n if (delta > 0) {\n Engine._bodiesUpdate(allBodies, delta);\n }\n\n Events.trigger(engine, 'beforeSolve', event);\n\n // update all constraints (first pass)\n Constraint.preSolveAll(allBodies);\n for (i = 0; i < engine.constraintIterations; i++) {\n Constraint.solveAll(allConstraints, delta);\n }\n Constraint.postSolveAll(allBodies);\n\n // find all collisions\n var collisions = Detector.collisions(detector);\n\n // update collision pairs\n Pairs.update(pairs, collisions, timestamp);\n\n // wake up bodies involved in collisions\n if (engine.enableSleeping)\n Sleeping.afterCollisions(pairs.list);\n\n // trigger collision events\n if (pairs.collisionStart.length > 0) {\n Events.trigger(engine, 'collisionStart', { \n pairs: pairs.collisionStart,\n timestamp: timing.timestamp,\n delta: delta\n });\n }\n\n // iteratively resolve position between collisions\n var positionDamping = Common.clamp(20 / engine.positionIterations, 0, 1);\n \n Resolver.preSolvePosition(pairs.list);\n for (i = 0; i < engine.positionIterations; i++) {\n Resolver.solvePosition(pairs.list, delta, positionDamping);\n }\n Resolver.postSolvePosition(allBodies);\n\n // update all constraints (second pass)\n Constraint.preSolveAll(allBodies);\n for (i = 0; i < engine.constraintIterations; i++) {\n Constraint.solveAll(allConstraints, delta);\n }\n Constraint.postSolveAll(allBodies);\n\n // iteratively resolve velocity between collisions\n Resolver.preSolveVelocity(pairs.list);\n for (i = 0; i < engine.velocityIterations; i++) {\n Resolver.solveVelocity(pairs.list, delta);\n }\n\n // update body speed and velocity properties\n Engine._bodiesUpdateVelocities(allBodies);\n\n // trigger collision events\n if (pairs.collisionActive.length > 0) {\n Events.trigger(engine, 'collisionActive', { \n pairs: pairs.collisionActive, \n timestamp: timing.timestamp,\n delta: delta\n });\n }\n\n if (pairs.collisionEnd.length > 0) {\n Events.trigger(engine, 'collisionEnd', {\n pairs: pairs.collisionEnd,\n timestamp: timing.timestamp,\n delta: delta\n });\n }\n\n // clear force buffers\n Engine._bodiesClearForces(allBodies);\n\n Events.trigger(engine, 'afterUpdate', event);\n\n // log the time elapsed computing this update\n engine.timing.lastElapsed = Common.now() - startTime;\n\n return engine;\n };\n \n /**\n * Merges two engines by keeping the configuration of `engineA` but replacing the world with the one from `engineB`.\n * @method merge\n * @param {engine} engineA\n * @param {engine} engineB\n */\n Engine.merge = function(engineA, engineB) {\n Common.extend(engineA, engineB);\n \n if (engineB.world) {\n engineA.world = engineB.world;\n\n Engine.clear(engineA);\n\n var bodies = Composite.allBodies(engineA.world);\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n Sleeping.set(body, false);\n body.id = Common.nextId();\n }\n }\n };\n\n /**\n * Clears the engine pairs and detector.\n * @method clear\n * @param {engine} engine\n */\n Engine.clear = function(engine) {\n Pairs.clear(engine.pairs);\n Detector.clear(engine.detector);\n };\n\n /**\n * Zeroes the `body.force` and `body.torque` force buffers.\n * @method _bodiesClearForces\n * @private\n * @param {body[]} bodies\n */\n Engine._bodiesClearForces = function(bodies) {\n var bodiesLength = bodies.length;\n\n for (var i = 0; i < bodiesLength; i++) {\n var body = bodies[i];\n\n // reset force buffers\n body.force.x = 0;\n body.force.y = 0;\n body.torque = 0;\n }\n };\n\n /**\n * Applies gravitational acceleration to all `bodies`.\n * This models a [uniform gravitational field](https://en.wikipedia.org/wiki/Gravity_of_Earth), similar to near the surface of a planet.\n * \n * @method _bodiesApplyGravity\n * @private\n * @param {body[]} bodies\n * @param {vector} gravity\n */\n Engine._bodiesApplyGravity = function(bodies, gravity) {\n var gravityScale = typeof gravity.scale !== 'undefined' ? gravity.scale : 0.001,\n bodiesLength = bodies.length;\n\n if ((gravity.x === 0 && gravity.y === 0) || gravityScale === 0) {\n return;\n }\n \n for (var i = 0; i < bodiesLength; i++) {\n var body = bodies[i];\n\n if (body.isStatic || body.isSleeping)\n continue;\n\n // add the resultant force of gravity\n body.force.y += body.mass * gravity.y * gravityScale;\n body.force.x += body.mass * gravity.x * gravityScale;\n }\n };\n\n /**\n * Applies `Body.update` to all given `bodies`.\n * @method _bodiesUpdate\n * @private\n * @param {body[]} bodies\n * @param {number} delta The amount of time elapsed between updates\n */\n Engine._bodiesUpdate = function(bodies, delta) {\n var bodiesLength = bodies.length;\n\n for (var i = 0; i < bodiesLength; i++) {\n var body = bodies[i];\n\n if (body.isStatic || body.isSleeping)\n continue;\n\n Body.update(body, delta);\n }\n };\n\n /**\n * Applies `Body.updateVelocities` to all given `bodies`.\n * @method _bodiesUpdateVelocities\n * @private\n * @param {body[]} bodies\n */\n Engine._bodiesUpdateVelocities = function(bodies) {\n var bodiesLength = bodies.length;\n\n for (var i = 0; i < bodiesLength; i++) {\n Body.updateVelocities(bodies[i]);\n }\n };\n\n /**\n * A deprecated alias for `Runner.run`, use `Matter.Runner.run(engine)` instead and see `Matter.Runner` for more information.\n * @deprecated use Matter.Runner.run(engine) instead\n * @method run\n * @param {engine} engine\n */\n\n /**\n * Fired just before an update\n *\n * @event beforeUpdate\n * @param {object} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /**\n * Fired after bodies updated based on their velocity and forces, but before any collision detection, constraints and resolving etc.\n *\n * @event beforeSolve\n * @param {object} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /**\n * Fired after engine update and all collision events\n *\n * @event afterUpdate\n * @param {object} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /**\n * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any)\n *\n * @event collisionStart\n * @param {object} event An event object\n * @param {pair[]} event.pairs List of affected pairs\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /**\n * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any)\n *\n * @event collisionActive\n * @param {object} event An event object\n * @param {pair[]} event.pairs List of affected pairs\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /**\n * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any)\n *\n * @event collisionEnd\n * @param {object} event An event object\n * @param {pair[]} event.pairs List of affected pairs\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {number} event.delta The delta time in milliseconds value used in the update\n * @param {engine} event.source The source object of the event\n * @param {string} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * An integer `Number` that specifies the number of position iterations to perform each update.\n * The higher the value, the higher quality the simulation will be at the expense of performance.\n *\n * @property positionIterations\n * @type number\n * @default 6\n */\n\n /**\n * An integer `Number` that specifies the number of velocity iterations to perform each update.\n * The higher the value, the higher quality the simulation will be at the expense of performance.\n *\n * @property velocityIterations\n * @type number\n * @default 4\n */\n\n /**\n * An integer `Number` that specifies the number of constraint iterations to perform each update.\n * The higher the value, the higher quality the simulation will be at the expense of performance.\n * The default value of `2` is usually very adequate.\n *\n * @property constraintIterations\n * @type number\n * @default 2\n */\n\n /**\n * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module.\n * Sleeping can improve stability and performance, but often at the expense of accuracy.\n *\n * @property enableSleeping\n * @type boolean\n * @default false\n */\n\n /**\n * An `Object` containing properties regarding the timing systems of the engine. \n *\n * @property timing\n * @type object\n */\n\n /**\n * A `Number` that specifies the global scaling factor of time for all bodies.\n * A value of `0` freezes the simulation.\n * A value of `0.1` gives a slow-motion effect.\n * A value of `1.2` gives a speed-up effect.\n *\n * @property timing.timeScale\n * @type number\n * @default 1\n */\n\n /**\n * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. \n * It is incremented on every `Engine.update` by the given `delta` argument. \n * \n * @property timing.timestamp\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that represents the total execution time elapsed during the last `Engine.update` in milliseconds.\n * It is updated by timing from the start of the last `Engine.update` call until it ends.\n *\n * This value will also include the total execution time of all event handlers directly or indirectly triggered by the engine update.\n * \n * @property timing.lastElapsed\n * @type number\n * @default 0\n */\n\n /**\n * A `Number` that represents the `delta` value used in the last engine update.\n * \n * @property timing.lastDelta\n * @type number\n * @default 0\n */\n\n /**\n * A `Matter.Detector` instance.\n *\n * @property detector\n * @type detector\n * @default a Matter.Detector instance\n */\n\n /**\n * A `Matter.Grid` instance.\n *\n * @deprecated replaced by `engine.detector`\n * @property grid\n * @type grid\n * @default a Matter.Grid instance\n */\n\n /**\n * Replaced by and now alias for `engine.grid`.\n *\n * @deprecated replaced by `engine.detector`\n * @property broadphase\n * @type grid\n * @default a Matter.Grid instance\n */\n\n /**\n * The root `Matter.Composite` instance that will contain all bodies, constraints and other composites to be simulated by this engine.\n *\n * @property world\n * @type composite\n * @default a Matter.Composite instance\n */\n\n /**\n * An object reserved for storing plugin-specific properties.\n *\n * @property plugin\n * @type {}\n */\n\n /**\n * An optional gravitational acceleration applied to all bodies in `engine.world` on every update.\n * \n * This models a [uniform gravitational field](https://en.wikipedia.org/wiki/Gravity_of_Earth), similar to near the surface of a planet. For gravity in other contexts, disable this and apply forces as needed.\n * \n * To disable set the `scale` component to `0`.\n * \n * This is split into three components for ease of use: \n * a normalised direction (`x` and `y`) and magnitude (`scale`).\n *\n * @property gravity\n * @type object\n */\n\n /**\n * The gravitational direction normal `x` component, to be multiplied by `gravity.scale`.\n * \n * @property gravity.x\n * @type object\n * @default 0\n */\n\n /**\n * The gravitational direction normal `y` component, to be multiplied by `gravity.scale`.\n *\n * @property gravity.y\n * @type object\n * @default 1\n */\n\n /**\n * The magnitude of the gravitational acceleration.\n * \n * @property gravity.scale\n * @type object\n * @default 0.001\n */\n\n})();\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Resolver` module contains methods for resolving collision pairs.\n*\n* @class Resolver\n*/\n\nvar Resolver = {};\n\nmodule.exports = Resolver;\n\nvar Vertices = __webpack_require__(3);\nvar Common = __webpack_require__(0);\nvar Bounds = __webpack_require__(1);\n\n(function() {\n\n Resolver._restingThresh = 2;\n Resolver._restingThreshTangent = Math.sqrt(6);\n Resolver._positionDampen = 0.9;\n Resolver._positionWarming = 0.8;\n Resolver._frictionNormalMultiplier = 5;\n Resolver._frictionMaxStatic = Number.MAX_VALUE;\n\n /**\n * Prepare pairs for position solving.\n * @method preSolvePosition\n * @param {pair[]} pairs\n */\n Resolver.preSolvePosition = function(pairs) {\n var i,\n pair,\n contactCount,\n pairsLength = pairs.length;\n\n // find total contacts on each body\n for (i = 0; i < pairsLength; i++) {\n pair = pairs[i];\n \n if (!pair.isActive)\n continue;\n \n contactCount = pair.contactCount;\n pair.collision.parentA.totalContacts += contactCount;\n pair.collision.parentB.totalContacts += contactCount;\n }\n };\n\n /**\n * Find a solution for pair positions.\n * @method solvePosition\n * @param {pair[]} pairs\n * @param {number} delta\n * @param {number} [damping=1]\n */\n Resolver.solvePosition = function(pairs, delta, damping) {\n var i,\n pair,\n collision,\n bodyA,\n bodyB,\n normal,\n contactShare,\n positionImpulse,\n positionDampen = Resolver._positionDampen * (damping || 1),\n slopDampen = Common.clamp(delta / Common._baseDelta, 0, 1),\n pairsLength = pairs.length;\n\n // find impulses required to resolve penetration\n for (i = 0; i < pairsLength; i++) {\n pair = pairs[i];\n \n if (!pair.isActive || pair.isSensor)\n continue;\n\n collision = pair.collision;\n bodyA = collision.parentA;\n bodyB = collision.parentB;\n normal = collision.normal;\n\n // get current separation between body edges involved in collision\n pair.separation = \n collision.depth + normal.x * (bodyB.positionImpulse.x - bodyA.positionImpulse.x)\n + normal.y * (bodyB.positionImpulse.y - bodyA.positionImpulse.y);\n }\n \n for (i = 0; i < pairsLength; i++) {\n pair = pairs[i];\n\n if (!pair.isActive || pair.isSensor)\n continue;\n \n collision = pair.collision;\n bodyA = collision.parentA;\n bodyB = collision.parentB;\n normal = collision.normal;\n positionImpulse = pair.separation - pair.slop * slopDampen;\n\n if (bodyA.isStatic || bodyB.isStatic)\n positionImpulse *= 2;\n \n if (!(bodyA.isStatic || bodyA.isSleeping)) {\n contactShare = positionDampen / bodyA.totalContacts;\n bodyA.positionImpulse.x += normal.x * positionImpulse * contactShare;\n bodyA.positionImpulse.y += normal.y * positionImpulse * contactShare;\n }\n\n if (!(bodyB.isStatic || bodyB.isSleeping)) {\n contactShare = positionDampen / bodyB.totalContacts;\n bodyB.positionImpulse.x -= normal.x * positionImpulse * contactShare;\n bodyB.positionImpulse.y -= normal.y * positionImpulse * contactShare;\n }\n }\n };\n\n /**\n * Apply position resolution.\n * @method postSolvePosition\n * @param {body[]} bodies\n */\n Resolver.postSolvePosition = function(bodies) {\n var positionWarming = Resolver._positionWarming,\n bodiesLength = bodies.length,\n verticesTranslate = Vertices.translate,\n boundsUpdate = Bounds.update;\n\n for (var i = 0; i < bodiesLength; i++) {\n var body = bodies[i],\n positionImpulse = body.positionImpulse,\n positionImpulseX = positionImpulse.x,\n positionImpulseY = positionImpulse.y,\n velocity = body.velocity;\n\n // reset contact count\n body.totalContacts = 0;\n\n if (positionImpulseX !== 0 || positionImpulseY !== 0) {\n // update body geometry\n for (var j = 0; j < body.parts.length; j++) {\n var part = body.parts[j];\n verticesTranslate(part.vertices, positionImpulse);\n boundsUpdate(part.bounds, part.vertices, velocity);\n part.position.x += positionImpulseX;\n part.position.y += positionImpulseY;\n }\n\n // move the body without changing velocity\n body.positionPrev.x += positionImpulseX;\n body.positionPrev.y += positionImpulseY;\n\n if (positionImpulseX * velocity.x + positionImpulseY * velocity.y < 0) {\n // reset cached impulse if the body has velocity along it\n positionImpulse.x = 0;\n positionImpulse.y = 0;\n } else {\n // warm the next iteration\n positionImpulse.x *= positionWarming;\n positionImpulse.y *= positionWarming;\n }\n }\n }\n };\n\n /**\n * Prepare pairs for velocity solving.\n * @method preSolveVelocity\n * @param {pair[]} pairs\n */\n Resolver.preSolveVelocity = function(pairs) {\n var pairsLength = pairs.length,\n i,\n j;\n \n for (i = 0; i < pairsLength; i++) {\n var pair = pairs[i];\n \n if (!pair.isActive || pair.isSensor)\n continue;\n \n var contacts = pair.contacts,\n contactCount = pair.contactCount,\n collision = pair.collision,\n bodyA = collision.parentA,\n bodyB = collision.parentB,\n normal = collision.normal,\n tangent = collision.tangent;\n \n // resolve each contact\n for (j = 0; j < contactCount; j++) {\n var contact = contacts[j],\n contactVertex = contact.vertex,\n normalImpulse = contact.normalImpulse,\n tangentImpulse = contact.tangentImpulse;\n \n if (normalImpulse !== 0 || tangentImpulse !== 0) {\n // total impulse from contact\n var impulseX = normal.x * normalImpulse + tangent.x * tangentImpulse,\n impulseY = normal.y * normalImpulse + tangent.y * tangentImpulse;\n \n // apply impulse from contact\n if (!(bodyA.isStatic || bodyA.isSleeping)) {\n bodyA.positionPrev.x += impulseX * bodyA.inverseMass;\n bodyA.positionPrev.y += impulseY * bodyA.inverseMass;\n bodyA.anglePrev += bodyA.inverseInertia * (\n (contactVertex.x - bodyA.position.x) * impulseY\n - (contactVertex.y - bodyA.position.y) * impulseX\n );\n }\n \n if (!(bodyB.isStatic || bodyB.isSleeping)) {\n bodyB.positionPrev.x -= impulseX * bodyB.inverseMass;\n bodyB.positionPrev.y -= impulseY * bodyB.inverseMass;\n bodyB.anglePrev -= bodyB.inverseInertia * (\n (contactVertex.x - bodyB.position.x) * impulseY \n - (contactVertex.y - bodyB.position.y) * impulseX\n );\n }\n }\n }\n }\n };\n\n /**\n * Find a solution for pair velocities.\n * @method solveVelocity\n * @param {pair[]} pairs\n * @param {number} delta\n */\n Resolver.solveVelocity = function(pairs, delta) {\n var timeScale = delta / Common._baseDelta,\n timeScaleSquared = timeScale * timeScale,\n timeScaleCubed = timeScaleSquared * timeScale,\n restingThresh = -Resolver._restingThresh * timeScale,\n restingThreshTangent = Resolver._restingThreshTangent,\n frictionNormalMultiplier = Resolver._frictionNormalMultiplier * timeScale,\n frictionMaxStatic = Resolver._frictionMaxStatic,\n pairsLength = pairs.length,\n tangentImpulse,\n maxFriction,\n i,\n j;\n\n for (i = 0; i < pairsLength; i++) {\n var pair = pairs[i];\n \n if (!pair.isActive || pair.isSensor)\n continue;\n \n var collision = pair.collision,\n bodyA = collision.parentA,\n bodyB = collision.parentB,\n normalX = collision.normal.x,\n normalY = collision.normal.y,\n tangentX = collision.tangent.x,\n tangentY = collision.tangent.y,\n inverseMassTotal = pair.inverseMass,\n friction = pair.friction * pair.frictionStatic * frictionNormalMultiplier,\n contacts = pair.contacts,\n contactCount = pair.contactCount,\n contactShare = 1 / contactCount;\n\n // get body velocities\n var bodyAVelocityX = bodyA.position.x - bodyA.positionPrev.x,\n bodyAVelocityY = bodyA.position.y - bodyA.positionPrev.y,\n bodyAAngularVelocity = bodyA.angle - bodyA.anglePrev,\n bodyBVelocityX = bodyB.position.x - bodyB.positionPrev.x,\n bodyBVelocityY = bodyB.position.y - bodyB.positionPrev.y,\n bodyBAngularVelocity = bodyB.angle - bodyB.anglePrev;\n\n // resolve each contact\n for (j = 0; j < contactCount; j++) {\n var contact = contacts[j],\n contactVertex = contact.vertex;\n\n var offsetAX = contactVertex.x - bodyA.position.x,\n offsetAY = contactVertex.y - bodyA.position.y,\n offsetBX = contactVertex.x - bodyB.position.x,\n offsetBY = contactVertex.y - bodyB.position.y;\n \n var velocityPointAX = bodyAVelocityX - offsetAY * bodyAAngularVelocity,\n velocityPointAY = bodyAVelocityY + offsetAX * bodyAAngularVelocity,\n velocityPointBX = bodyBVelocityX - offsetBY * bodyBAngularVelocity,\n velocityPointBY = bodyBVelocityY + offsetBX * bodyBAngularVelocity;\n\n var relativeVelocityX = velocityPointAX - velocityPointBX,\n relativeVelocityY = velocityPointAY - velocityPointBY;\n\n var normalVelocity = normalX * relativeVelocityX + normalY * relativeVelocityY,\n tangentVelocity = tangentX * relativeVelocityX + tangentY * relativeVelocityY;\n\n // coulomb friction\n var normalOverlap = pair.separation + normalVelocity;\n var normalForce = Math.min(normalOverlap, 1);\n normalForce = normalOverlap < 0 ? 0 : normalForce;\n\n var frictionLimit = normalForce * friction;\n\n if (tangentVelocity < -frictionLimit || tangentVelocity > frictionLimit) {\n maxFriction = (tangentVelocity > 0 ? tangentVelocity : -tangentVelocity);\n tangentImpulse = pair.friction * (tangentVelocity > 0 ? 1 : -1) * timeScaleCubed;\n \n if (tangentImpulse < -maxFriction) {\n tangentImpulse = -maxFriction;\n } else if (tangentImpulse > maxFriction) {\n tangentImpulse = maxFriction;\n }\n } else {\n tangentImpulse = tangentVelocity;\n maxFriction = frictionMaxStatic;\n }\n\n // account for mass, inertia and contact offset\n var oAcN = offsetAX * normalY - offsetAY * normalX,\n oBcN = offsetBX * normalY - offsetBY * normalX,\n share = contactShare / (inverseMassTotal + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN);\n\n // raw impulses\n var normalImpulse = (1 + pair.restitution) * normalVelocity * share;\n tangentImpulse *= share;\n\n // handle high velocity and resting collisions separately\n if (normalVelocity < restingThresh) {\n // high normal velocity so clear cached contact normal impulse\n contact.normalImpulse = 0;\n } else {\n // solve resting collision constraints using Erin Catto's method (GDC08)\n // impulse constraint tends to 0\n var contactNormalImpulse = contact.normalImpulse;\n contact.normalImpulse += normalImpulse;\n if (contact.normalImpulse > 0) contact.normalImpulse = 0;\n normalImpulse = contact.normalImpulse - contactNormalImpulse;\n }\n\n // handle high velocity and resting collisions separately\n if (tangentVelocity < -restingThreshTangent || tangentVelocity > restingThreshTangent) {\n // high tangent velocity so clear cached contact tangent impulse\n contact.tangentImpulse = 0;\n } else {\n // solve resting collision constraints using Erin Catto's method (GDC08)\n // tangent impulse tends to -tangentSpeed or +tangentSpeed\n var contactTangentImpulse = contact.tangentImpulse;\n contact.tangentImpulse += tangentImpulse;\n if (contact.tangentImpulse < -maxFriction) contact.tangentImpulse = -maxFriction;\n if (contact.tangentImpulse > maxFriction) contact.tangentImpulse = maxFriction;\n tangentImpulse = contact.tangentImpulse - contactTangentImpulse;\n }\n\n // total impulse from contact\n var impulseX = normalX * normalImpulse + tangentX * tangentImpulse,\n impulseY = normalY * normalImpulse + tangentY * tangentImpulse;\n \n // apply impulse from contact\n if (!(bodyA.isStatic || bodyA.isSleeping)) {\n bodyA.positionPrev.x += impulseX * bodyA.inverseMass;\n bodyA.positionPrev.y += impulseY * bodyA.inverseMass;\n bodyA.anglePrev += (offsetAX * impulseY - offsetAY * impulseX) * bodyA.inverseInertia;\n }\n\n if (!(bodyB.isStatic || bodyB.isSleeping)) {\n bodyB.positionPrev.x -= impulseX * bodyB.inverseMass;\n bodyB.positionPrev.y -= impulseY * bodyB.inverseMass;\n bodyB.anglePrev -= (offsetBX * impulseY - offsetBY * impulseX) * bodyB.inverseInertia;\n }\n }\n }\n };\n\n})();\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets.\n*\n* @class Pairs\n*/\n\nvar Pairs = {};\n\nmodule.exports = Pairs;\n\nvar Pair = __webpack_require__(9);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Creates a new pairs structure.\n * @method create\n * @param {object} options\n * @return {pairs} A new pairs structure\n */\n Pairs.create = function(options) {\n return Common.extend({ \n table: {},\n list: [],\n collisionStart: [],\n collisionActive: [],\n collisionEnd: []\n }, options);\n };\n\n /**\n * Updates pairs given a list of collisions.\n * @method update\n * @param {object} pairs\n * @param {collision[]} collisions\n * @param {number} timestamp\n */\n Pairs.update = function(pairs, collisions, timestamp) {\n var pairUpdate = Pair.update,\n pairCreate = Pair.create,\n pairSetActive = Pair.setActive,\n pairsTable = pairs.table,\n pairsList = pairs.list,\n pairsListLength = pairsList.length,\n pairsListIndex = pairsListLength,\n collisionStart = pairs.collisionStart,\n collisionEnd = pairs.collisionEnd,\n collisionActive = pairs.collisionActive,\n collisionsLength = collisions.length,\n collisionStartIndex = 0,\n collisionEndIndex = 0,\n collisionActiveIndex = 0,\n collision,\n pair,\n i;\n\n for (i = 0; i < collisionsLength; i++) {\n collision = collisions[i];\n pair = collision.pair;\n\n if (pair) {\n // pair already exists (but may or may not be active)\n if (pair.isActive) {\n // pair exists and is active\n collisionActive[collisionActiveIndex++] = pair;\n }\n\n // update the pair\n pairUpdate(pair, collision, timestamp);\n } else {\n // pair did not exist, create a new pair\n pair = pairCreate(collision, timestamp);\n pairsTable[pair.id] = pair;\n\n // add the new pair\n collisionStart[collisionStartIndex++] = pair;\n pairsList[pairsListIndex++] = pair;\n }\n }\n\n // find pairs that are no longer active\n pairsListIndex = 0;\n pairsListLength = pairsList.length;\n\n for (i = 0; i < pairsListLength; i++) {\n pair = pairsList[i];\n \n // pair is active if updated this timestep\n if (pair.timeUpdated >= timestamp) {\n // keep active pairs\n pairsList[pairsListIndex++] = pair;\n } else {\n pairSetActive(pair, false, timestamp);\n\n // keep inactive pairs if both bodies may be sleeping\n if (pair.collision.bodyA.sleepCounter > 0 && pair.collision.bodyB.sleepCounter > 0) {\n pairsList[pairsListIndex++] = pair;\n } else {\n // remove inactive pairs if either body awake\n collisionEnd[collisionEndIndex++] = pair;\n delete pairsTable[pair.id];\n }\n }\n }\n\n // update array lengths if changed\n if (pairsList.length !== pairsListIndex) {\n pairsList.length = pairsListIndex;\n }\n\n if (collisionStart.length !== collisionStartIndex) {\n collisionStart.length = collisionStartIndex;\n }\n\n if (collisionEnd.length !== collisionEndIndex) {\n collisionEnd.length = collisionEndIndex;\n }\n\n if (collisionActive.length !== collisionActiveIndex) {\n collisionActive.length = collisionActiveIndex;\n }\n };\n\n /**\n * Clears the given pairs structure.\n * @method clear\n * @param {pairs} pairs\n * @return {pairs} pairs\n */\n Pairs.clear = function(pairs) {\n pairs.table = {};\n pairs.list.length = 0;\n pairs.collisionStart.length = 0;\n pairs.collisionActive.length = 0;\n pairs.collisionEnd.length = 0;\n return pairs;\n };\n\n})();\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Matter = module.exports = __webpack_require__(21);\r\n\r\nMatter.Axes = __webpack_require__(11);\r\nMatter.Bodies = __webpack_require__(12);\r\nMatter.Body = __webpack_require__(4);\r\nMatter.Bounds = __webpack_require__(1);\r\nMatter.Collision = __webpack_require__(8);\r\nMatter.Common = __webpack_require__(0);\r\nMatter.Composite = __webpack_require__(6);\r\nMatter.Composites = __webpack_require__(22);\r\nMatter.Constraint = __webpack_require__(10);\r\nMatter.Contact = __webpack_require__(16);\r\nMatter.Detector = __webpack_require__(13);\r\nMatter.Engine = __webpack_require__(17);\r\nMatter.Events = __webpack_require__(5);\r\nMatter.Grid = __webpack_require__(23);\r\nMatter.Mouse = __webpack_require__(14);\r\nMatter.MouseConstraint = __webpack_require__(24);\r\nMatter.Pair = __webpack_require__(9);\r\nMatter.Pairs = __webpack_require__(19);\r\nMatter.Plugin = __webpack_require__(15);\r\nMatter.Query = __webpack_require__(25);\r\nMatter.Render = __webpack_require__(26);\r\nMatter.Resolver = __webpack_require__(18);\r\nMatter.Runner = __webpack_require__(27);\r\nMatter.SAT = __webpack_require__(28);\r\nMatter.Sleeping = __webpack_require__(7);\r\nMatter.Svg = __webpack_require__(29);\r\nMatter.Vector = __webpack_require__(2);\r\nMatter.Vertices = __webpack_require__(3);\r\nMatter.World = __webpack_require__(30);\r\n\r\n// temporary back compatibility\r\nMatter.Engine.run = Matter.Runner.run;\r\nMatter.Common.deprecated(Matter.Engine, 'run', 'Engine.run ➤ use Matter.Runner.run(engine) instead');\r\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\r\n* The `Matter` module is the top level namespace. It also includes a function for installing plugins on top of the library.\r\n*\r\n* @class Matter\r\n*/\r\n\r\nvar Matter = {};\r\n\r\nmodule.exports = Matter;\r\n\r\nvar Plugin = __webpack_require__(15);\r\nvar Common = __webpack_require__(0);\r\n\r\n(function() {\r\n\r\n /**\r\n * The library name.\r\n * @property name\r\n * @readOnly\r\n * @type {String}\r\n */\r\n Matter.name = 'matter-js';\r\n\r\n /**\r\n * The library version.\r\n * @property version\r\n * @readOnly\r\n * @type {String}\r\n */\r\n Matter.version = true ? \"0.20.0\" : undefined;\r\n\r\n /**\r\n * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`.\r\n * Alternatively you may set `Matter.uses` manually and install them by calling `Plugin.use(Matter)`.\r\n * @property uses\r\n * @type {Array}\r\n */\r\n Matter.uses = [];\r\n\r\n /**\r\n * The plugins that have been installed through `Matter.Plugin.install`. Read only.\r\n * @property used\r\n * @readOnly\r\n * @type {Array}\r\n */\r\n Matter.used = [];\r\n\r\n /**\r\n * Installs the given plugins on the `Matter` namespace.\r\n * This is a short-hand for `Plugin.use`, see it for more information.\r\n * Call this function once at the start of your code, with all of the plugins you wish to install as arguments.\r\n * Avoid calling this function multiple times unless you intend to manually control installation order.\r\n * @method use\r\n * @param ...plugin {Function} The plugin(s) to install on `base` (multi-argument).\r\n */\r\n Matter.use = function() {\r\n Plugin.use(Matter, Array.prototype.slice.call(arguments));\r\n };\r\n\r\n /**\r\n * Chains a function to excute before the original function on the given `path` relative to `Matter`.\r\n * See also docs for `Common.chain`.\r\n * @method before\r\n * @param {string} path The path relative to `Matter`\r\n * @param {function} func The function to chain before the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Matter.before = function(path, func) {\r\n path = path.replace(/^Matter./, '');\r\n return Common.chainPathBefore(Matter, path, func);\r\n };\r\n\r\n /**\r\n * Chains a function to excute after the original function on the given `path` relative to `Matter`.\r\n * See also docs for `Common.chain`.\r\n * @method after\r\n * @param {string} path The path relative to `Matter`\r\n * @param {function} func The function to chain after the original\r\n * @return {function} The chained function that replaced the original\r\n */\r\n Matter.after = function(path, func) {\r\n path = path.replace(/^Matter./, '');\r\n return Common.chainPathAfter(Matter, path, func);\r\n };\r\n\r\n})();\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Composites` module contains factory methods for creating composite bodies\n* with commonly used configurations (such as stacks and chains).\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Composites\n*/\n\nvar Composites = {};\n\nmodule.exports = Composites;\n\nvar Composite = __webpack_require__(6);\nvar Constraint = __webpack_require__(10);\nvar Common = __webpack_require__(0);\nvar Body = __webpack_require__(4);\nvar Bodies = __webpack_require__(12);\nvar deprecated = Common.deprecated;\n\n(function() {\n\n /**\n * Create a new composite containing bodies created in the callback in a grid arrangement.\n * This function uses the body's bounds to prevent overlaps.\n * @method stack\n * @param {number} x Starting position in X.\n * @param {number} y Starting position in Y.\n * @param {number} columns\n * @param {number} rows\n * @param {number} columnGap\n * @param {number} rowGap\n * @param {function} callback\n * @return {composite} A new composite containing objects created in the callback\n */\n Composites.stack = function(x, y, columns, rows, columnGap, rowGap, callback) {\n var stack = Composite.create({ label: 'Stack' }),\n currentX = x,\n currentY = y,\n lastBody,\n i = 0;\n\n for (var row = 0; row < rows; row++) {\n var maxHeight = 0;\n \n for (var column = 0; column < columns; column++) {\n var body = callback(currentX, currentY, column, row, lastBody, i);\n \n if (body) {\n var bodyHeight = body.bounds.max.y - body.bounds.min.y,\n bodyWidth = body.bounds.max.x - body.bounds.min.x; \n\n if (bodyHeight > maxHeight)\n maxHeight = bodyHeight;\n \n Body.translate(body, { x: bodyWidth * 0.5, y: bodyHeight * 0.5 });\n\n currentX = body.bounds.max.x + columnGap;\n\n Composite.addBody(stack, body);\n \n lastBody = body;\n i += 1;\n } else {\n currentX += columnGap;\n }\n }\n \n currentY += maxHeight + rowGap;\n currentX = x;\n }\n\n return stack;\n };\n \n /**\n * Chains all bodies in the given composite together using constraints.\n * @method chain\n * @param {composite} composite\n * @param {number} xOffsetA\n * @param {number} yOffsetA\n * @param {number} xOffsetB\n * @param {number} yOffsetB\n * @param {object} options\n * @return {composite} A new composite containing objects chained together with constraints\n */\n Composites.chain = function(composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options) {\n var bodies = composite.bodies;\n \n for (var i = 1; i < bodies.length; i++) {\n var bodyA = bodies[i - 1],\n bodyB = bodies[i],\n bodyAHeight = bodyA.bounds.max.y - bodyA.bounds.min.y,\n bodyAWidth = bodyA.bounds.max.x - bodyA.bounds.min.x, \n bodyBHeight = bodyB.bounds.max.y - bodyB.bounds.min.y,\n bodyBWidth = bodyB.bounds.max.x - bodyB.bounds.min.x;\n \n var defaults = {\n bodyA: bodyA,\n pointA: { x: bodyAWidth * xOffsetA, y: bodyAHeight * yOffsetA },\n bodyB: bodyB,\n pointB: { x: bodyBWidth * xOffsetB, y: bodyBHeight * yOffsetB }\n };\n \n var constraint = Common.extend(defaults, options);\n \n Composite.addConstraint(composite, Constraint.create(constraint));\n }\n\n composite.label += ' Chain';\n \n return composite;\n };\n\n /**\n * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces.\n * @method mesh\n * @param {composite} composite\n * @param {number} columns\n * @param {number} rows\n * @param {boolean} crossBrace\n * @param {object} options\n * @return {composite} The composite containing objects meshed together with constraints\n */\n Composites.mesh = function(composite, columns, rows, crossBrace, options) {\n var bodies = composite.bodies,\n row,\n col,\n bodyA,\n bodyB,\n bodyC;\n \n for (row = 0; row < rows; row++) {\n for (col = 1; col < columns; col++) {\n bodyA = bodies[(col - 1) + (row * columns)];\n bodyB = bodies[col + (row * columns)];\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options)));\n }\n\n if (row > 0) {\n for (col = 0; col < columns; col++) {\n bodyA = bodies[col + ((row - 1) * columns)];\n bodyB = bodies[col + (row * columns)];\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options)));\n\n if (crossBrace && col > 0) {\n bodyC = bodies[(col - 1) + ((row - 1) * columns)];\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options)));\n }\n\n if (crossBrace && col < columns - 1) {\n bodyC = bodies[(col + 1) + ((row - 1) * columns)];\n Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options)));\n }\n }\n }\n }\n\n composite.label += ' Mesh';\n \n return composite;\n };\n \n /**\n * Create a new composite containing bodies created in the callback in a pyramid arrangement.\n * This function uses the body's bounds to prevent overlaps.\n * @method pyramid\n * @param {number} x Starting position in X.\n * @param {number} y Starting position in Y.\n * @param {number} columns\n * @param {number} rows\n * @param {number} columnGap\n * @param {number} rowGap\n * @param {function} callback\n * @return {composite} A new composite containing objects created in the callback\n */\n Composites.pyramid = function(x, y, columns, rows, columnGap, rowGap, callback) {\n return Composites.stack(x, y, columns, rows, columnGap, rowGap, function(stackX, stackY, column, row, lastBody, i) {\n var actualRows = Math.min(rows, Math.ceil(columns / 2)),\n lastBodyWidth = lastBody ? lastBody.bounds.max.x - lastBody.bounds.min.x : 0;\n \n if (row > actualRows)\n return;\n \n // reverse row order\n row = actualRows - row;\n \n var start = row,\n end = columns - 1 - row;\n\n if (column < start || column > end)\n return;\n \n // retroactively fix the first body's position, since width was unknown\n if (i === 1) {\n Body.translate(lastBody, { x: (column + (columns % 2 === 1 ? 1 : -1)) * lastBodyWidth, y: 0 });\n }\n\n var xOffset = lastBody ? column * lastBodyWidth : 0;\n \n return callback(x + xOffset + column * columnGap, stackY, column, row, lastBody, i);\n });\n };\n\n /**\n * This has now moved to the [newtonsCradle example](https://github.com/liabru/matter-js/blob/master/examples/newtonsCradle.js), follow that instead as this function is deprecated here.\n * @deprecated moved to newtonsCradle example\n * @method newtonsCradle\n * @param {number} x Starting position in X.\n * @param {number} y Starting position in Y.\n * @param {number} number\n * @param {number} size\n * @param {number} length\n * @return {composite} A new composite newtonsCradle body\n */\n Composites.newtonsCradle = function(x, y, number, size, length) {\n var newtonsCradle = Composite.create({ label: 'Newtons Cradle' });\n\n for (var i = 0; i < number; i++) {\n var separation = 1.9,\n circle = Bodies.circle(x + i * (size * separation), y + length, size, \n { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }),\n constraint = Constraint.create({ pointA: { x: x + i * (size * separation), y: y }, bodyB: circle });\n\n Composite.addBody(newtonsCradle, circle);\n Composite.addConstraint(newtonsCradle, constraint);\n }\n\n return newtonsCradle;\n };\n\n deprecated(Composites, 'newtonsCradle', 'Composites.newtonsCradle ➤ moved to newtonsCradle example');\n \n /**\n * This has now moved to the [car example](https://github.com/liabru/matter-js/blob/master/examples/car.js), follow that instead as this function is deprecated here.\n * @deprecated moved to car example\n * @method car\n * @param {number} x Starting position in X.\n * @param {number} y Starting position in Y.\n * @param {number} width\n * @param {number} height\n * @param {number} wheelSize\n * @return {composite} A new composite car body\n */\n Composites.car = function(x, y, width, height, wheelSize) {\n var group = Body.nextGroup(true),\n wheelBase = 20,\n wheelAOffset = -width * 0.5 + wheelBase,\n wheelBOffset = width * 0.5 - wheelBase,\n wheelYOffset = 0;\n \n var car = Composite.create({ label: 'Car' }),\n body = Bodies.rectangle(x, y, width, height, { \n collisionFilter: {\n group: group\n },\n chamfer: {\n radius: height * 0.5\n },\n density: 0.0002\n });\n \n var wheelA = Bodies.circle(x + wheelAOffset, y + wheelYOffset, wheelSize, { \n collisionFilter: {\n group: group\n },\n friction: 0.8\n });\n \n var wheelB = Bodies.circle(x + wheelBOffset, y + wheelYOffset, wheelSize, { \n collisionFilter: {\n group: group\n },\n friction: 0.8\n });\n \n var axelA = Constraint.create({\n bodyB: body,\n pointB: { x: wheelAOffset, y: wheelYOffset },\n bodyA: wheelA,\n stiffness: 1,\n length: 0\n });\n \n var axelB = Constraint.create({\n bodyB: body,\n pointB: { x: wheelBOffset, y: wheelYOffset },\n bodyA: wheelB,\n stiffness: 1,\n length: 0\n });\n \n Composite.addBody(car, body);\n Composite.addBody(car, wheelA);\n Composite.addBody(car, wheelB);\n Composite.addConstraint(car, axelA);\n Composite.addConstraint(car, axelB);\n\n return car;\n };\n\n deprecated(Composites, 'car', 'Composites.car ➤ moved to car example');\n\n /**\n * This has now moved to the [softBody example](https://github.com/liabru/matter-js/blob/master/examples/softBody.js)\n * and the [cloth example](https://github.com/liabru/matter-js/blob/master/examples/cloth.js), follow those instead as this function is deprecated here.\n * @deprecated moved to softBody and cloth examples\n * @method softBody\n * @param {number} x Starting position in X.\n * @param {number} y Starting position in Y.\n * @param {number} columns\n * @param {number} rows\n * @param {number} columnGap\n * @param {number} rowGap\n * @param {boolean} crossBrace\n * @param {number} particleRadius\n * @param {} particleOptions\n * @param {} constraintOptions\n * @return {composite} A new composite softBody\n */\n Composites.softBody = function(x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions) {\n particleOptions = Common.extend({ inertia: Infinity }, particleOptions);\n constraintOptions = Common.extend({ stiffness: 0.2, render: { type: 'line', anchors: false } }, constraintOptions);\n\n var softBody = Composites.stack(x, y, columns, rows, columnGap, rowGap, function(stackX, stackY) {\n return Bodies.circle(stackX, stackY, particleRadius, particleOptions);\n });\n\n Composites.mesh(softBody, columns, rows, crossBrace, constraintOptions);\n\n softBody.label = 'Soft Body';\n\n return softBody;\n };\n\n deprecated(Composites, 'softBody', 'Composites.softBody ➤ moved to softBody and cloth examples');\n})();\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* This module has now been replaced by `Matter.Detector`.\n*\n* All usage should be migrated to `Matter.Detector` or another alternative.\n* For back-compatibility purposes this module will remain for a short term and then later removed in a future release.\n*\n* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures.\n*\n* @class Grid\n* @deprecated\n*/\n\nvar Grid = {};\n\nmodule.exports = Grid;\n\nvar Pair = __webpack_require__(9);\nvar Common = __webpack_require__(0);\nvar deprecated = Common.deprecated;\n\n(function() {\n\n /**\n * Creates a new grid.\n * @deprecated replaced by Matter.Detector\n * @method create\n * @param {} options\n * @return {grid} A new grid\n */\n Grid.create = function(options) {\n var defaults = {\n buckets: {},\n pairs: {},\n pairsList: [],\n bucketWidth: 48,\n bucketHeight: 48\n };\n\n return Common.extend(defaults, options);\n };\n\n /**\n * The width of a single grid bucket.\n *\n * @property bucketWidth\n * @type number\n * @default 48\n */\n\n /**\n * The height of a single grid bucket.\n *\n * @property bucketHeight\n * @type number\n * @default 48\n */\n\n /**\n * Updates the grid.\n * @deprecated replaced by Matter.Detector\n * @method update\n * @param {grid} grid\n * @param {body[]} bodies\n * @param {engine} engine\n * @param {boolean} forceUpdate\n */\n Grid.update = function(grid, bodies, engine, forceUpdate) {\n var i, col, row,\n world = engine.world,\n buckets = grid.buckets,\n bucket,\n bucketId,\n gridChanged = false;\n\n for (i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n\n if (body.isSleeping && !forceUpdate)\n continue;\n\n // temporary back compatibility bounds check\n if (world.bounds && (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x\n || body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y))\n continue;\n\n var newRegion = Grid._getRegion(grid, body);\n\n // if the body has changed grid region\n if (!body.region || newRegion.id !== body.region.id || forceUpdate) {\n\n if (!body.region || forceUpdate)\n body.region = newRegion;\n\n var union = Grid._regionUnion(newRegion, body.region);\n\n // update grid buckets affected by region change\n // iterate over the union of both regions\n for (col = union.startCol; col <= union.endCol; col++) {\n for (row = union.startRow; row <= union.endRow; row++) {\n bucketId = Grid._getBucketId(col, row);\n bucket = buckets[bucketId];\n\n var isInsideNewRegion = (col >= newRegion.startCol && col <= newRegion.endCol\n && row >= newRegion.startRow && row <= newRegion.endRow);\n\n var isInsideOldRegion = (col >= body.region.startCol && col <= body.region.endCol\n && row >= body.region.startRow && row <= body.region.endRow);\n\n // remove from old region buckets\n if (!isInsideNewRegion && isInsideOldRegion) {\n if (isInsideOldRegion) {\n if (bucket)\n Grid._bucketRemoveBody(grid, bucket, body);\n }\n }\n\n // add to new region buckets\n if (body.region === newRegion || (isInsideNewRegion && !isInsideOldRegion) || forceUpdate) {\n if (!bucket)\n bucket = Grid._createBucket(buckets, bucketId);\n Grid._bucketAddBody(grid, bucket, body);\n }\n }\n }\n\n // set the new region\n body.region = newRegion;\n\n // flag changes so we can update pairs\n gridChanged = true;\n }\n }\n\n // update pairs list only if pairs changed (i.e. a body changed region)\n if (gridChanged)\n grid.pairsList = Grid._createActivePairsList(grid);\n };\n\n deprecated(Grid, 'update', 'Grid.update ➤ replaced by Matter.Detector');\n\n /**\n * Clears the grid.\n * @deprecated replaced by Matter.Detector\n * @method clear\n * @param {grid} grid\n */\n Grid.clear = function(grid) {\n grid.buckets = {};\n grid.pairs = {};\n grid.pairsList = [];\n };\n\n deprecated(Grid, 'clear', 'Grid.clear ➤ replaced by Matter.Detector');\n\n /**\n * Finds the union of two regions.\n * @method _regionUnion\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} regionA\n * @param {} regionB\n * @return {} region\n */\n Grid._regionUnion = function(regionA, regionB) {\n var startCol = Math.min(regionA.startCol, regionB.startCol),\n endCol = Math.max(regionA.endCol, regionB.endCol),\n startRow = Math.min(regionA.startRow, regionB.startRow),\n endRow = Math.max(regionA.endRow, regionB.endRow);\n\n return Grid._createRegion(startCol, endCol, startRow, endRow);\n };\n\n /**\n * Gets the region a given body falls in for a given grid.\n * @method _getRegion\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} grid\n * @param {} body\n * @return {} region\n */\n Grid._getRegion = function(grid, body) {\n var bounds = body.bounds,\n startCol = Math.floor(bounds.min.x / grid.bucketWidth),\n endCol = Math.floor(bounds.max.x / grid.bucketWidth),\n startRow = Math.floor(bounds.min.y / grid.bucketHeight),\n endRow = Math.floor(bounds.max.y / grid.bucketHeight);\n\n return Grid._createRegion(startCol, endCol, startRow, endRow);\n };\n\n /**\n * Creates a region.\n * @method _createRegion\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} startCol\n * @param {} endCol\n * @param {} startRow\n * @param {} endRow\n * @return {} region\n */\n Grid._createRegion = function(startCol, endCol, startRow, endRow) {\n return { \n id: startCol + ',' + endCol + ',' + startRow + ',' + endRow,\n startCol: startCol, \n endCol: endCol, \n startRow: startRow, \n endRow: endRow \n };\n };\n\n /**\n * Gets the bucket id at the given position.\n * @method _getBucketId\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} column\n * @param {} row\n * @return {string} bucket id\n */\n Grid._getBucketId = function(column, row) {\n return 'C' + column + 'R' + row;\n };\n\n /**\n * Creates a bucket.\n * @method _createBucket\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} buckets\n * @param {} bucketId\n * @return {} bucket\n */\n Grid._createBucket = function(buckets, bucketId) {\n var bucket = buckets[bucketId] = [];\n return bucket;\n };\n\n /**\n * Adds a body to a bucket.\n * @method _bucketAddBody\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} grid\n * @param {} bucket\n * @param {} body\n */\n Grid._bucketAddBody = function(grid, bucket, body) {\n var gridPairs = grid.pairs,\n pairId = Pair.id,\n bucketLength = bucket.length,\n i;\n\n // add new pairs\n for (i = 0; i < bucketLength; i++) {\n var bodyB = bucket[i];\n\n if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic))\n continue;\n\n // keep track of the number of buckets the pair exists in\n // important for Grid.update to work\n var id = pairId(body, bodyB),\n pair = gridPairs[id];\n\n if (pair) {\n pair[2] += 1;\n } else {\n gridPairs[id] = [body, bodyB, 1];\n }\n }\n\n // add to bodies (after pairs, otherwise pairs with self)\n bucket.push(body);\n };\n\n /**\n * Removes a body from a bucket.\n * @method _bucketRemoveBody\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} grid\n * @param {} bucket\n * @param {} body\n */\n Grid._bucketRemoveBody = function(grid, bucket, body) {\n var gridPairs = grid.pairs,\n pairId = Pair.id,\n i;\n\n // remove from bucket\n bucket.splice(Common.indexOf(bucket, body), 1);\n\n var bucketLength = bucket.length;\n\n // update pair counts\n for (i = 0; i < bucketLength; i++) {\n // keep track of the number of buckets the pair exists in\n // important for _createActivePairsList to work\n var pair = gridPairs[pairId(body, bucket[i])];\n\n if (pair)\n pair[2] -= 1;\n }\n };\n\n /**\n * Generates a list of the active pairs in the grid.\n * @method _createActivePairsList\n * @deprecated replaced by Matter.Detector\n * @private\n * @param {} grid\n * @return [] pairs\n */\n Grid._createActivePairsList = function(grid) {\n var pair,\n gridPairs = grid.pairs,\n pairKeys = Common.keys(gridPairs),\n pairKeysLength = pairKeys.length,\n pairs = [],\n k;\n\n // iterate over grid.pairs\n for (k = 0; k < pairKeysLength; k++) {\n pair = gridPairs[pairKeys[k]];\n\n // if pair exists in at least one bucket\n // it is a pair that needs further collision testing so push it\n if (pair[2] > 0) {\n pairs.push(pair);\n } else {\n delete gridPairs[pairKeys[k]];\n }\n }\n\n return pairs;\n };\n \n})();\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.MouseConstraint` module contains methods for creating mouse constraints.\n* Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class MouseConstraint\n*/\n\nvar MouseConstraint = {};\n\nmodule.exports = MouseConstraint;\n\nvar Vertices = __webpack_require__(3);\nvar Sleeping = __webpack_require__(7);\nvar Mouse = __webpack_require__(14);\nvar Events = __webpack_require__(5);\nvar Detector = __webpack_require__(13);\nvar Constraint = __webpack_require__(10);\nvar Composite = __webpack_require__(6);\nvar Common = __webpack_require__(0);\nvar Bounds = __webpack_require__(1);\n\n(function() {\n\n /**\n * Creates a new mouse constraint.\n * All properties have default values, and many are pre-calculated automatically based on other properties.\n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {engine} engine\n * @param {} options\n * @return {MouseConstraint} A new MouseConstraint\n */\n MouseConstraint.create = function(engine, options) {\n var mouse = (engine ? engine.mouse : null) || (options ? options.mouse : null);\n\n if (!mouse) {\n if (engine && engine.render && engine.render.canvas) {\n mouse = Mouse.create(engine.render.canvas);\n } else if (options && options.element) {\n mouse = Mouse.create(options.element);\n } else {\n mouse = Mouse.create();\n Common.warn('MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected');\n }\n }\n\n var constraint = Constraint.create({ \n label: 'Mouse Constraint',\n pointA: mouse.position,\n pointB: { x: 0, y: 0 },\n length: 0.01, \n stiffness: 0.1,\n angularStiffness: 1,\n render: {\n strokeStyle: '#90EE90',\n lineWidth: 3\n }\n });\n\n var defaults = {\n type: 'mouseConstraint',\n mouse: mouse,\n element: null,\n body: null,\n constraint: constraint,\n collisionFilter: {\n category: 0x0001,\n mask: 0xFFFFFFFF,\n group: 0\n }\n };\n\n var mouseConstraint = Common.extend(defaults, options);\n\n Events.on(engine, 'beforeUpdate', function() {\n var allBodies = Composite.allBodies(engine.world);\n MouseConstraint.update(mouseConstraint, allBodies);\n MouseConstraint._triggerEvents(mouseConstraint);\n });\n\n return mouseConstraint;\n };\n\n /**\n * Updates the given mouse constraint.\n * @private\n * @method update\n * @param {MouseConstraint} mouseConstraint\n * @param {body[]} bodies\n */\n MouseConstraint.update = function(mouseConstraint, bodies) {\n var mouse = mouseConstraint.mouse,\n constraint = mouseConstraint.constraint,\n body = mouseConstraint.body;\n\n if (mouse.button === 0) {\n if (!constraint.bodyB) {\n for (var i = 0; i < bodies.length; i++) {\n body = bodies[i];\n if (Bounds.contains(body.bounds, mouse.position) \n && Detector.canCollide(body.collisionFilter, mouseConstraint.collisionFilter)) {\n for (var j = body.parts.length > 1 ? 1 : 0; j < body.parts.length; j++) {\n var part = body.parts[j];\n if (Vertices.contains(part.vertices, mouse.position)) {\n constraint.pointA = mouse.position;\n constraint.bodyB = mouseConstraint.body = body;\n constraint.pointB = { x: mouse.position.x - body.position.x, y: mouse.position.y - body.position.y };\n constraint.angleB = body.angle;\n\n Sleeping.set(body, false);\n Events.trigger(mouseConstraint, 'startdrag', { mouse: mouse, body: body });\n\n break;\n }\n }\n }\n }\n } else {\n Sleeping.set(constraint.bodyB, false);\n constraint.pointA = mouse.position;\n }\n } else {\n constraint.bodyB = mouseConstraint.body = null;\n constraint.pointB = null;\n\n if (body)\n Events.trigger(mouseConstraint, 'enddrag', { mouse: mouse, body: body });\n }\n };\n\n /**\n * Triggers mouse constraint events.\n * @method _triggerEvents\n * @private\n * @param {mouse} mouseConstraint\n */\n MouseConstraint._triggerEvents = function(mouseConstraint) {\n var mouse = mouseConstraint.mouse,\n mouseEvents = mouse.sourceEvents;\n\n if (mouseEvents.mousemove)\n Events.trigger(mouseConstraint, 'mousemove', { mouse: mouse });\n\n if (mouseEvents.mousedown)\n Events.trigger(mouseConstraint, 'mousedown', { mouse: mouse });\n\n if (mouseEvents.mouseup)\n Events.trigger(mouseConstraint, 'mouseup', { mouse: mouse });\n\n // reset the mouse state ready for the next step\n Mouse.clearSourceEvents(mouse);\n };\n\n /*\n *\n * Events Documentation\n *\n */\n\n /**\n * Fired when the mouse has moved (or a touch moves) during the last step\n *\n * @event mousemove\n * @param {} event An event object\n * @param {mouse} event.mouse The engine's mouse instance\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when the mouse is down (or a touch has started) during the last step\n *\n * @event mousedown\n * @param {} event An event object\n * @param {mouse} event.mouse The engine's mouse instance\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when the mouse is up (or a touch has ended) during the last step\n *\n * @event mouseup\n * @param {} event An event object\n * @param {mouse} event.mouse The engine's mouse instance\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when the user starts dragging a body\n *\n * @event startdrag\n * @param {} event An event object\n * @param {mouse} event.mouse The engine's mouse instance\n * @param {body} event.body The body being dragged\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired when the user ends dragging a body\n *\n * @event enddrag\n * @param {} event An event object\n * @param {mouse} event.mouse The engine's mouse instance\n * @param {body} event.body The body that has stopped being dragged\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * A `String` denoting the type of object.\n *\n * @property type\n * @type string\n * @default \"constraint\"\n * @readOnly\n */\n\n /**\n * The `Mouse` instance in use. If not supplied in `MouseConstraint.create`, one will be created.\n *\n * @property mouse\n * @type mouse\n * @default mouse\n */\n\n /**\n * The `Body` that is currently being moved by the user, or `null` if no body.\n *\n * @property body\n * @type body\n * @default null\n */\n\n /**\n * The `Constraint` object that is used to move the body during interaction.\n *\n * @property constraint\n * @type constraint\n */\n\n /**\n * An `Object` that specifies the collision filter properties.\n * The collision filter allows the user to define which types of body this mouse constraint can interact with.\n * See `body.collisionFilter` for more information.\n *\n * @property collisionFilter\n * @type object\n */\n\n})();\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Query` module contains methods for performing collision queries.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Query\n*/\n\nvar Query = {};\n\nmodule.exports = Query;\n\nvar Vector = __webpack_require__(2);\nvar Collision = __webpack_require__(8);\nvar Bounds = __webpack_require__(1);\nvar Bodies = __webpack_require__(12);\nvar Vertices = __webpack_require__(3);\n\n(function() {\n\n /**\n * Returns a list of collisions between `body` and `bodies`.\n * @method collides\n * @param {body} body\n * @param {body[]} bodies\n * @return {collision[]} Collisions\n */\n Query.collides = function(body, bodies) {\n var collisions = [],\n bodiesLength = bodies.length,\n bounds = body.bounds,\n collides = Collision.collides,\n overlaps = Bounds.overlaps;\n\n for (var i = 0; i < bodiesLength; i++) {\n var bodyA = bodies[i],\n partsALength = bodyA.parts.length,\n partsAStart = partsALength === 1 ? 0 : 1;\n \n if (overlaps(bodyA.bounds, bounds)) {\n for (var j = partsAStart; j < partsALength; j++) {\n var part = bodyA.parts[j];\n\n if (overlaps(part.bounds, bounds)) {\n var collision = collides(part, body);\n\n if (collision) {\n collisions.push(collision);\n break;\n }\n }\n }\n }\n }\n\n return collisions;\n };\n\n /**\n * Casts a ray segment against a set of bodies and returns all collisions, ray width is optional. Intersection points are not provided.\n * @method ray\n * @param {body[]} bodies\n * @param {vector} startPoint\n * @param {vector} endPoint\n * @param {number} [rayWidth]\n * @return {collision[]} Collisions\n */\n Query.ray = function(bodies, startPoint, endPoint, rayWidth) {\n rayWidth = rayWidth || 1e-100;\n\n var rayAngle = Vector.angle(startPoint, endPoint),\n rayLength = Vector.magnitude(Vector.sub(startPoint, endPoint)),\n rayX = (endPoint.x + startPoint.x) * 0.5,\n rayY = (endPoint.y + startPoint.y) * 0.5,\n ray = Bodies.rectangle(rayX, rayY, rayLength, rayWidth, { angle: rayAngle }),\n collisions = Query.collides(ray, bodies);\n\n for (var i = 0; i < collisions.length; i += 1) {\n var collision = collisions[i];\n collision.body = collision.bodyB = collision.bodyA; \n }\n\n return collisions;\n };\n\n /**\n * Returns all bodies whose bounds are inside (or outside if set) the given set of bounds, from the given set of bodies.\n * @method region\n * @param {body[]} bodies\n * @param {bounds} bounds\n * @param {bool} [outside=false]\n * @return {body[]} The bodies matching the query\n */\n Query.region = function(bodies, bounds, outside) {\n var result = [];\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n overlaps = Bounds.overlaps(body.bounds, bounds);\n if ((overlaps && !outside) || (!overlaps && outside))\n result.push(body);\n }\n\n return result;\n };\n\n /**\n * Returns all bodies whose vertices contain the given point, from the given set of bodies.\n * @method point\n * @param {body[]} bodies\n * @param {vector} point\n * @return {body[]} The bodies matching the query\n */\n Query.point = function(bodies, point) {\n var result = [];\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n \n if (Bounds.contains(body.bounds, point)) {\n for (var j = body.parts.length === 1 ? 0 : 1; j < body.parts.length; j++) {\n var part = body.parts[j];\n\n if (Bounds.contains(part.bounds, point)\n && Vertices.contains(part.vertices, point)) {\n result.push(body);\n break;\n }\n }\n }\n }\n\n return result;\n };\n\n})();\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Render` module is a lightweight, optional utility which provides a simple canvas based renderer for visualising instances of `Matter.Engine`.\n* It is intended for development and debugging purposes, but may also be suitable for simple games.\n* It includes a number of drawing options including wireframe, vector with support for sprites and viewports.\n*\n* @class Render\n*/\n\nvar Render = {};\n\nmodule.exports = Render;\n\nvar Body = __webpack_require__(4);\nvar Common = __webpack_require__(0);\nvar Composite = __webpack_require__(6);\nvar Bounds = __webpack_require__(1);\nvar Events = __webpack_require__(5);\nvar Vector = __webpack_require__(2);\nvar Mouse = __webpack_require__(14);\n\n(function() {\n\n var _requestAnimationFrame,\n _cancelAnimationFrame;\n\n if (typeof window !== 'undefined') {\n _requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame\n || window.mozRequestAnimationFrame || window.msRequestAnimationFrame\n || function(callback){ window.setTimeout(function() { callback(Common.now()); }, 1000 / 60); };\n\n _cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame\n || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame;\n }\n\n Render._goodFps = 30;\n Render._goodDelta = 1000 / 60;\n\n /**\n * Creates a new renderer. The options parameter is an object that specifies any properties you wish to override the defaults.\n * All properties have default values, and many are pre-calculated automatically based on other properties.\n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {object} [options]\n * @return {render} A new renderer\n */\n Render.create = function(options) {\n var defaults = {\n engine: null,\n element: null,\n canvas: null,\n mouse: null,\n frameRequestId: null,\n timing: {\n historySize: 60,\n delta: 0,\n deltaHistory: [],\n lastTime: 0,\n lastTimestamp: 0,\n lastElapsed: 0,\n timestampElapsed: 0,\n timestampElapsedHistory: [],\n engineDeltaHistory: [],\n engineElapsedHistory: [],\n engineUpdatesHistory: [],\n elapsedHistory: []\n },\n options: {\n width: 800,\n height: 600,\n pixelRatio: 1,\n background: '#14151f',\n wireframeBackground: '#14151f',\n wireframeStrokeStyle: '#bbb',\n hasBounds: !!options.bounds,\n enabled: true,\n wireframes: true,\n showSleeping: true,\n showDebug: false,\n showStats: false,\n showPerformance: false,\n showBounds: false,\n showVelocity: false,\n showCollisions: false,\n showSeparations: false,\n showAxes: false,\n showPositions: false,\n showAngleIndicator: false,\n showIds: false,\n showVertexNumbers: false,\n showConvexHulls: false,\n showInternalEdges: false,\n showMousePosition: false\n }\n };\n\n var render = Common.extend(defaults, options);\n\n if (render.canvas) {\n render.canvas.width = render.options.width || render.canvas.width;\n render.canvas.height = render.options.height || render.canvas.height;\n }\n\n render.mouse = options.mouse;\n render.engine = options.engine;\n render.canvas = render.canvas || _createCanvas(render.options.width, render.options.height);\n render.context = render.canvas.getContext('2d');\n render.textures = {};\n\n render.bounds = render.bounds || {\n min: {\n x: 0,\n y: 0\n },\n max: {\n x: render.canvas.width,\n y: render.canvas.height\n }\n };\n\n // for temporary back compatibility only\n render.controller = Render;\n render.options.showBroadphase = false;\n\n if (render.options.pixelRatio !== 1) {\n Render.setPixelRatio(render, render.options.pixelRatio);\n }\n\n if (Common.isElement(render.element)) {\n render.element.appendChild(render.canvas);\n }\n\n return render;\n };\n\n /**\n * Continuously updates the render canvas on the `requestAnimationFrame` event.\n * @method run\n * @param {render} render\n */\n Render.run = function(render) {\n (function loop(time){\n render.frameRequestId = _requestAnimationFrame(loop);\n \n _updateTiming(render, time);\n\n Render.world(render, time);\n\n render.context.setTransform(render.options.pixelRatio, 0, 0, render.options.pixelRatio, 0, 0);\n\n if (render.options.showStats || render.options.showDebug) {\n Render.stats(render, render.context, time);\n }\n\n if (render.options.showPerformance || render.options.showDebug) {\n Render.performance(render, render.context, time);\n }\n\n render.context.setTransform(1, 0, 0, 1, 0, 0);\n })();\n };\n\n /**\n * Ends execution of `Render.run` on the given `render`, by canceling the animation frame request event loop.\n * @method stop\n * @param {render} render\n */\n Render.stop = function(render) {\n _cancelAnimationFrame(render.frameRequestId);\n };\n\n /**\n * Sets the pixel ratio of the renderer and updates the canvas.\n * To automatically detect the correct ratio, pass the string `'auto'` for `pixelRatio`.\n * @method setPixelRatio\n * @param {render} render\n * @param {number} pixelRatio\n */\n Render.setPixelRatio = function(render, pixelRatio) {\n var options = render.options,\n canvas = render.canvas;\n\n if (pixelRatio === 'auto') {\n pixelRatio = _getPixelRatio(canvas);\n }\n\n options.pixelRatio = pixelRatio;\n canvas.setAttribute('data-pixel-ratio', pixelRatio);\n canvas.width = options.width * pixelRatio;\n canvas.height = options.height * pixelRatio;\n canvas.style.width = options.width + 'px';\n canvas.style.height = options.height + 'px';\n };\n\n /**\n * Sets the render `width` and `height`.\n * \n * Updates the canvas accounting for `render.options.pixelRatio`. \n * \n * Updates the bottom right render bound `render.bounds.max` relative to the provided `width` and `height`.\n * The top left render bound `render.bounds.min` isn't changed.\n * \n * Follow this call with `Render.lookAt` if you need to change the render bounds.\n * \n * See also `Render.setPixelRatio`.\n * @method setSize\n * @param {render} render\n * @param {number} width The width (in CSS pixels)\n * @param {number} height The height (in CSS pixels)\n */\n Render.setSize = function(render, width, height) {\n render.options.width = width;\n render.options.height = height;\n render.bounds.max.x = render.bounds.min.x + width;\n render.bounds.max.y = render.bounds.min.y + height;\n\n if (render.options.pixelRatio !== 1) {\n Render.setPixelRatio(render, render.options.pixelRatio);\n } else {\n render.canvas.width = width;\n render.canvas.height = height;\n }\n };\n\n /**\n * Positions and sizes the viewport around the given object bounds.\n * Objects must have at least one of the following properties:\n * - `object.bounds`\n * - `object.position`\n * - `object.min` and `object.max`\n * - `object.x` and `object.y`\n * @method lookAt\n * @param {render} render\n * @param {object[]} objects\n * @param {vector} [padding]\n * @param {bool} [center=true]\n */\n Render.lookAt = function(render, objects, padding, center) {\n center = typeof center !== 'undefined' ? center : true;\n objects = Common.isArray(objects) ? objects : [objects];\n padding = padding || {\n x: 0,\n y: 0\n };\n\n // find bounds of all objects\n var bounds = {\n min: { x: Infinity, y: Infinity },\n max: { x: -Infinity, y: -Infinity }\n };\n\n for (var i = 0; i < objects.length; i += 1) {\n var object = objects[i],\n min = object.bounds ? object.bounds.min : (object.min || object.position || object),\n max = object.bounds ? object.bounds.max : (object.max || object.position || object);\n\n if (min && max) {\n if (min.x < bounds.min.x)\n bounds.min.x = min.x;\n\n if (max.x > bounds.max.x)\n bounds.max.x = max.x;\n\n if (min.y < bounds.min.y)\n bounds.min.y = min.y;\n\n if (max.y > bounds.max.y)\n bounds.max.y = max.y;\n }\n }\n\n // find ratios\n var width = (bounds.max.x - bounds.min.x) + 2 * padding.x,\n height = (bounds.max.y - bounds.min.y) + 2 * padding.y,\n viewHeight = render.canvas.height,\n viewWidth = render.canvas.width,\n outerRatio = viewWidth / viewHeight,\n innerRatio = width / height,\n scaleX = 1,\n scaleY = 1;\n\n // find scale factor\n if (innerRatio > outerRatio) {\n scaleY = innerRatio / outerRatio;\n } else {\n scaleX = outerRatio / innerRatio;\n }\n\n // enable bounds\n render.options.hasBounds = true;\n\n // position and size\n render.bounds.min.x = bounds.min.x;\n render.bounds.max.x = bounds.min.x + width * scaleX;\n render.bounds.min.y = bounds.min.y;\n render.bounds.max.y = bounds.min.y + height * scaleY;\n\n // center\n if (center) {\n render.bounds.min.x += width * 0.5 - (width * scaleX) * 0.5;\n render.bounds.max.x += width * 0.5 - (width * scaleX) * 0.5;\n render.bounds.min.y += height * 0.5 - (height * scaleY) * 0.5;\n render.bounds.max.y += height * 0.5 - (height * scaleY) * 0.5;\n }\n\n // padding\n render.bounds.min.x -= padding.x;\n render.bounds.max.x -= padding.x;\n render.bounds.min.y -= padding.y;\n render.bounds.max.y -= padding.y;\n\n // update mouse\n if (render.mouse) {\n Mouse.setScale(render.mouse, {\n x: (render.bounds.max.x - render.bounds.min.x) / render.canvas.width,\n y: (render.bounds.max.y - render.bounds.min.y) / render.canvas.height\n });\n\n Mouse.setOffset(render.mouse, render.bounds.min);\n }\n };\n\n /**\n * Applies viewport transforms based on `render.bounds` to a render context.\n * @method startViewTransform\n * @param {render} render\n */\n Render.startViewTransform = function(render) {\n var boundsWidth = render.bounds.max.x - render.bounds.min.x,\n boundsHeight = render.bounds.max.y - render.bounds.min.y,\n boundsScaleX = boundsWidth / render.options.width,\n boundsScaleY = boundsHeight / render.options.height;\n\n render.context.setTransform(\n render.options.pixelRatio / boundsScaleX, 0, 0, \n render.options.pixelRatio / boundsScaleY, 0, 0\n );\n \n render.context.translate(-render.bounds.min.x, -render.bounds.min.y);\n };\n\n /**\n * Resets all transforms on the render context.\n * @method endViewTransform\n * @param {render} render\n */\n Render.endViewTransform = function(render) {\n render.context.setTransform(render.options.pixelRatio, 0, 0, render.options.pixelRatio, 0, 0);\n };\n\n /**\n * Renders the given `engine`'s `Matter.World` object.\n * This is the entry point for all rendering and should be called every time the scene changes.\n * @method world\n * @param {render} render\n */\n Render.world = function(render, time) {\n var startTime = Common.now(),\n engine = render.engine,\n world = engine.world,\n canvas = render.canvas,\n context = render.context,\n options = render.options,\n timing = render.timing;\n\n var allBodies = Composite.allBodies(world),\n allConstraints = Composite.allConstraints(world),\n background = options.wireframes ? options.wireframeBackground : options.background,\n bodies = [],\n constraints = [],\n i;\n\n var event = {\n timestamp: engine.timing.timestamp\n };\n\n Events.trigger(render, 'beforeRender', event);\n\n // apply background if it has changed\n if (render.currentBackground !== background)\n _applyBackground(render, background);\n\n // clear the canvas with a transparent fill, to allow the canvas background to show\n context.globalCompositeOperation = 'source-in';\n context.fillStyle = \"transparent\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.globalCompositeOperation = 'source-over';\n\n // handle bounds\n if (options.hasBounds) {\n // filter out bodies that are not in view\n for (i = 0; i < allBodies.length; i++) {\n var body = allBodies[i];\n if (Bounds.overlaps(body.bounds, render.bounds))\n bodies.push(body);\n }\n\n // filter out constraints that are not in view\n for (i = 0; i < allConstraints.length; i++) {\n var constraint = allConstraints[i],\n bodyA = constraint.bodyA,\n bodyB = constraint.bodyB,\n pointAWorld = constraint.pointA,\n pointBWorld = constraint.pointB;\n\n if (bodyA) pointAWorld = Vector.add(bodyA.position, constraint.pointA);\n if (bodyB) pointBWorld = Vector.add(bodyB.position, constraint.pointB);\n\n if (!pointAWorld || !pointBWorld)\n continue;\n\n if (Bounds.contains(render.bounds, pointAWorld) || Bounds.contains(render.bounds, pointBWorld))\n constraints.push(constraint);\n }\n\n // transform the view\n Render.startViewTransform(render);\n\n // update mouse\n if (render.mouse) {\n Mouse.setScale(render.mouse, {\n x: (render.bounds.max.x - render.bounds.min.x) / render.options.width,\n y: (render.bounds.max.y - render.bounds.min.y) / render.options.height\n });\n\n Mouse.setOffset(render.mouse, render.bounds.min);\n }\n } else {\n constraints = allConstraints;\n bodies = allBodies;\n\n if (render.options.pixelRatio !== 1) {\n render.context.setTransform(render.options.pixelRatio, 0, 0, render.options.pixelRatio, 0, 0);\n }\n }\n\n if (!options.wireframes || (engine.enableSleeping && options.showSleeping)) {\n // fully featured rendering of bodies\n Render.bodies(render, bodies, context);\n } else {\n if (options.showConvexHulls)\n Render.bodyConvexHulls(render, bodies, context);\n\n // optimised method for wireframes only\n Render.bodyWireframes(render, bodies, context);\n }\n\n if (options.showBounds)\n Render.bodyBounds(render, bodies, context);\n\n if (options.showAxes || options.showAngleIndicator)\n Render.bodyAxes(render, bodies, context);\n\n if (options.showPositions)\n Render.bodyPositions(render, bodies, context);\n\n if (options.showVelocity)\n Render.bodyVelocity(render, bodies, context);\n\n if (options.showIds)\n Render.bodyIds(render, bodies, context);\n\n if (options.showSeparations)\n Render.separations(render, engine.pairs.list, context);\n\n if (options.showCollisions)\n Render.collisions(render, engine.pairs.list, context);\n\n if (options.showVertexNumbers)\n Render.vertexNumbers(render, bodies, context);\n\n if (options.showMousePosition)\n Render.mousePosition(render, render.mouse, context);\n\n Render.constraints(constraints, context);\n\n if (options.hasBounds) {\n // revert view transforms\n Render.endViewTransform(render);\n }\n\n Events.trigger(render, 'afterRender', event);\n\n // log the time elapsed computing this update\n timing.lastElapsed = Common.now() - startTime;\n };\n\n /**\n * Renders statistics about the engine and world useful for debugging.\n * @private\n * @method stats\n * @param {render} render\n * @param {RenderingContext} context\n * @param {Number} time\n */\n Render.stats = function(render, context, time) {\n var engine = render.engine,\n world = engine.world,\n bodies = Composite.allBodies(world),\n parts = 0,\n width = 55,\n height = 44,\n x = 0,\n y = 0;\n \n // count parts\n for (var i = 0; i < bodies.length; i += 1) {\n parts += bodies[i].parts.length;\n }\n\n // sections\n var sections = {\n 'Part': parts,\n 'Body': bodies.length,\n 'Cons': Composite.allConstraints(world).length,\n 'Comp': Composite.allComposites(world).length,\n 'Pair': engine.pairs.list.length\n };\n\n // background\n context.fillStyle = '#0e0f19';\n context.fillRect(x, y, width * 5.5, height);\n\n context.font = '12px Arial';\n context.textBaseline = 'top';\n context.textAlign = 'right';\n\n // sections\n for (var key in sections) {\n var section = sections[key];\n // label\n context.fillStyle = '#aaa';\n context.fillText(key, x + width, y + 8);\n\n // value\n context.fillStyle = '#eee';\n context.fillText(section, x + width, y + 26);\n\n x += width;\n }\n };\n\n /**\n * Renders engine and render performance information.\n * @private\n * @method performance\n * @param {render} render\n * @param {RenderingContext} context\n */\n Render.performance = function(render, context) {\n var engine = render.engine,\n timing = render.timing,\n deltaHistory = timing.deltaHistory,\n elapsedHistory = timing.elapsedHistory,\n timestampElapsedHistory = timing.timestampElapsedHistory,\n engineDeltaHistory = timing.engineDeltaHistory,\n engineUpdatesHistory = timing.engineUpdatesHistory,\n engineElapsedHistory = timing.engineElapsedHistory,\n lastEngineUpdatesPerFrame = engine.timing.lastUpdatesPerFrame,\n lastEngineDelta = engine.timing.lastDelta;\n \n var deltaMean = _mean(deltaHistory),\n elapsedMean = _mean(elapsedHistory),\n engineDeltaMean = _mean(engineDeltaHistory),\n engineUpdatesMean = _mean(engineUpdatesHistory),\n engineElapsedMean = _mean(engineElapsedHistory),\n timestampElapsedMean = _mean(timestampElapsedHistory),\n rateMean = (timestampElapsedMean / deltaMean) || 0,\n neededUpdatesPerFrame = Math.round(deltaMean / lastEngineDelta),\n fps = (1000 / deltaMean) || 0;\n\n var graphHeight = 4,\n gap = 12,\n width = 60,\n height = 34,\n x = 10,\n y = 69;\n\n // background\n context.fillStyle = '#0e0f19';\n context.fillRect(0, 50, gap * 5 + width * 6 + 22, height);\n\n // show FPS\n Render.status(\n context, x, y, width, graphHeight, deltaHistory.length, \n Math.round(fps) + ' fps', \n fps / Render._goodFps,\n function(i) { return (deltaHistory[i] / deltaMean) - 1; }\n );\n\n // show engine delta\n Render.status(\n context, x + gap + width, y, width, graphHeight, engineDeltaHistory.length,\n lastEngineDelta.toFixed(2) + ' dt', \n Render._goodDelta / lastEngineDelta,\n function(i) { return (engineDeltaHistory[i] / engineDeltaMean) - 1; }\n );\n\n // show engine updates per frame\n Render.status(\n context, x + (gap + width) * 2, y, width, graphHeight, engineUpdatesHistory.length,\n lastEngineUpdatesPerFrame + ' upf', \n Math.pow(Common.clamp((engineUpdatesMean / neededUpdatesPerFrame) || 1, 0, 1), 4),\n function(i) { return (engineUpdatesHistory[i] / engineUpdatesMean) - 1; }\n );\n\n // show engine update time\n Render.status(\n context, x + (gap + width) * 3, y, width, graphHeight, engineElapsedHistory.length,\n engineElapsedMean.toFixed(2) + ' ut', \n 1 - (lastEngineUpdatesPerFrame * engineElapsedMean / Render._goodFps),\n function(i) { return (engineElapsedHistory[i] / engineElapsedMean) - 1; }\n );\n\n // show render time\n Render.status(\n context, x + (gap + width) * 4, y, width, graphHeight, elapsedHistory.length,\n elapsedMean.toFixed(2) + ' rt', \n 1 - (elapsedMean / Render._goodFps),\n function(i) { return (elapsedHistory[i] / elapsedMean) - 1; }\n );\n\n // show effective speed\n Render.status(\n context, x + (gap + width) * 5, y, width, graphHeight, timestampElapsedHistory.length, \n rateMean.toFixed(2) + ' x', \n rateMean * rateMean * rateMean,\n function(i) { return (((timestampElapsedHistory[i] / deltaHistory[i]) / rateMean) || 0) - 1; }\n );\n };\n\n /**\n * Renders a label, indicator and a chart.\n * @private\n * @method status\n * @param {RenderingContext} context\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {number} count\n * @param {string} label\n * @param {string} indicator\n * @param {function} plotY\n */\n Render.status = function(context, x, y, width, height, count, label, indicator, plotY) {\n // background\n context.strokeStyle = '#888';\n context.fillStyle = '#444';\n context.lineWidth = 1;\n context.fillRect(x, y + 7, width, 1);\n\n // chart\n context.beginPath();\n context.moveTo(x, y + 7 - height * Common.clamp(0.4 * plotY(0), -2, 2));\n for (var i = 0; i < width; i += 1) {\n context.lineTo(x + i, y + 7 - (i < count ? height * Common.clamp(0.4 * plotY(i), -2, 2) : 0));\n }\n context.stroke();\n\n // indicator\n context.fillStyle = 'hsl(' + Common.clamp(25 + 95 * indicator, 0, 120) + ',100%,60%)';\n context.fillRect(x, y - 7, 4, 4);\n\n // label\n context.font = '12px Arial';\n context.textBaseline = 'middle';\n context.textAlign = 'right';\n context.fillStyle = '#eee';\n context.fillText(label, x + width, y - 5);\n };\n\n /**\n * Description\n * @private\n * @method constraints\n * @param {constraint[]} constraints\n * @param {RenderingContext} context\n */\n Render.constraints = function(constraints, context) {\n var c = context;\n\n for (var i = 0; i < constraints.length; i++) {\n var constraint = constraints[i];\n\n if (!constraint.render.visible || !constraint.pointA || !constraint.pointB)\n continue;\n\n var bodyA = constraint.bodyA,\n bodyB = constraint.bodyB,\n start,\n end;\n\n if (bodyA) {\n start = Vector.add(bodyA.position, constraint.pointA);\n } else {\n start = constraint.pointA;\n }\n\n if (constraint.render.type === 'pin') {\n c.beginPath();\n c.arc(start.x, start.y, 3, 0, 2 * Math.PI);\n c.closePath();\n } else {\n if (bodyB) {\n end = Vector.add(bodyB.position, constraint.pointB);\n } else {\n end = constraint.pointB;\n }\n\n c.beginPath();\n c.moveTo(start.x, start.y);\n\n if (constraint.render.type === 'spring') {\n var delta = Vector.sub(end, start),\n normal = Vector.perp(Vector.normalise(delta)),\n coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)),\n offset;\n\n for (var j = 1; j < coils; j += 1) {\n offset = j % 2 === 0 ? 1 : -1;\n\n c.lineTo(\n start.x + delta.x * (j / coils) + normal.x * offset * 4,\n start.y + delta.y * (j / coils) + normal.y * offset * 4\n );\n }\n }\n\n c.lineTo(end.x, end.y);\n }\n\n if (constraint.render.lineWidth) {\n c.lineWidth = constraint.render.lineWidth;\n c.strokeStyle = constraint.render.strokeStyle;\n c.stroke();\n }\n\n if (constraint.render.anchors) {\n c.fillStyle = constraint.render.strokeStyle;\n c.beginPath();\n c.arc(start.x, start.y, 3, 0, 2 * Math.PI);\n c.arc(end.x, end.y, 3, 0, 2 * Math.PI);\n c.closePath();\n c.fill();\n }\n }\n };\n\n /**\n * Description\n * @private\n * @method bodies\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodies = function(render, bodies, context) {\n var c = context,\n engine = render.engine,\n options = render.options,\n showInternalEdges = options.showInternalEdges || !options.wireframes,\n body,\n part,\n i,\n k;\n\n for (i = 0; i < bodies.length; i++) {\n body = bodies[i];\n\n if (!body.render.visible)\n continue;\n\n // handle compound parts\n for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) {\n part = body.parts[k];\n\n if (!part.render.visible)\n continue;\n\n if (options.showSleeping && body.isSleeping) {\n c.globalAlpha = 0.5 * part.render.opacity;\n } else if (part.render.opacity !== 1) {\n c.globalAlpha = part.render.opacity;\n }\n\n if (part.render.sprite && part.render.sprite.texture && !options.wireframes) {\n // part sprite\n var sprite = part.render.sprite,\n texture = _getTexture(render, sprite.texture);\n\n c.translate(part.position.x, part.position.y);\n c.rotate(part.angle);\n\n c.drawImage(\n texture,\n texture.width * -sprite.xOffset * sprite.xScale,\n texture.height * -sprite.yOffset * sprite.yScale,\n texture.width * sprite.xScale,\n texture.height * sprite.yScale\n );\n\n // revert translation, hopefully faster than save / restore\n c.rotate(-part.angle);\n c.translate(-part.position.x, -part.position.y);\n } else {\n // part polygon\n if (part.circleRadius) {\n c.beginPath();\n c.arc(part.position.x, part.position.y, part.circleRadius, 0, 2 * Math.PI);\n } else {\n c.beginPath();\n c.moveTo(part.vertices[0].x, part.vertices[0].y);\n\n for (var j = 1; j < part.vertices.length; j++) {\n if (!part.vertices[j - 1].isInternal || showInternalEdges) {\n c.lineTo(part.vertices[j].x, part.vertices[j].y);\n } else {\n c.moveTo(part.vertices[j].x, part.vertices[j].y);\n }\n\n if (part.vertices[j].isInternal && !showInternalEdges) {\n c.moveTo(part.vertices[(j + 1) % part.vertices.length].x, part.vertices[(j + 1) % part.vertices.length].y);\n }\n }\n\n c.lineTo(part.vertices[0].x, part.vertices[0].y);\n c.closePath();\n }\n\n if (!options.wireframes) {\n c.fillStyle = part.render.fillStyle;\n\n if (part.render.lineWidth) {\n c.lineWidth = part.render.lineWidth;\n c.strokeStyle = part.render.strokeStyle;\n c.stroke();\n }\n\n c.fill();\n } else {\n c.lineWidth = 1;\n c.strokeStyle = render.options.wireframeStrokeStyle;\n c.stroke();\n }\n }\n\n c.globalAlpha = 1;\n }\n }\n };\n\n /**\n * Optimised method for drawing body wireframes in one pass\n * @private\n * @method bodyWireframes\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyWireframes = function(render, bodies, context) {\n var c = context,\n showInternalEdges = render.options.showInternalEdges,\n body,\n part,\n i,\n j,\n k;\n\n c.beginPath();\n\n // render all bodies\n for (i = 0; i < bodies.length; i++) {\n body = bodies[i];\n\n if (!body.render.visible)\n continue;\n\n // handle compound parts\n for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) {\n part = body.parts[k];\n\n c.moveTo(part.vertices[0].x, part.vertices[0].y);\n\n for (j = 1; j < part.vertices.length; j++) {\n if (!part.vertices[j - 1].isInternal || showInternalEdges) {\n c.lineTo(part.vertices[j].x, part.vertices[j].y);\n } else {\n c.moveTo(part.vertices[j].x, part.vertices[j].y);\n }\n\n if (part.vertices[j].isInternal && !showInternalEdges) {\n c.moveTo(part.vertices[(j + 1) % part.vertices.length].x, part.vertices[(j + 1) % part.vertices.length].y);\n }\n }\n\n c.lineTo(part.vertices[0].x, part.vertices[0].y);\n }\n }\n\n c.lineWidth = 1;\n c.strokeStyle = render.options.wireframeStrokeStyle;\n c.stroke();\n };\n\n /**\n * Optimised method for drawing body convex hull wireframes in one pass\n * @private\n * @method bodyConvexHulls\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyConvexHulls = function(render, bodies, context) {\n var c = context,\n body,\n part,\n i,\n j,\n k;\n\n c.beginPath();\n\n // render convex hulls\n for (i = 0; i < bodies.length; i++) {\n body = bodies[i];\n\n if (!body.render.visible || body.parts.length === 1)\n continue;\n\n c.moveTo(body.vertices[0].x, body.vertices[0].y);\n\n for (j = 1; j < body.vertices.length; j++) {\n c.lineTo(body.vertices[j].x, body.vertices[j].y);\n }\n\n c.lineTo(body.vertices[0].x, body.vertices[0].y);\n }\n\n c.lineWidth = 1;\n c.strokeStyle = 'rgba(255,255,255,0.2)';\n c.stroke();\n };\n\n /**\n * Renders body vertex numbers.\n * @private\n * @method vertexNumbers\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.vertexNumbers = function(render, bodies, context) {\n var c = context,\n i,\n j,\n k;\n\n for (i = 0; i < bodies.length; i++) {\n var parts = bodies[i].parts;\n for (k = parts.length > 1 ? 1 : 0; k < parts.length; k++) {\n var part = parts[k];\n for (j = 0; j < part.vertices.length; j++) {\n c.fillStyle = 'rgba(255,255,255,0.2)';\n c.fillText(i + '_' + j, part.position.x + (part.vertices[j].x - part.position.x) * 0.8, part.position.y + (part.vertices[j].y - part.position.y) * 0.8);\n }\n }\n }\n };\n\n /**\n * Renders mouse position.\n * @private\n * @method mousePosition\n * @param {render} render\n * @param {mouse} mouse\n * @param {RenderingContext} context\n */\n Render.mousePosition = function(render, mouse, context) {\n var c = context;\n c.fillStyle = 'rgba(255,255,255,0.8)';\n c.fillText(mouse.position.x + ' ' + mouse.position.y, mouse.position.x + 5, mouse.position.y - 5);\n };\n\n /**\n * Draws body bounds\n * @private\n * @method bodyBounds\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyBounds = function(render, bodies, context) {\n var c = context,\n engine = render.engine,\n options = render.options;\n\n c.beginPath();\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n\n if (body.render.visible) {\n var parts = bodies[i].parts;\n for (var j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {\n var part = parts[j];\n c.rect(part.bounds.min.x, part.bounds.min.y, part.bounds.max.x - part.bounds.min.x, part.bounds.max.y - part.bounds.min.y);\n }\n }\n }\n\n if (options.wireframes) {\n c.strokeStyle = 'rgba(255,255,255,0.08)';\n } else {\n c.strokeStyle = 'rgba(0,0,0,0.1)';\n }\n\n c.lineWidth = 1;\n c.stroke();\n };\n\n /**\n * Draws body angle indicators and axes\n * @private\n * @method bodyAxes\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyAxes = function(render, bodies, context) {\n var c = context,\n engine = render.engine,\n options = render.options,\n part,\n i,\n j,\n k;\n\n c.beginPath();\n\n for (i = 0; i < bodies.length; i++) {\n var body = bodies[i],\n parts = body.parts;\n\n if (!body.render.visible)\n continue;\n\n if (options.showAxes) {\n // render all axes\n for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {\n part = parts[j];\n for (k = 0; k < part.axes.length; k++) {\n var axis = part.axes[k];\n c.moveTo(part.position.x, part.position.y);\n c.lineTo(part.position.x + axis.x * 20, part.position.y + axis.y * 20);\n }\n }\n } else {\n for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {\n part = parts[j];\n for (k = 0; k < part.axes.length; k++) {\n // render a single axis indicator\n c.moveTo(part.position.x, part.position.y);\n c.lineTo((part.vertices[0].x + part.vertices[part.vertices.length-1].x) / 2,\n (part.vertices[0].y + part.vertices[part.vertices.length-1].y) / 2);\n }\n }\n }\n }\n\n if (options.wireframes) {\n c.strokeStyle = 'indianred';\n c.lineWidth = 1;\n } else {\n c.strokeStyle = 'rgba(255, 255, 255, 0.4)';\n c.globalCompositeOperation = 'overlay';\n c.lineWidth = 2;\n }\n\n c.stroke();\n c.globalCompositeOperation = 'source-over';\n };\n\n /**\n * Draws body positions\n * @private\n * @method bodyPositions\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyPositions = function(render, bodies, context) {\n var c = context,\n engine = render.engine,\n options = render.options,\n body,\n part,\n i,\n k;\n\n c.beginPath();\n\n // render current positions\n for (i = 0; i < bodies.length; i++) {\n body = bodies[i];\n\n if (!body.render.visible)\n continue;\n\n // handle compound parts\n for (k = 0; k < body.parts.length; k++) {\n part = body.parts[k];\n c.arc(part.position.x, part.position.y, 3, 0, 2 * Math.PI, false);\n c.closePath();\n }\n }\n\n if (options.wireframes) {\n c.fillStyle = 'indianred';\n } else {\n c.fillStyle = 'rgba(0,0,0,0.5)';\n }\n c.fill();\n\n c.beginPath();\n\n // render previous positions\n for (i = 0; i < bodies.length; i++) {\n body = bodies[i];\n if (body.render.visible) {\n c.arc(body.positionPrev.x, body.positionPrev.y, 2, 0, 2 * Math.PI, false);\n c.closePath();\n }\n }\n\n c.fillStyle = 'rgba(255,165,0,0.8)';\n c.fill();\n };\n\n /**\n * Draws body velocity\n * @private\n * @method bodyVelocity\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyVelocity = function(render, bodies, context) {\n var c = context;\n\n c.beginPath();\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n\n if (!body.render.visible)\n continue;\n\n var velocity = Body.getVelocity(body);\n\n c.moveTo(body.position.x, body.position.y);\n c.lineTo(body.position.x + velocity.x, body.position.y + velocity.y);\n }\n\n c.lineWidth = 3;\n c.strokeStyle = 'cornflowerblue';\n c.stroke();\n };\n\n /**\n * Draws body ids\n * @private\n * @method bodyIds\n * @param {render} render\n * @param {body[]} bodies\n * @param {RenderingContext} context\n */\n Render.bodyIds = function(render, bodies, context) {\n var c = context,\n i,\n j;\n\n for (i = 0; i < bodies.length; i++) {\n if (!bodies[i].render.visible)\n continue;\n\n var parts = bodies[i].parts;\n for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {\n var part = parts[j];\n c.font = \"12px Arial\";\n c.fillStyle = 'rgba(255,255,255,0.5)';\n c.fillText(part.id, part.position.x + 10, part.position.y - 10);\n }\n }\n };\n\n /**\n * Description\n * @private\n * @method collisions\n * @param {render} render\n * @param {pair[]} pairs\n * @param {RenderingContext} context\n */\n Render.collisions = function(render, pairs, context) {\n var c = context,\n options = render.options,\n pair,\n collision,\n corrected,\n bodyA,\n bodyB,\n i,\n j;\n\n c.beginPath();\n\n // render collision positions\n for (i = 0; i < pairs.length; i++) {\n pair = pairs[i];\n\n if (!pair.isActive)\n continue;\n\n collision = pair.collision;\n for (j = 0; j < pair.contactCount; j++) {\n var contact = pair.contacts[j],\n vertex = contact.vertex;\n c.rect(vertex.x - 1.5, vertex.y - 1.5, 3.5, 3.5);\n }\n }\n\n if (options.wireframes) {\n c.fillStyle = 'rgba(255,255,255,0.7)';\n } else {\n c.fillStyle = 'orange';\n }\n c.fill();\n\n c.beginPath();\n\n // render collision normals\n for (i = 0; i < pairs.length; i++) {\n pair = pairs[i];\n\n if (!pair.isActive)\n continue;\n\n collision = pair.collision;\n\n if (pair.contactCount > 0) {\n var normalPosX = pair.contacts[0].vertex.x,\n normalPosY = pair.contacts[0].vertex.y;\n\n if (pair.contactCount === 2) {\n normalPosX = (pair.contacts[0].vertex.x + pair.contacts[1].vertex.x) / 2;\n normalPosY = (pair.contacts[0].vertex.y + pair.contacts[1].vertex.y) / 2;\n }\n\n if (collision.bodyB === collision.supports[0].body || collision.bodyA.isStatic === true) {\n c.moveTo(normalPosX - collision.normal.x * 8, normalPosY - collision.normal.y * 8);\n } else {\n c.moveTo(normalPosX + collision.normal.x * 8, normalPosY + collision.normal.y * 8);\n }\n\n c.lineTo(normalPosX, normalPosY);\n }\n }\n\n if (options.wireframes) {\n c.strokeStyle = 'rgba(255,165,0,0.7)';\n } else {\n c.strokeStyle = 'orange';\n }\n\n c.lineWidth = 1;\n c.stroke();\n };\n\n /**\n * Description\n * @private\n * @method separations\n * @param {render} render\n * @param {pair[]} pairs\n * @param {RenderingContext} context\n */\n Render.separations = function(render, pairs, context) {\n var c = context,\n options = render.options,\n pair,\n collision,\n corrected,\n bodyA,\n bodyB,\n i,\n j;\n\n c.beginPath();\n\n // render separations\n for (i = 0; i < pairs.length; i++) {\n pair = pairs[i];\n\n if (!pair.isActive)\n continue;\n\n collision = pair.collision;\n bodyA = collision.bodyA;\n bodyB = collision.bodyB;\n\n var k = 1;\n\n if (!bodyB.isStatic && !bodyA.isStatic) k = 0.5;\n if (bodyB.isStatic) k = 0;\n\n c.moveTo(bodyB.position.x, bodyB.position.y);\n c.lineTo(bodyB.position.x - collision.penetration.x * k, bodyB.position.y - collision.penetration.y * k);\n\n k = 1;\n\n if (!bodyB.isStatic && !bodyA.isStatic) k = 0.5;\n if (bodyA.isStatic) k = 0;\n\n c.moveTo(bodyA.position.x, bodyA.position.y);\n c.lineTo(bodyA.position.x + collision.penetration.x * k, bodyA.position.y + collision.penetration.y * k);\n }\n\n if (options.wireframes) {\n c.strokeStyle = 'rgba(255,165,0,0.5)';\n } else {\n c.strokeStyle = 'orange';\n }\n c.stroke();\n };\n\n /**\n * Description\n * @private\n * @method inspector\n * @param {inspector} inspector\n * @param {RenderingContext} context\n */\n Render.inspector = function(inspector, context) {\n var engine = inspector.engine,\n selected = inspector.selected,\n render = inspector.render,\n options = render.options,\n bounds;\n\n if (options.hasBounds) {\n var boundsWidth = render.bounds.max.x - render.bounds.min.x,\n boundsHeight = render.bounds.max.y - render.bounds.min.y,\n boundsScaleX = boundsWidth / render.options.width,\n boundsScaleY = boundsHeight / render.options.height;\n\n context.scale(1 / boundsScaleX, 1 / boundsScaleY);\n context.translate(-render.bounds.min.x, -render.bounds.min.y);\n }\n\n for (var i = 0; i < selected.length; i++) {\n var item = selected[i].data;\n\n context.translate(0.5, 0.5);\n context.lineWidth = 1;\n context.strokeStyle = 'rgba(255,165,0,0.9)';\n context.setLineDash([1,2]);\n\n switch (item.type) {\n\n case 'body':\n\n // render body selections\n bounds = item.bounds;\n context.beginPath();\n context.rect(Math.floor(bounds.min.x - 3), Math.floor(bounds.min.y - 3),\n Math.floor(bounds.max.x - bounds.min.x + 6), Math.floor(bounds.max.y - bounds.min.y + 6));\n context.closePath();\n context.stroke();\n\n break;\n\n case 'constraint':\n\n // render constraint selections\n var point = item.pointA;\n if (item.bodyA)\n point = item.pointB;\n context.beginPath();\n context.arc(point.x, point.y, 10, 0, 2 * Math.PI);\n context.closePath();\n context.stroke();\n\n break;\n\n }\n\n context.setLineDash([]);\n context.translate(-0.5, -0.5);\n }\n\n // render selection region\n if (inspector.selectStart !== null) {\n context.translate(0.5, 0.5);\n context.lineWidth = 1;\n context.strokeStyle = 'rgba(255,165,0,0.6)';\n context.fillStyle = 'rgba(255,165,0,0.1)';\n bounds = inspector.selectBounds;\n context.beginPath();\n context.rect(Math.floor(bounds.min.x), Math.floor(bounds.min.y),\n Math.floor(bounds.max.x - bounds.min.x), Math.floor(bounds.max.y - bounds.min.y));\n context.closePath();\n context.stroke();\n context.fill();\n context.translate(-0.5, -0.5);\n }\n\n if (options.hasBounds)\n context.setTransform(1, 0, 0, 1, 0, 0);\n };\n\n /**\n * Updates render timing.\n * @method _updateTiming\n * @private\n * @param {render} render\n * @param {number} time\n */\n var _updateTiming = function(render, time) {\n var engine = render.engine,\n timing = render.timing,\n historySize = timing.historySize,\n timestamp = engine.timing.timestamp;\n\n timing.delta = time - timing.lastTime || Render._goodDelta;\n timing.lastTime = time;\n\n timing.timestampElapsed = timestamp - timing.lastTimestamp || 0;\n timing.lastTimestamp = timestamp;\n\n timing.deltaHistory.unshift(timing.delta);\n timing.deltaHistory.length = Math.min(timing.deltaHistory.length, historySize);\n\n timing.engineDeltaHistory.unshift(engine.timing.lastDelta);\n timing.engineDeltaHistory.length = Math.min(timing.engineDeltaHistory.length, historySize);\n\n timing.timestampElapsedHistory.unshift(timing.timestampElapsed);\n timing.timestampElapsedHistory.length = Math.min(timing.timestampElapsedHistory.length, historySize);\n\n timing.engineUpdatesHistory.unshift(engine.timing.lastUpdatesPerFrame);\n timing.engineUpdatesHistory.length = Math.min(timing.engineUpdatesHistory.length, historySize);\n\n timing.engineElapsedHistory.unshift(engine.timing.lastElapsed);\n timing.engineElapsedHistory.length = Math.min(timing.engineElapsedHistory.length, historySize);\n\n timing.elapsedHistory.unshift(timing.lastElapsed);\n timing.elapsedHistory.length = Math.min(timing.elapsedHistory.length, historySize);\n };\n\n /**\n * Returns the mean value of the given numbers.\n * @method _mean\n * @private\n * @param {Number[]} values\n * @return {Number} the mean of given values\n */\n var _mean = function(values) {\n var result = 0;\n for (var i = 0; i < values.length; i += 1) {\n result += values[i];\n }\n return (result / values.length) || 0;\n };\n\n /**\n * @method _createCanvas\n * @private\n * @param {} width\n * @param {} height\n * @return canvas\n */\n var _createCanvas = function(width, height) {\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n canvas.oncontextmenu = function() { return false; };\n canvas.onselectstart = function() { return false; };\n return canvas;\n };\n\n /**\n * Gets the pixel ratio of the canvas.\n * @method _getPixelRatio\n * @private\n * @param {HTMLElement} canvas\n * @return {Number} pixel ratio\n */\n var _getPixelRatio = function(canvas) {\n var context = canvas.getContext('2d'),\n devicePixelRatio = window.devicePixelRatio || 1,\n backingStorePixelRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio\n || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio\n || context.backingStorePixelRatio || 1;\n\n return devicePixelRatio / backingStorePixelRatio;\n };\n\n /**\n * Gets the requested texture (an Image) via its path\n * @method _getTexture\n * @private\n * @param {render} render\n * @param {string} imagePath\n * @return {Image} texture\n */\n var _getTexture = function(render, imagePath) {\n var image = render.textures[imagePath];\n\n if (image)\n return image;\n\n image = render.textures[imagePath] = new Image();\n image.src = imagePath;\n\n return image;\n };\n\n /**\n * Applies the background to the canvas using CSS.\n * @method applyBackground\n * @private\n * @param {render} render\n * @param {string} background\n */\n var _applyBackground = function(render, background) {\n var cssBackground = background;\n\n if (/(jpg|gif|png)$/.test(background))\n cssBackground = 'url(' + background + ')';\n\n render.canvas.style.background = cssBackground;\n render.canvas.style.backgroundSize = \"contain\";\n render.currentBackground = background;\n };\n\n /*\n *\n * Events Documentation\n *\n */\n\n /**\n * Fired before rendering\n *\n * @event beforeRender\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired after rendering\n *\n * @event afterRender\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * A back-reference to the `Matter.Render` module.\n *\n * @deprecated\n * @property controller\n * @type render\n */\n\n /**\n * A reference to the `Matter.Engine` instance to be used.\n *\n * @property engine\n * @type engine\n */\n\n /**\n * A reference to the element where the canvas is to be inserted (if `render.canvas` has not been specified)\n *\n * @property element\n * @type HTMLElement\n * @default null\n */\n\n /**\n * The canvas element to render to. If not specified, one will be created if `render.element` has been specified.\n *\n * @property canvas\n * @type HTMLCanvasElement\n * @default null\n */\n\n /**\n * A `Bounds` object that specifies the drawing view region.\n * Rendering will be automatically transformed and scaled to fit within the canvas size (`render.options.width` and `render.options.height`).\n * This allows for creating views that can pan or zoom around the scene.\n * You must also set `render.options.hasBounds` to `true` to enable bounded rendering.\n *\n * @property bounds\n * @type bounds\n */\n\n /**\n * The 2d rendering context from the `render.canvas` element.\n *\n * @property context\n * @type CanvasRenderingContext2D\n */\n\n /**\n * The sprite texture cache.\n *\n * @property textures\n * @type {}\n */\n\n /**\n * The mouse to render if `render.options.showMousePosition` is enabled.\n *\n * @property mouse\n * @type mouse\n * @default null\n */\n\n /**\n * The configuration options of the renderer.\n *\n * @property options\n * @type {}\n */\n\n /**\n * The target width in pixels of the `render.canvas` to be created.\n * See also the `options.pixelRatio` property to change render quality.\n *\n * @property options.width\n * @type number\n * @default 800\n */\n\n /**\n * The target height in pixels of the `render.canvas` to be created.\n * See also the `options.pixelRatio` property to change render quality.\n *\n * @property options.height\n * @type number\n * @default 600\n */\n\n /**\n * The [pixel ratio](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio) to use when rendering.\n *\n * @property options.pixelRatio\n * @type number\n * @default 1\n */\n\n /**\n * A CSS background color string to use when `render.options.wireframes` is disabled.\n * This may be also set to `'transparent'` or equivalent.\n *\n * @property options.background\n * @type string\n * @default '#14151f'\n */\n\n /**\n * A CSS color string to use for background when `render.options.wireframes` is enabled.\n * This may be also set to `'transparent'` or equivalent.\n *\n * @property options.wireframeBackground\n * @type string\n * @default '#14151f'\n */\n\n /**\n * A CSS color string to use for stroke when `render.options.wireframes` is enabled.\n * This may be also set to `'transparent'` or equivalent.\n *\n * @property options.wireframeStrokeStyle\n * @type string\n * @default '#bbb'\n */\n\n /**\n * A flag that specifies if `render.bounds` should be used when rendering.\n *\n * @property options.hasBounds\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable all debug information overlays together. \n * This includes and has priority over the values of:\n *\n * - `render.options.showStats`\n * - `render.options.showPerformance`\n *\n * @property options.showDebug\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the engine stats info overlay. \n * From left to right, the values shown are:\n *\n * - body parts total\n * - body total\n * - constraints total\n * - composites total\n * - collision pairs total\n *\n * @property options.showStats\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable performance charts. \n * From left to right, the values shown are:\n *\n * - average render frequency (e.g. 60 fps)\n * - exact engine delta time used for last update (e.g. 16.66ms)\n * - average updates per frame (e.g. 1)\n * - average engine execution duration (e.g. 5.00ms)\n * - average render execution duration (e.g. 0.40ms)\n * - average effective play speed (e.g. '1.00x' is 'real-time')\n *\n * Each value is recorded over a fixed sample of past frames (60 frames).\n *\n * A chart shown below each value indicates the variance from the average over the sample.\n * The more stable or fixed the value is the flatter the chart will appear.\n *\n * @property options.showPerformance\n * @type boolean\n * @default false\n */\n \n /**\n * A flag to enable or disable rendering entirely.\n *\n * @property options.enabled\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to toggle wireframe rendering otherwise solid fill rendering is used.\n *\n * @property options.wireframes\n * @type boolean\n * @default true\n */\n\n /**\n * A flag to enable or disable sleeping bodies indicators.\n *\n * @property options.showSleeping\n * @type boolean\n * @default true\n */\n\n /**\n * A flag to enable or disable the debug information overlay.\n *\n * @property options.showDebug\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the collision broadphase debug overlay.\n *\n * @deprecated no longer implemented\n * @property options.showBroadphase\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body bounds debug overlay.\n *\n * @property options.showBounds\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body velocity debug overlay.\n *\n * @property options.showVelocity\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body collisions debug overlay.\n *\n * @property options.showCollisions\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the collision resolver separations debug overlay.\n *\n * @property options.showSeparations\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body axes debug overlay.\n *\n * @property options.showAxes\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body positions debug overlay.\n *\n * @property options.showPositions\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body angle debug overlay.\n *\n * @property options.showAngleIndicator\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body and part ids debug overlay.\n *\n * @property options.showIds\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body vertex numbers debug overlay.\n *\n * @property options.showVertexNumbers\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body convex hulls debug overlay.\n *\n * @property options.showConvexHulls\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the body internal edges debug overlay.\n *\n * @property options.showInternalEdges\n * @type boolean\n * @default false\n */\n\n /**\n * A flag to enable or disable the mouse position debug overlay.\n *\n * @property options.showMousePosition\n * @type boolean\n * @default false\n */\n\n})();\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Runner` module is an optional utility that provides a game loop for running a `Matter.Engine` inside a browser environment.\n* A runner will continuously update a `Matter.Engine` whilst synchronising engine updates with the browser frame rate.\n* This runner favours a smoother user experience over perfect time keeping.\n* This runner is optional and is used for development and debugging but could be useful as a starting point for implementing some games and experiences.\n* Alternatively see `Engine.update` to step the engine directly inside your own game loop implementation as may be needed inside other environments.\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Runner\n*/\n\nvar Runner = {};\n\nmodule.exports = Runner;\n\nvar Events = __webpack_require__(5);\nvar Engine = __webpack_require__(17);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n Runner._maxFrameDelta = 1000 / 15;\n Runner._frameDeltaFallback = 1000 / 60;\n Runner._timeBufferMargin = 1.5;\n Runner._elapsedNextEstimate = 1;\n Runner._smoothingLowerBound = 0.1;\n Runner._smoothingUpperBound = 0.9;\n\n /**\n * Creates a new Runner. \n * See the properties section below for detailed information on what you can pass via the `options` object.\n * @method create\n * @param {} options\n */\n Runner.create = function(options) {\n var defaults = {\n delta: 1000 / 60,\n frameDelta: null,\n frameDeltaSmoothing: true,\n frameDeltaSnapping: true,\n frameDeltaHistory: [],\n frameDeltaHistorySize: 100,\n frameRequestId: null,\n timeBuffer: 0,\n timeLastTick: null,\n maxUpdates: null,\n maxFrameTime: 1000 / 30,\n lastUpdatesDeferred: 0,\n enabled: true\n };\n\n var runner = Common.extend(defaults, options);\n\n // for temporary back compatibility only\n runner.fps = 0;\n\n return runner;\n };\n\n /**\n * Runs a `Matter.Engine` whilst synchronising engine updates with the browser frame rate. \n * See module and properties descriptions for more information on this runner.\n * Alternatively see `Engine.update` to step the engine directly inside your own game loop implementation.\n * @method run\n * @param {runner} runner\n * @param {engine} [engine]\n * @return {runner} runner\n */\n Runner.run = function(runner, engine) {\n // initial time buffer for the first frame\n runner.timeBuffer = Runner._frameDeltaFallback;\n\n (function onFrame(time){\n runner.frameRequestId = Runner._onNextFrame(runner, onFrame);\n\n if (time && runner.enabled) {\n Runner.tick(runner, engine, time);\n }\n })();\n\n return runner;\n };\n\n /**\n * Performs a single runner tick as used inside `Runner.run`.\n * See module and properties descriptions for more information on this runner.\n * Alternatively see `Engine.update` to step the engine directly inside your own game loop implementation.\n * @method tick\n * @param {runner} runner\n * @param {engine} engine\n * @param {number} time\n */\n Runner.tick = function(runner, engine, time) {\n var tickStartTime = Common.now(),\n engineDelta = runner.delta,\n updateCount = 0;\n\n // find frame delta time since last call\n var frameDelta = time - runner.timeLastTick;\n\n // fallback for unusable frame delta values (e.g. 0, NaN, on first frame or long pauses)\n if (!frameDelta || !runner.timeLastTick || frameDelta > Math.max(Runner._maxFrameDelta, runner.maxFrameTime)) {\n // reuse last accepted frame delta else fallback\n frameDelta = runner.frameDelta || Runner._frameDeltaFallback;\n }\n\n if (runner.frameDeltaSmoothing) {\n // record frame delta over a number of frames\n runner.frameDeltaHistory.push(frameDelta);\n runner.frameDeltaHistory = runner.frameDeltaHistory.slice(-runner.frameDeltaHistorySize);\n\n // sort frame delta history\n var deltaHistorySorted = runner.frameDeltaHistory.slice(0).sort();\n\n // sample a central window to limit outliers\n var deltaHistoryWindow = runner.frameDeltaHistory.slice(\n deltaHistorySorted.length * Runner._smoothingLowerBound, \n deltaHistorySorted.length * Runner._smoothingUpperBound\n );\n\n // take the mean of the central window\n var frameDeltaSmoothed = _mean(deltaHistoryWindow);\n frameDelta = frameDeltaSmoothed || frameDelta;\n }\n\n if (runner.frameDeltaSnapping) {\n // snap frame delta to the nearest 1 Hz\n frameDelta = 1000 / Math.round(1000 / frameDelta);\n }\n\n // update runner values for next call\n runner.frameDelta = frameDelta;\n runner.timeLastTick = time;\n\n // accumulate elapsed time\n runner.timeBuffer += runner.frameDelta;\n\n // limit time buffer size to a single frame of updates\n runner.timeBuffer = Common.clamp(\n runner.timeBuffer, 0, runner.frameDelta + engineDelta * Runner._timeBufferMargin\n );\n\n // reset count of over budget updates\n runner.lastUpdatesDeferred = 0;\n\n // get max updates per frame\n var maxUpdates = runner.maxUpdates || Math.ceil(runner.maxFrameTime / engineDelta);\n\n // create event object\n var event = {\n timestamp: engine.timing.timestamp\n };\n\n // tick events before update\n Events.trigger(runner, 'beforeTick', event);\n Events.trigger(runner, 'tick', event);\n\n var updateStartTime = Common.now();\n\n // simulate time elapsed between calls\n while (engineDelta > 0 && runner.timeBuffer >= engineDelta * Runner._timeBufferMargin) {\n // update the engine\n Events.trigger(runner, 'beforeUpdate', event);\n Engine.update(engine, engineDelta);\n Events.trigger(runner, 'afterUpdate', event);\n\n // consume time simulated from buffer\n runner.timeBuffer -= engineDelta;\n updateCount += 1;\n\n // find elapsed time during this tick\n var elapsedTimeTotal = Common.now() - tickStartTime,\n elapsedTimeUpdates = Common.now() - updateStartTime,\n elapsedNextEstimate = elapsedTimeTotal + Runner._elapsedNextEstimate * elapsedTimeUpdates / updateCount;\n\n // defer updates if over performance budgets for this frame\n if (updateCount >= maxUpdates || elapsedNextEstimate > runner.maxFrameTime) {\n runner.lastUpdatesDeferred = Math.round(Math.max(0, (runner.timeBuffer / engineDelta) - Runner._timeBufferMargin));\n break;\n }\n }\n\n // track timing metrics\n engine.timing.lastUpdatesPerFrame = updateCount;\n\n // tick events after update\n Events.trigger(runner, 'afterTick', event);\n\n // show useful warnings if needed\n if (runner.frameDeltaHistory.length >= 100) {\n if (runner.lastUpdatesDeferred && Math.round(runner.frameDelta / engineDelta) > maxUpdates) {\n Common.warnOnce('Matter.Runner: runner reached runner.maxUpdates, see docs.');\n } else if (runner.lastUpdatesDeferred) {\n Common.warnOnce('Matter.Runner: runner reached runner.maxFrameTime, see docs.');\n }\n\n if (typeof runner.isFixed !== 'undefined') {\n Common.warnOnce('Matter.Runner: runner.isFixed is now redundant, see docs.');\n }\n\n if (runner.deltaMin || runner.deltaMax) {\n Common.warnOnce('Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs.');\n }\n\n if (runner.fps !== 0) {\n Common.warnOnce('Matter.Runner: runner.fps was replaced by runner.delta, see docs.');\n }\n }\n };\n\n /**\n * Ends execution of `Runner.run` on the given `runner` by canceling the frame loop.\n * Alternatively to temporarily pause the runner, see `runner.enabled`.\n * @method stop\n * @param {runner} runner\n */\n Runner.stop = function(runner) {\n Runner._cancelNextFrame(runner);\n };\n\n /**\n * Schedules the `callback` on this `runner` for the next animation frame.\n * @private\n * @method _onNextFrame\n * @param {runner} runner\n * @param {function} callback\n * @return {number} frameRequestId\n */\n Runner._onNextFrame = function(runner, callback) {\n if (typeof window !== 'undefined' && window.requestAnimationFrame) {\n runner.frameRequestId = window.requestAnimationFrame(callback);\n } else {\n throw new Error('Matter.Runner: missing required global window.requestAnimationFrame.');\n }\n\n return runner.frameRequestId;\n };\n\n /**\n * Cancels the last callback scheduled by `Runner._onNextFrame` on this `runner`.\n * @private\n * @method _cancelNextFrame\n * @param {runner} runner\n */\n Runner._cancelNextFrame = function(runner) {\n if (typeof window !== 'undefined' && window.cancelAnimationFrame) {\n window.cancelAnimationFrame(runner.frameRequestId);\n } else {\n throw new Error('Matter.Runner: missing required global window.cancelAnimationFrame.');\n }\n };\n\n /**\n * Returns the mean of the given numbers.\n * @method _mean\n * @private\n * @param {Number[]} values\n * @return {Number} the mean of given values.\n */\n var _mean = function(values) {\n var result = 0,\n valuesLength = values.length;\n\n for (var i = 0; i < valuesLength; i += 1) {\n result += values[i];\n }\n\n return (result / valuesLength) || 0;\n };\n\n /*\n *\n * Events Documentation\n *\n */\n\n /**\n * Fired once at the start of the browser frame, before any engine updates.\n *\n * @event beforeTick\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired once at the start of the browser frame, after `beforeTick`.\n *\n * @event tick\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired once at the end of the browser frame, after `beforeTick`, `tick` and after any engine updates.\n *\n * @event afterTick\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired before each and every engine update in this browser frame (if any). \n * There may be multiple engine update calls per browser frame (or none) depending on framerate and timestep delta.\n *\n * @event beforeUpdate\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /**\n * Fired after each and every engine update in this browser frame (if any). \n * There may be multiple engine update calls per browser frame (or none) depending on framerate and timestep delta.\n *\n * @event afterUpdate\n * @param {} event An event object\n * @param {number} event.timestamp The engine.timing.timestamp of the event\n * @param {} event.source The source object of the event\n * @param {} event.name The name of the event\n */\n\n /*\n *\n * Properties Documentation\n *\n */\n\n /**\n * The fixed timestep size used for `Engine.update` calls in milliseconds, known as `delta`.\n * \n * This value is recommended to be `1000 / 60` ms or smaller (i.e. equivalent to at least 60hz).\n * \n * Smaller `delta` values provide higher quality results at the cost of performance.\n * \n * You should usually avoid changing `delta` during running, otherwise quality may be affected. \n * \n * For smoother frame pacing choose a `delta` that is an even multiple of each display FPS you target, i.e. `1000 / (n * fps)` as this helps distribute an equal number of updates over each display frame.\n * \n * For example with a 60 Hz `delta` i.e. `1000 / 60` the runner will on average perform one update per frame on displays running 60 FPS and one update every two frames on displays running 120 FPS, etc.\n * \n * Where as e.g. using a 240 Hz `delta` i.e. `1000 / 240` the runner will on average perform four updates per frame on displays running 60 FPS and two updates per frame on displays running 120 FPS, etc.\n * \n * Therefore `Runner.run` will call multiple engine updates (or none) as needed to simulate the time elapsed between browser frames. \n * \n * In practice the number of updates in any particular frame may be restricted to respect the runner's performance budgets. These are specified by `runner.maxFrameTime` and `runner.maxUpdates`, see those properties for details.\n * \n * @property delta\n * @type number\n * @default 1000 / 60\n */\n\n /**\n * A flag that can be toggled to enable or disable tick calls on this runner, therefore pausing engine updates and events while the runner loop remains running.\n *\n * @property enabled\n * @type boolean\n * @default true\n */\n\n /**\n * The accumulated time elapsed that has yet to be simulated in milliseconds.\n * This value is clamped within certain limits (see `Runner.tick` code).\n *\n * @private\n * @property timeBuffer\n * @type number\n * @default 0\n */\n\n /**\n * The measured time elapsed between the last two browser frames measured in milliseconds.\n * This is useful e.g. to estimate the current browser FPS using `1000 / runner.frameDelta`.\n *\n * @readonly\n * @property frameDelta\n * @type number\n */\n\n /**\n * Enables averaging to smooth frame rate measurements and therefore stabilise play rate.\n *\n * @property frameDeltaSmoothing\n * @type boolean\n * @default true\n */\n\n /**\n * Rounds measured browser frame delta to the nearest 1 Hz.\n * This option can help smooth frame rate measurements and simplify handling hardware timing differences e.g. 59.94Hz and 60Hz displays.\n * For best results you should also round your `runner.delta` equivalent to the nearest 1 Hz.\n *\n * @property frameDeltaSnapping\n * @type boolean\n * @default true\n */\n\n /**\n * A performance budget that limits execution time allowed for this runner per browser frame in milliseconds.\n * \n * To calculate the effective browser FPS at which this throttle is applied use `1000 / runner.maxFrameTime`.\n * \n * This performance budget is intended to help maintain browser interactivity and help improve framerate recovery during temporary high CPU usage.\n * \n * This budget only covers the measured time elapsed executing the functions called in the scope of the runner tick, including `Engine.update` and its related user event callbacks.\n * \n * You may also reduce this budget to allow for any significant additional processing you perform on the same thread outside the scope of this runner tick, e.g. rendering time.\n * \n * See also `runner.maxUpdates`.\n *\n * @property maxFrameTime\n * @type number\n * @default 1000 / 30\n */\n\n /**\n * An optional limit for maximum engine update count allowed per frame tick in addition to `runner.maxFrameTime`.\n * \n * Unless you set a value it is automatically chosen based on `runner.delta` and `runner.maxFrameTime`.\n * \n * See also `runner.maxFrameTime`.\n * \n * @property maxUpdates\n * @type number\n * @default null\n */\n\n /**\n * The timestamp of the last call to `Runner.tick` used to measure `frameDelta`.\n *\n * @private\n * @property timeLastTick\n * @type number\n * @default 0\n */\n\n /**\n * The id of the last call to `Runner._onNextFrame`.\n *\n * @private\n * @property frameRequestId\n * @type number\n * @default null\n */\n\n})();\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* This module has now been replaced by `Matter.Collision`.\n*\n* All usage should be migrated to `Matter.Collision`.\n* For back-compatibility purposes this module will remain for a short term and then later removed in a future release.\n*\n* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem.\n*\n* @class SAT\n* @deprecated\n*/\n\nvar SAT = {};\n\nmodule.exports = SAT;\n\nvar Collision = __webpack_require__(8);\nvar Common = __webpack_require__(0);\nvar deprecated = Common.deprecated;\n\n(function() {\n\n /**\n * Detect collision between two bodies using the Separating Axis Theorem.\n * @deprecated replaced by Collision.collides\n * @method collides\n * @param {body} bodyA\n * @param {body} bodyB\n * @return {collision} collision\n */\n SAT.collides = function(bodyA, bodyB) {\n return Collision.collides(bodyA, bodyB);\n };\n\n deprecated(SAT, 'collides', 'SAT.collides ➤ replaced by Collision.collides');\n\n})();\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* The `Matter.Svg` module contains methods for converting SVG images into an array of vector points.\n*\n* To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg\n*\n* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples).\n*\n* @class Svg\n*/\n\nvar Svg = {};\n\nmodule.exports = Svg;\n\nvar Bounds = __webpack_require__(1);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * Converts an SVG path into an array of vector points.\n * If the input path forms a concave shape, you must decompose the result into convex parts before use.\n * See `Bodies.fromVertices` which provides support for this.\n * Note that this function is not guaranteed to support complex paths (such as those with holes).\n * You must load the `pathseg.js` polyfill on newer browsers.\n * @method pathToVertices\n * @param {SVGPathElement} path\n * @param {Number} [sampleLength=15]\n * @return {Vector[]} points\n */\n Svg.pathToVertices = function(path, sampleLength) {\n if (typeof window !== 'undefined' && !('SVGPathSeg' in window)) {\n Common.warn('Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.');\n }\n\n // https://github.com/wout/svg.topoly.js/blob/master/svg.topoly.js\n var i, il, total, point, segment, segments, \n segmentsQueue, lastSegment, \n lastPoint, segmentIndex, points = [],\n lx, ly, length = 0, x = 0, y = 0;\n\n sampleLength = sampleLength || 15;\n\n var addPoint = function(px, py, pathSegType) {\n // all odd-numbered path types are relative except PATHSEG_CLOSEPATH (1)\n var isRelative = pathSegType % 2 === 1 && pathSegType > 1;\n\n // when the last point doesn't equal the current point add the current point\n if (!lastPoint || px != lastPoint.x || py != lastPoint.y) {\n if (lastPoint && isRelative) {\n lx = lastPoint.x;\n ly = lastPoint.y;\n } else {\n lx = 0;\n ly = 0;\n }\n\n var point = {\n x: lx + px,\n y: ly + py\n };\n\n // set last point\n if (isRelative || !lastPoint) {\n lastPoint = point;\n }\n\n points.push(point);\n\n x = lx + px;\n y = ly + py;\n }\n };\n\n var addSegmentPoint = function(segment) {\n var segType = segment.pathSegTypeAsLetter.toUpperCase();\n\n // skip path ends\n if (segType === 'Z') \n return;\n\n // map segment to x and y\n switch (segType) {\n\n case 'M':\n case 'L':\n case 'T':\n case 'C':\n case 'S':\n case 'Q':\n x = segment.x;\n y = segment.y;\n break;\n case 'H':\n x = segment.x;\n break;\n case 'V':\n y = segment.y;\n break;\n }\n\n addPoint(x, y, segment.pathSegType);\n };\n\n // ensure path is absolute\n Svg._svgPathToAbsolute(path);\n\n // get total length\n total = path.getTotalLength();\n\n // queue segments\n segments = [];\n for (i = 0; i < path.pathSegList.numberOfItems; i += 1)\n segments.push(path.pathSegList.getItem(i));\n\n segmentsQueue = segments.concat();\n\n // sample through path\n while (length < total) {\n // get segment at position\n segmentIndex = path.getPathSegAtLength(length);\n segment = segments[segmentIndex];\n\n // new segment\n if (segment != lastSegment) {\n while (segmentsQueue.length && segmentsQueue[0] != segment)\n addSegmentPoint(segmentsQueue.shift());\n\n lastSegment = segment;\n }\n\n // add points in between when curving\n // TODO: adaptive sampling\n switch (segment.pathSegTypeAsLetter.toUpperCase()) {\n\n case 'C':\n case 'T':\n case 'S':\n case 'Q':\n case 'A':\n point = path.getPointAtLength(length);\n addPoint(point.x, point.y, 0);\n break;\n\n }\n\n // increment by sample value\n length += sampleLength;\n }\n\n // add remaining segments not passed by sampling\n for (i = 0, il = segmentsQueue.length; i < il; ++i)\n addSegmentPoint(segmentsQueue[i]);\n\n return points;\n };\n\n Svg._svgPathToAbsolute = function(path) {\n // http://phrogz.net/convert-svg-path-to-all-absolute-commands\n // Copyright (c) Gavin Kistner\n // http://phrogz.net/js/_ReuseLicense.txt\n // Modifications: tidy formatting and naming\n var x0, y0, x1, y1, x2, y2, segs = path.pathSegList,\n x = 0, y = 0, len = segs.numberOfItems;\n\n for (var i = 0; i < len; ++i) {\n var seg = segs.getItem(i),\n segType = seg.pathSegTypeAsLetter;\n\n if (/[MLHVCSQTA]/.test(segType)) {\n if ('x' in seg) x = seg.x;\n if ('y' in seg) y = seg.y;\n } else {\n if ('x1' in seg) x1 = x + seg.x1;\n if ('x2' in seg) x2 = x + seg.x2;\n if ('y1' in seg) y1 = y + seg.y1;\n if ('y2' in seg) y2 = y + seg.y2;\n if ('x' in seg) x += seg.x;\n if ('y' in seg) y += seg.y;\n\n switch (segType) {\n\n case 'm':\n segs.replaceItem(path.createSVGPathSegMovetoAbs(x, y), i);\n break;\n case 'l':\n segs.replaceItem(path.createSVGPathSegLinetoAbs(x, y), i);\n break;\n case 'h':\n segs.replaceItem(path.createSVGPathSegLinetoHorizontalAbs(x), i);\n break;\n case 'v':\n segs.replaceItem(path.createSVGPathSegLinetoVerticalAbs(y), i);\n break;\n case 'c':\n segs.replaceItem(path.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2), i);\n break;\n case 's':\n segs.replaceItem(path.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2), i);\n break;\n case 'q':\n segs.replaceItem(path.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1), i);\n break;\n case 't':\n segs.replaceItem(path.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y), i);\n break;\n case 'a':\n segs.replaceItem(path.createSVGPathSegArcAbs(x, y, seg.r1, seg.r2, seg.angle, seg.largeArcFlag, seg.sweepFlag), i);\n break;\n case 'z':\n case 'Z':\n x = x0;\n y = y0;\n break;\n\n }\n }\n\n if (segType == 'M' || segType == 'm') {\n x0 = x;\n y0 = y;\n }\n }\n };\n\n})();\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n* This module has now been replaced by `Matter.Composite`.\n*\n* All usage should be migrated to the equivalent functions found on `Matter.Composite`.\n* For example `World.add(world, body)` now becomes `Composite.add(world, body)`.\n*\n* The property `world.gravity` has been moved to `engine.gravity`.\n*\n* For back-compatibility purposes this module will remain as a direct alias to `Matter.Composite` in the short term during migration.\n* Eventually this alias module will be marked as deprecated and then later removed in a future release.\n*\n* @class World\n*/\n\nvar World = {};\n\nmodule.exports = World;\n\nvar Composite = __webpack_require__(6);\nvar Common = __webpack_require__(0);\n\n(function() {\n\n /**\n * See above, aliases for back compatibility only\n */\n World.create = Composite.create;\n World.add = Composite.add;\n World.remove = Composite.remove;\n World.clear = Composite.clear;\n World.addComposite = Composite.addComposite;\n World.addBody = Composite.addBody;\n World.addConstraint = Composite.addConstraint;\n\n})();\n\n\n/***/ })\n/******/ ]);\n});","import { inject } from './core/injector';\r\n\r\n// Auto-inject on import\r\nif (typeof window !== 'undefined') {\r\n inject();\r\n}\r\n\r\nimport { devKittyPlugin } from './plugins/vite';\r\n\r\nexport { inject, destroy } from './core/injector';\r\nexport { Kitty } from './pets/kitty/kitty';\r\nexport { Overlay } from './core/overlay';\r\nexport { devKittyPlugin };\r\n\r\n// Default export\r\nexport default {\r\n init: inject,\r\n plugin: devKittyPlugin\r\n};\r\n","export const isLocalhost = (): boolean => {\r\n if (typeof window === 'undefined') return false;\r\n\r\n const hostname = window.location.hostname;\r\n\r\n return (\r\n hostname === 'localhost' ||\r\n hostname === '127.0.0.1' ||\r\n hostname.endsWith('.local') ||\r\n hostname === '[::1]'\r\n );\r\n};\r\n","export class Overlay {\r\n private container: HTMLDivElement;\r\n private shadow: ShadowRoot;\r\n public shadowContainer: HTMLDivElement;\r\n\r\n constructor() {\r\n this.container = document.createElement('div');\r\n this.container.id = 'dev-kitty-overlay';\r\n \r\n // Core styles for the container\r\n Object.assign(this.container.style, {\r\n position: 'fixed',\r\n top: '0',\r\n left: '0',\r\n width: '100vw',\r\n height: '100vh',\r\n pointerEvents: 'none',\r\n zIndex: '2147483647',\r\n });\r\n\r\n this.shadow = this.container.attachShadow({ mode: 'open' });\r\n this.shadowContainer = document.createElement('div');\r\n this.shadowContainer.id = 'dev-kitty-root';\r\n \r\n // Root container in shadow DOM\r\n Object.assign(this.shadowContainer.style, {\r\n width: '100%',\r\n height: '100%',\r\n position: 'relative',\r\n overflow: 'hidden',\r\n });\r\n\r\n this.shadow.appendChild(this.shadowContainer);\r\n }\r\n\r\n mount() {\r\n if (!document.getElementById('dev-kitty-overlay')) {\r\n document.body.appendChild(this.container);\r\n }\r\n }\r\n\r\n destroy() {\r\n if (this.container.parentNode) {\r\n this.container.parentNode.removeChild(this.container);\r\n }\r\n }\r\n}\r\n","export abstract class BasePet {\r\n protected container: HTMLElement | null = null;\r\n protected element: HTMLElement | null = null;\r\n protected x: number = 0;\r\n protected y: number = 0;\r\n protected state: string = 'idle';\r\n\r\n abstract mount(container: HTMLElement): void;\r\n abstract update(delta: number): void;\r\n abstract destroy(): void;\r\n\r\n protected setPosition(x: number, y: number) {\r\n this.x = x;\r\n this.y = y;\r\n if (this.element) {\r\n // Rounding prevents pixel vibration/shimmering on modern displays\r\n this.element.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;\r\n }\r\n }\r\n}\r\n","import { KittyState } from './ai';\r\n\r\nexport class KittySprite {\r\n private element: HTMLElement;\r\n private currentFrame: number = 0;\r\n private animationTimer: number = 0;\r\n private frameRate: number = 250;\r\n\r\n private static readonly SVG_TEMPLATE = `\r\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\" shape-rendering=\"crispEdges\">\r\n <!-- Tail -->\r\n <rect x=\"2\" y=\"16\" width=\"6\" height=\"2\" fill=\"#333\" id=\"tail\" />\r\n <!-- Body -->\r\n <rect x=\"8\" y=\"14\" width=\"14\" height=\"10\" fill=\"#333\" id=\"body\" />\r\n <!-- Head -->\r\n <rect x=\"16\" y=\"8\" width=\"10\" height=\"10\" fill=\"#333\" id=\"head\" />\r\n <!-- Ears -->\r\n <rect x=\"17\" y=\"5\" width=\"3\" height=\"3\" fill=\"#333\" id=\"ear-l\" />\r\n <rect x=\"23\" y=\"5\" width=\"3\" height=\"3\" fill=\"#333\" id=\"ear-r\" />\r\n <!-- Eyes -->\r\n <rect x=\"19\" y=\"11\" width=\"2\" height=\"2\" fill=\"#fff\" class=\"eye\" />\r\n <rect x=\"24\" y=\"11\" width=\"2\" height=\"2\" fill=\"#fff\" class=\"eye\" />\r\n <!-- Nose -->\r\n <rect x=\"23\" y=\"14\" width=\"2\" height=\"1\" fill=\"#ffb7b7\" />\r\n <!-- Legs -->\r\n <rect x=\"9\" y=\"24\" width=\"3\" height=\"4\" fill=\"#333\" class=\"leg leg-fl\" />\r\n <rect x=\"13\" y=\"24\" width=\"3\" height=\"4\" fill=\"#333\" class=\"leg leg-fr\" />\r\n <rect x=\"17\" y=\"24\" width=\"3\" height=\"4\" fill=\"#333\" class=\"leg leg-bl\" />\r\n <rect x=\"20\" y=\"24\" width=\"3\" height=\"4\" fill=\"#333\" class=\"leg leg-br\" />\r\n <!-- Speech Bubble -->\r\n <g id=\"bubble\" style=\"display:none\">\r\n <rect x=\"0\" y=\"0\" width=\"30\" height=\"10\" rx=\"2\" fill=\"white\" stroke=\"#333\" stroke-width=\"0.5\" />\r\n <text x=\"15\" y=\"7\" font-family=\"monospace\" font-size=\"4\" text-anchor=\"middle\" fill=\"#333\" id=\"bubble-text\">MEOW</text>\r\n </g>\r\n <!-- Sleep Zzz (hidden by default) -->\r\n <text x=\"2\" y=\"10\" font-family=\"Arial\" font-size=\"6\" fill=\"#aaa\" id=\"zzz\" style=\"display:none\">Zzz</text>\r\n </svg>\r\n `;\r\n\r\n constructor() {\r\n this.element = document.createElement('div');\r\n this.element.style.width = '64px';\r\n this.element.style.height = '64px';\r\n this.element.style.imageRendering = 'pixelated';\r\n this.element.innerHTML = KittySprite.SVG_TEMPLATE;\r\n \r\n const svg = this.element.querySelector('svg');\r\n if (svg) {\r\n svg.style.width = '100%';\r\n svg.style.height = '100%';\r\n }\r\n }\r\n\r\n getElement() {\r\n return this.element;\r\n }\r\n\r\n update(delta: number, state: KittyState, facing: 'left' | 'right') {\r\n this.animationTimer += delta;\r\n if (this.animationTimer >= this.frameRate) {\r\n this.animationTimer = 0;\r\n this.currentFrame = (this.currentFrame + 1) % 4;\r\n this.animate(state, facing);\r\n }\r\n }\r\n\r\n private animate(state: KittyState, facing: 'left' | 'right') {\r\n const svg = this.element.querySelector('svg');\r\n if (!svg) return;\r\n\r\n const head = svg.querySelector('#head') as SVGRectElement;\r\n const body = svg.querySelector('#body') as SVGRectElement;\r\n const tail = svg.querySelector('#tail') as SVGRectElement;\r\n const zzz = svg.querySelector('#zzz') as SVGTextElement;\r\n const legs = svg.querySelectorAll('.leg');\r\n const eyes = svg.querySelectorAll('.eye');\r\n\r\n // Handle Direction\r\n if (facing === 'left') {\r\n this.element.style.transform = 'scaleX(-1)';\r\n } else {\r\n this.element.style.transform = 'scaleX(1)';\r\n }\r\n\r\n // Reset basics\r\n zzz.style.display = 'none';\r\n eyes.forEach(e => (e as SVGRectElement).setAttribute('fill', '#fff'));\r\n legs.forEach(l => (l as SVGRectElement).setAttribute('height', '4'));\r\n tail.setAttribute('transform', '');\r\n body.setAttribute('y', '14');\r\n head.setAttribute('y', '8');\r\n body.setAttribute('width', '14');\r\n\r\n switch (state) {\r\n case 'walk-left':\r\n case 'walk-right':\r\n case 'chase-ball':\r\n case 'zoomies':\r\n case 'pounce':\r\n // Walk cycle\r\n const off = (this.currentFrame % 2 === 0) ? 2 : 0;\r\n legs.forEach((l, i) => {\r\n const legOff = (i % 2 === 0) ? off : 2 - off;\r\n (l as SVGRectElement).setAttribute('y', (24 + legOff).toString());\r\n });\r\n tail.setAttribute('transform', `rotate(${Math.sin(Date.now()/100)*15} 4 17)`);\r\n \r\n if (state === 'zoomies') {\r\n this.element.style.transform += ` rotate(${Math.sin(Date.now()/50)*10}deg)`;\r\n }\r\n break;\r\n\r\n case 'sleep':\r\n eyes.forEach(e => (e as SVGRectElement).setAttribute('fill', 'transparent'));\r\n zzz.style.display = 'block';\r\n zzz.style.opacity = (0.5 + Math.sin(Date.now()/500) * 0.5).toString();\r\n legs.forEach(l => (l as SVGRectElement).setAttribute('height', '2'));\r\n body.setAttribute('y', '15');\r\n head.setAttribute('y', '9');\r\n break;\r\n\r\n case 'sit':\r\n case 'lick-paw':\r\n legs.forEach(l => (l as SVGRectElement).setAttribute('height', '2'));\r\n head.setAttribute('y', '8');\r\n if (state === 'lick-paw') {\r\n const leg = legs[0] as SVGRectElement;\r\n leg.setAttribute('height', '4');\r\n leg.setAttribute('y', (22 + Math.sin(Date.now()/100)*2).toString());\r\n }\r\n break;\r\n\r\n case 'poop':\r\n this.element.style.transform += ' rotate(10deg)';\r\n legs.forEach(l => (l as SVGRectElement).setAttribute('height', '2'));\r\n break;\r\n\r\n case 'stretch':\r\n body.setAttribute('width', this.currentFrame % 2 === 0 ? '16' : '14');\r\n break;\r\n \r\n case 'jump':\r\n legs.forEach(l => (l as SVGRectElement).setAttribute('height', '6'));\r\n break;\r\n \r\n case 'stare':\r\n // Big eyes when staring\r\n eyes.forEach(e => {\r\n (e as SVGRectElement).setAttribute('width', '3');\r\n (e as SVGRectElement).setAttribute('height', '3');\r\n });\r\n break;\r\n\r\n case 'purr':\r\n const vib = Math.sin(Date.now()/30) * 1;\r\n head.setAttribute('y', (8 + vib).toString());\r\n body.setAttribute('y', (14 + vib).toString());\r\n break;\r\n\r\n default: // idle\r\n tail.setAttribute('transform', `rotate(${Math.sin(Date.now()/300)*5} 4 17)`);\r\n if (Math.random() < 0.1) eyes.forEach(e => (e as SVGRectElement).setAttribute('fill', 'transparent')); // Blink\r\n break;\r\n }\r\n }\r\n\r\n public showMessage(text: string, duration: number = 2000) {\r\n const svg = this.element.querySelector('svg');\r\n if (!svg) return;\r\n const bubble = svg.querySelector('#bubble') as SVGGElement;\r\n const bubbleText = svg.querySelector('#bubble-text') as SVGTextElement;\r\n \r\n bubbleText.textContent = text;\r\n bubble.style.display = 'block';\r\n \r\n setTimeout(() => {\r\n bubble.style.display = 'none';\r\n }, duration);\r\n }\r\n}\r\n","export type KittyState = \r\n | 'idle' \r\n | 'walk-left' \r\n | 'walk-right' \r\n | 'sleep' \r\n | 'sit' \r\n | 'stretch' \r\n | 'jump' \r\n | 'chase-ball' \r\n | 'poop' \r\n | 'scratch'\r\n | 'stare'\r\n | 'zoomies'\r\n | 'lick-paw'\r\n | 'pounce'\r\n | 'purr';\r\n\r\nexport class KittyAI {\r\n private currentState: KittyState = 'idle';\r\n private stateTimer: number = 0;\r\n private speed: number = 2.5;\r\n \r\n private mouseX: number = 0;\r\n private mouseY: number = 0;\r\n private isChasingMouse: boolean = false;\r\n\r\n private facing: 'left' | 'right' = 'right';\r\n\r\n constructor() {\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('mousemove', (e) => {\r\n this.mouseX = e.clientX;\r\n this.mouseY = e.clientY;\r\n });\r\n }\r\n }\r\n\r\n update(delta: number, currentX: number, currentY: number, ballPos?: { x: number, y: number }): { state: KittyState; x: number; y: number, facing: 'left' | 'right' } {\r\n this.stateTimer += delta;\r\n\r\n // --- ENFORCE SCREEN BOUNDARIES ---\r\n const width = 64; // Kitty width is roughly 64px\r\n const margin = 20;\r\n \r\n // Mouse proximity chasing (Cuteness factor)\r\n const distToMouse = Math.sqrt(Math.pow(this.mouseX - (currentX + 32), 2) + Math.pow(this.mouseY - (currentY + 32), 2));\r\n \r\n // Low probability to start chasing if close and not sleeping\r\n if (distToMouse < 200 && Math.random() < 0.05 && !this.isChasingMouse && this.currentState !== 'sleep') {\r\n this.isChasingMouse = true;\r\n this.currentState = 'chase-ball';\r\n }\r\n\r\n if (this.isChasingMouse) {\r\n if (distToMouse < 40) {\r\n this.isChasingMouse = false;\r\n this.currentState = 'sit';\r\n this.stateTimer = 0;\r\n }\r\n // If mouse gets too far, stop chasing\r\n if (distToMouse > 500) {\r\n this.isChasingMouse = false;\r\n }\r\n }\r\n\r\n // Normal State Transitions\r\n if (this.stateTimer > this.getStateDuration(this.currentState)) {\r\n this.stateTimer = 0;\r\n this.isChasingMouse = false;\r\n const oldState = this.currentState;\r\n this.currentState = this.getNextState();\r\n \r\n // Keep track of direction when walking starts\r\n if (this.currentState === 'walk-left') this.facing = 'left';\r\n if (this.currentState === 'walk-right') this.facing = 'right';\r\n }\r\n\r\n let nextX = currentX;\r\n let nextY = currentY;\r\n\r\n // Movement speeds\r\n const moveSpeed = this.getSpeedForState(this.currentState);\r\n\r\n switch (this.currentState) {\r\n case 'walk-left':\r\n nextX -= moveSpeed;\r\n this.facing = 'left';\r\n break;\r\n case 'walk-right':\r\n nextX += moveSpeed;\r\n this.facing = 'right';\r\n break;\r\n case 'zoomies':\r\n // Zoomies moves randomly but fast\r\n nextX += (Math.random() - 0.5) * moveSpeed * 2;\r\n break;\r\n case 'chase-ball':\r\n const target = this.isChasingMouse ? { x: this.mouseX, y: this.mouseY } : (ballPos || { x: nextX, y: nextY });\r\n const dx = (target.x - 32) - nextX;\r\n nextX += Math.sign(dx) * moveSpeed;\r\n if (dx !== 0) this.facing = dx < 0 ? 'left' : 'right';\r\n break;\r\n case 'pounce':\r\n // Pounce is a quick dash forward in current facing direction\r\n nextX += (this.facing === 'left' ? -1 : 1) * moveSpeed;\r\n break;\r\n }\r\n\r\n // Clamp X to screen\r\n if (nextX < margin) {\r\n nextX = margin;\r\n if (this.currentState === 'walk-left') this.currentState = 'walk-right';\r\n } else if (nextX > window.innerWidth - width - margin) {\r\n nextX = window.innerWidth - width - margin;\r\n if (this.currentState === 'walk-right') this.currentState = 'walk-left';\r\n }\r\n\r\n // Smooth Y movement\r\n const groundY = window.innerHeight - 80;\r\n let targetY = groundY;\r\n \r\n // Jump effect handles its own Y usually with GSAP, but we provide a base here\r\n if (this.isChasingMouse) targetY = Math.min(this.mouseY - 32, groundY);\r\n \r\n nextY += (targetY - nextY) * 0.1;\r\n\r\n return { state: this.currentState, x: nextX, y: nextY, facing: this.facing };\r\n }\r\n\r\n private getSpeedForState(state: KittyState): number {\r\n switch (state) {\r\n case 'walk-left':\r\n case 'walk-right': return this.speed;\r\n case 'chase-ball': return this.speed * 2.5;\r\n case 'zoomies': return this.speed * 5;\r\n case 'pounce': return this.speed * 4;\r\n default: return 0;\r\n }\r\n }\r\n\r\n private getStateDuration(state: KittyState): number {\r\n switch (state) {\r\n case 'idle': return 1500 + Math.random() * 2000;\r\n case 'walk-left':\r\n case 'walk-right': return 2000 + Math.random() * 3000;\r\n case 'sleep': return 10000 + Math.random() * 15000;\r\n case 'sit': return 3000 + Math.random() * 4000;\r\n case 'poop': return 4000;\r\n case 'scratch': return 2000;\r\n case 'stare': return 3000;\r\n case 'stretch': return 2000;\r\n case 'zoomies': return 1500 + Math.random() * 1000;\r\n case 'lick-paw': return 3000;\r\n case 'pounce': return 800;\r\n case 'purr': return 5000;\r\n default: return 2000;\r\n }\r\n }\r\n\r\n private getNextState(): KittyState {\r\n const roll = Math.random();\r\n // Weighted selection for better personality\r\n if (roll < 0.15) return 'walk-left';\r\n if (roll < 0.30) return 'walk-right';\r\n if (roll < 0.45) return 'idle';\r\n if (roll < 0.55) return 'sit';\r\n if (roll < 0.65) return 'sleep';\r\n if (roll < 0.72) return 'stare';\r\n if (roll < 0.77) return 'lick-paw';\r\n if (roll < 0.82) return 'scratch';\r\n if (roll < 0.86) return 'stretch';\r\n if (roll < 0.90) return 'jump';\r\n if (roll < 0.93) return 'zoomies';\r\n if (roll < 0.95) return 'pounce';\r\n if (roll < 0.98) return 'purr';\r\n return 'poop';\r\n }\r\n\r\n public getState(): KittyState {\r\n return this.currentState;\r\n }\r\n}\r\n","import { Engine, Render, World, Bodies, Body, Vector } from 'matter-js';\r\n\r\nexport class PhysicsEngine {\r\n public engine: Engine;\r\n public world: World;\r\n\r\n constructor() {\r\n this.engine = Engine.create();\r\n this.world = this.engine.world;\r\n this.engine.gravity.y = 0.5; // Custom gravity\r\n }\r\n\r\n update(delta: number) {\r\n // Matter.js warning fix: Use a fixed timestep or cap the delta\r\n const fixedTimeStep = 1000 / 60; // 16.666ms\r\n const cappedDelta = Math.min(delta, fixedTimeStep * 2); \r\n Engine.update(this.engine, cappedDelta);\r\n }\r\n\r\n addBall(x: number, y: number, radius: number) {\r\n const ball = Bodies.circle(x, y, radius, {\r\n restitution: 0.8,\r\n friction: 0.05,\r\n frictionAir: 0.02,\r\n label: 'ball'\r\n });\r\n World.add(this.world, ball);\r\n return ball;\r\n }\r\n\r\n private floor: Body | null = null;\r\n\r\n addFloor(width: number, height: number) {\r\n if (this.floor) World.remove(this.world, this.floor);\r\n this.floor = Bodies.rectangle(width / 2, height + 50, width, 100, {\r\n isStatic: true,\r\n label: 'floor'\r\n });\r\n World.add(this.world, this.floor);\r\n return this.floor;\r\n }\r\n}\r\n","import { Body } from 'matter-js';\r\n\r\nexport class YarnBall {\r\n public element: HTMLDivElement;\r\n public body: Body;\r\n\r\n constructor(container: HTMLElement, body: Body) {\r\n this.body = body;\r\n this.element = document.createElement('div');\r\n this.element.innerHTML = '🧶';\r\n this.element.style.position = 'absolute';\r\n this.element.style.width = '24px';\r\n this.element.style.height = '24px';\r\n this.element.style.fontSize = '20px';\r\n this.element.style.display = 'flex';\r\n this.element.style.alignItems = 'center';\r\n this.element.style.justifyContent = 'center';\r\n this.element.style.pointerEvents = 'auto'; // Allow interaction\r\n this.element.style.cursor = 'grab';\r\n this.element.style.zIndex = '2147483646';\r\n \r\n // Dragging Logic\r\n let isDragging = false;\r\n this.element.addEventListener('mousedown', () => {\r\n isDragging = true;\r\n this.element.style.cursor = 'grabbing';\r\n Body.setStatic(this.body, true);\r\n });\r\n\r\n window.addEventListener('mousemove', (e) => {\r\n if (!isDragging) return;\r\n Body.setPosition(this.body, { x: e.clientX, y: e.clientY });\r\n });\r\n\r\n window.addEventListener('mouseup', () => {\r\n if (!isDragging) return;\r\n isDragging = false;\r\n this.element.style.cursor = 'grab';\r\n Body.setStatic(this.body, false);\r\n // Give it a little toss\r\n Body.setVelocity(this.body, { x: (Math.random() - 0.5) * 10, y: -5 });\r\n });\r\n\r\n container.appendChild(this.element);\r\n }\r\n\r\n update() {\r\n const { x, y } = this.body.position;\r\n this.element.style.transform = `translate(${x - 12}px, ${y - 12}px) rotate(${this.body.angle}rad)`;\r\n }\r\n}\r\n","export class Poop {\r\n private element: HTMLDivElement;\r\n private container: HTMLElement;\r\n\r\n constructor(container: HTMLElement, x: number, y: number) {\r\n this.container = container;\r\n this.element = document.createElement('div');\r\n this.element.innerHTML = '💩';\r\n this.element.style.position = 'absolute';\r\n this.element.style.left = `${x}px`;\r\n this.element.style.top = `${y}px`;\r\n this.element.style.fontSize = '12px';\r\n this.element.style.pointerEvents = 'none';\r\n this.element.style.zIndex = '2147483646';\r\n \r\n // Smell animation\r\n const smell = document.createElement('div');\r\n smell.innerHTML = '〰️';\r\n smell.style.position = 'absolute';\r\n smell.style.top = '-10px';\r\n smell.style.left = '0';\r\n smell.style.fontSize = '8px';\r\n smell.style.opacity = '0.5';\r\n smell.className = 'kitty-poop-smell';\r\n this.element.appendChild(smell);\r\n\r\n this.container.appendChild(this.element);\r\n\r\n // Auto-remove after 30 seconds\r\n setTimeout(() => {\r\n this.element.style.transition = 'opacity 2s';\r\n this.element.style.opacity = '0';\r\n setTimeout(() => {\r\n if (this.element.parentNode) this.container.removeChild(this.element);\r\n }, 2000);\r\n }, 30000);\r\n }\r\n}\r\n","export interface Step {\r\n x: number;\r\n y: number;\r\n t: number;\r\n opacity: number;\r\n}\r\n\r\nexport class Footsteps {\r\n private steps: Step[] = [];\r\n private container: HTMLElement;\r\n private maxSteps = 50;\r\n\r\n constructor(container: HTMLElement) {\r\n this.container = container;\r\n }\r\n\r\n addStep(x: number, y: number) {\r\n const step: Step = { x, y, t: Date.now(), opacity: 0.4 };\r\n this.steps.push(step);\r\n \r\n const el = document.createElement('div');\r\n el.style.position = 'absolute';\r\n el.style.left = `${x}px`;\r\n el.style.top = `${y}px`;\r\n el.style.width = '4px';\r\n el.style.height = '4px';\r\n el.style.background = 'rgba(0,0,0,0.1)';\r\n el.style.borderRadius = '50%';\r\n el.style.pointerEvents = 'none';\r\n this.container.appendChild(el);\r\n\r\n if (this.steps.length > this.maxSteps) {\r\n this.steps.shift();\r\n const firstChild = this.container.firstChild;\r\n if (firstChild) this.container.removeChild(firstChild);\r\n }\r\n\r\n // Fade effect logic would be handled in update if we wanted high precision\r\n // For simplicity, we can use CSS animations or simple timeout\r\n setTimeout(() => {\r\n if (el.parentNode) el.style.opacity = '0';\r\n setTimeout(() => {\r\n if (el.parentNode) this.container.removeChild(el);\r\n }, 1000);\r\n }, 2000);\r\n }\r\n}\r\n","function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/*!\n * GSAP 3.14.2\n * https://gsap.com\n *\n * @license Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nvar _config = {\n autoSleep: 120,\n force3D: \"auto\",\n nullTargetWarn: 1,\n units: {\n lineHeight: \"\"\n }\n},\n _defaults = {\n duration: .5,\n overwrite: false,\n delay: 0\n},\n _suppressOverwrites,\n _reverting,\n _context,\n _bigNum = 1e8,\n _tinyNum = 1 / _bigNum,\n _2PI = Math.PI * 2,\n _HALF_PI = _2PI / 4,\n _gsID = 0,\n _sqrt = Math.sqrt,\n _cos = Math.cos,\n _sin = Math.sin,\n _isString = function _isString(value) {\n return typeof value === \"string\";\n},\n _isFunction = function _isFunction(value) {\n return typeof value === \"function\";\n},\n _isNumber = function _isNumber(value) {\n return typeof value === \"number\";\n},\n _isUndefined = function _isUndefined(value) {\n return typeof value === \"undefined\";\n},\n _isObject = function _isObject(value) {\n return typeof value === \"object\";\n},\n _isNotFalse = function _isNotFalse(value) {\n return value !== false;\n},\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _isFuncOrString = function _isFuncOrString(value) {\n return _isFunction(value) || _isString(value);\n},\n _isTypedArray = typeof ArrayBuffer === \"function\" && ArrayBuffer.isView || function () {},\n // note: IE10 has ArrayBuffer, but NOT ArrayBuffer.isView().\n_isArray = Array.isArray,\n _randomExp = /random\\([^)]+\\)/g,\n _commaDelimExp = /,\\s*/g,\n _strictNumExp = /(?:-?\\.?\\d|\\.)+/gi,\n //only numbers (including negatives and decimals) but NOT relative values.\n_numExp = /[-+=.]*\\d+[.e\\-+]*\\d*[e\\-+]*\\d*/g,\n //finds any numbers, including ones that start with += or -=, negative numbers, and ones in scientific notation like 1e-8.\n_numWithUnitExp = /[-+=.]*\\d+[.e-]*\\d*[a-z%]*/g,\n _complexStringNumExp = /[-+=.]*\\d+\\.?\\d*(?:e-|e\\+)?\\d*/gi,\n //duplicate so that while we're looping through matches from exec(), it doesn't contaminate the lastIndex of _numExp which we use to search for colors too.\n_relExp = /[+-]=-?[.\\d]+/,\n _delimitedValueExp = /[^,'\"\\[\\]\\s]+/gi,\n // previously /[#\\-+.]*\\b[a-z\\d\\-=+%.]+/gi but didn't catch special characters.\n_unitExp = /^[+\\-=e\\s\\d]*\\d+[.\\d]*([a-z]*|%)\\s*$/i,\n _globalTimeline,\n _win,\n _coreInitted,\n _doc,\n _globals = {},\n _installScope = {},\n _coreReady,\n _install = function _install(scope) {\n return (_installScope = _merge(scope, _globals)) && gsap;\n},\n _missingPlugin = function _missingPlugin(property, value) {\n return console.warn(\"Invalid property\", property, \"set to\", value, \"Missing plugin? gsap.registerPlugin()\");\n},\n _warn = function _warn(message, suppress) {\n return !suppress && console.warn(message);\n},\n _addGlobal = function _addGlobal(name, obj) {\n return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;\n},\n _emptyFunc = function _emptyFunc() {\n return 0;\n},\n _startAtRevertConfig = {\n suppressEvents: true,\n isStart: true,\n kill: false\n},\n _revertConfigNoKill = {\n suppressEvents: true,\n kill: false\n},\n _revertConfig = {\n suppressEvents: true\n},\n _reservedProps = {},\n _lazyTweens = [],\n _lazyLookup = {},\n _lastRenderedFrame,\n _plugins = {},\n _effects = {},\n _nextGCFrame = 30,\n _harnessPlugins = [],\n _callbackNames = \"\",\n _harness = function _harness(targets) {\n var target = targets[0],\n harnessPlugin,\n i;\n _isObject(target) || _isFunction(target) || (targets = [targets]);\n\n if (!(harnessPlugin = (target._gsap || {}).harness)) {\n // find the first target with a harness. We assume targets passed into an animation will be of similar type, meaning the same kind of harness can be used for them all (performance optimization)\n i = _harnessPlugins.length;\n\n while (i-- && !_harnessPlugins[i].targetTest(target)) {}\n\n harnessPlugin = _harnessPlugins[i];\n }\n\n i = targets.length;\n\n while (i--) {\n targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);\n }\n\n return targets;\n},\n _getCache = function _getCache(target) {\n return target._gsap || _harness(toArray(target))[0]._gsap;\n},\n _getProperty = function _getProperty(target, property, v) {\n return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;\n},\n _forEachName = function _forEachName(names, func) {\n return (names = names.split(\",\")).forEach(func) || names;\n},\n //split a comma-delimited list of names into an array, then run a forEach() function and return the split array (this is just a way to consolidate/shorten some code).\n_round = function _round(value) {\n return Math.round(value * 100000) / 100000 || 0;\n},\n _roundPrecise = function _roundPrecise(value) {\n return Math.round(value * 10000000) / 10000000 || 0;\n},\n // increased precision mostly for timing values.\n_parseRelative = function _parseRelative(start, value) {\n var operator = value.charAt(0),\n end = parseFloat(value.substr(2));\n start = parseFloat(start);\n return operator === \"+\" ? start + end : operator === \"-\" ? start - end : operator === \"*\" ? start * end : start / end;\n},\n _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) {\n //searches one array to find matches for any of the items in the toFind array. As soon as one is found, it returns true. It does NOT return all the matches; it's simply a boolean search.\n var l = toFind.length,\n i = 0;\n\n for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {}\n\n return i < l;\n},\n _lazyRender = function _lazyRender() {\n var l = _lazyTweens.length,\n a = _lazyTweens.slice(0),\n i,\n tween;\n\n _lazyLookup = {};\n _lazyTweens.length = 0;\n\n for (i = 0; i < l; i++) {\n tween = a[i];\n tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);\n }\n},\n _isRevertWorthy = function _isRevertWorthy(animation) {\n return !!(animation._initted || animation._startAt || animation.add);\n},\n _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) {\n _lazyTweens.length && !_reverting && _lazyRender();\n animation.render(time, suppressEvents, force || !!(_reverting && time < 0 && _isRevertWorthy(animation)));\n _lazyTweens.length && !_reverting && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n},\n _numericIfPossible = function _numericIfPossible(value) {\n var n = parseFloat(value);\n return (n || n === 0) && (value + \"\").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;\n},\n _passThrough = function _passThrough(p) {\n return p;\n},\n _setDefaults = function _setDefaults(obj, defaults) {\n for (var p in defaults) {\n p in obj || (obj[p] = defaults[p]);\n }\n\n return obj;\n},\n _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) {\n return function (obj, defaults) {\n for (var p in defaults) {\n p in obj || p === \"duration\" && excludeDuration || p === \"ease\" || (obj[p] = defaults[p]);\n }\n };\n},\n _merge = function _merge(base, toMerge) {\n for (var p in toMerge) {\n base[p] = toMerge[p];\n }\n\n return base;\n},\n _mergeDeep = function _mergeDeep(base, toMerge) {\n for (var p in toMerge) {\n p !== \"__proto__\" && p !== \"constructor\" && p !== \"prototype\" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);\n }\n\n return base;\n},\n _copyExcluding = function _copyExcluding(obj, excluding) {\n var copy = {},\n p;\n\n for (p in obj) {\n p in excluding || (copy[p] = obj[p]);\n }\n\n return copy;\n},\n _inheritDefaults = function _inheritDefaults(vars) {\n var parent = vars.parent || _globalTimeline,\n func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;\n\n if (_isNotFalse(vars.inherit)) {\n while (parent) {\n func(vars, parent.vars.defaults);\n parent = parent.parent || parent._dp;\n }\n }\n\n return vars;\n},\n _arraysMatch = function _arraysMatch(a1, a2) {\n var i = a1.length,\n match = i === a2.length;\n\n while (match && i-- && a1[i] === a2[i]) {}\n\n return i < 0;\n},\n _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = parent[lastProp],\n t;\n\n if (sortBy) {\n t = child[sortBy];\n\n while (prev && prev[sortBy] > t) {\n prev = prev._prev;\n }\n }\n\n if (prev) {\n child._next = prev._next;\n prev._next = child;\n } else {\n child._next = parent[firstProp];\n parent[firstProp] = child;\n }\n\n if (child._next) {\n child._next._prev = child;\n } else {\n parent[lastProp] = child;\n }\n\n child._prev = prev;\n child.parent = child._dp = parent;\n return child;\n},\n _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) {\n if (firstProp === void 0) {\n firstProp = \"_first\";\n }\n\n if (lastProp === void 0) {\n lastProp = \"_last\";\n }\n\n var prev = child._prev,\n next = child._next;\n\n if (prev) {\n prev._next = next;\n } else if (parent[firstProp] === child) {\n parent[firstProp] = next;\n }\n\n if (next) {\n next._prev = prev;\n } else if (parent[lastProp] === child) {\n parent[lastProp] = prev;\n }\n\n child._next = child._prev = child.parent = null; // don't delete the _dp just so we can revert if necessary. But parent should be null to indicate the item isn't in a linked list.\n},\n _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) {\n child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child);\n child._act = 0;\n},\n _uncache = function _uncache(animation, child) {\n if (animation && (!child || child._end > animation._dur || child._start < 0)) {\n // performance optimization: if a child animation is passed in we should only uncache if that child EXTENDS the animation (its end time is beyond the end)\n var a = animation;\n\n while (a) {\n a._dirty = 1;\n a = a.parent;\n }\n }\n\n return animation;\n},\n _recacheAncestors = function _recacheAncestors(animation) {\n var parent = animation.parent;\n\n while (parent && parent.parent) {\n //sometimes we must force a re-sort of all children and update the duration/totalDuration of all ancestor timelines immediately in case, for example, in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.\n parent._dirty = 1;\n parent.totalDuration();\n parent = parent.parent;\n }\n\n return animation;\n},\n _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) {\n return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));\n},\n _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) {\n return !animation || animation._ts && _hasNoPausedAncestors(animation.parent);\n},\n _elapsedCycleDuration = function _elapsedCycleDuration(animation) {\n return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;\n},\n // feed in the totalTime and cycleDuration and it'll return the cycle (iteration minus 1) and if the playhead is exactly at the very END, it will NOT bump up to the next cycle.\n_animationCycle = function _animationCycle(tTime, cycleDuration) {\n var whole = Math.floor(tTime = _roundPrecise(tTime / cycleDuration));\n return tTime && whole === tTime ? whole - 1 : whole;\n},\n _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) {\n return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);\n},\n _setEnd = function _setEnd(animation) {\n return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));\n},\n _alignPlayhead = function _alignPlayhead(animation, totalTime) {\n // adjusts the animation's _start and _end according to the provided totalTime (only if the parent's smoothChildTiming is true and the animation isn't paused). It doesn't do any rendering or forcing things back into parent timelines, etc. - that's what totalTime() is for.\n var parent = animation._dp;\n\n if (parent && parent.smoothChildTiming && animation._ts) {\n animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));\n\n _setEnd(animation);\n\n parent._dirty || _uncache(parent, animation); //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n }\n\n return animation;\n},\n\n/*\n_totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {\n\tlet cycleDuration = duration + repeatDelay,\n\t\ttime = _round(clampedTotalTime % cycleDuration);\n\tif (time > duration) {\n\t\ttime = duration;\n\t}\n\treturn (yoyo && (~~(clampedTotalTime / cycleDuration) & 1)) ? duration - time : time;\n},\n*/\n_postAddChecks = function _postAddChecks(timeline, child) {\n var t;\n\n if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) {\n // in case, for example, the _start is moved on a tween that has already rendered, or if it's being inserted into a timeline BEFORE where the playhead is currently. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. Special case: if it's a timeline (has .add() method) and no duration, we can skip rendering because the user may be populating it AFTER adding it to a parent timeline (unconventional, but possible, and we wouldn't want it to get removed if the parent's autoRemoveChildren is true).\n t = _parentToChildTotalTime(timeline.rawTime(), child);\n\n if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {\n child.render(t, true);\n }\n } //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.\n\n\n if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) {\n //in case any of the ancestors had completed but should now be enabled...\n if (timeline._dur < timeline.duration()) {\n t = timeline;\n\n while (t._dp) {\n t.rawTime() >= 0 && t.totalTime(t._tTime); //moves the timeline (shifts its startTime) if necessary, and also enables it. If it's currently zero, though, it may not be scheduled to render until later so there's no need to force it to align with the current playhead position. Only move to catch up with the playhead.\n\n t = t._dp;\n }\n }\n\n timeline._zTime = -_tinyNum; // helps ensure that the next render() will be forced (crossingStart = true in render()), even if the duration hasn't changed (we're adding a child which would need to get rendered). Definitely an edge case. Note: we MUST do this AFTER the loop above where the totalTime() might trigger a render() because this _addToTimeline() method gets called from the Animation constructor, BEFORE tweens even record their targets, etc. so we wouldn't want things to get triggered in the wrong order.\n }\n},\n _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) {\n child.parent && _removeFromParent(child);\n child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay);\n child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));\n\n _addLinkedListItem(timeline, child, \"_first\", \"_last\", timeline._sort ? \"_start\" : 0);\n\n _isFromOrFromStart(child) || (timeline._recent = child);\n skipChecks || _postAddChecks(timeline, child);\n timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); // if the timeline is reversed and the new child makes it longer, we may need to adjust the parent's _start (push it back)\n\n return timeline;\n},\n _scrollTrigger = function _scrollTrigger(animation, trigger) {\n return (_globals.ScrollTrigger || _missingPlugin(\"scrollTrigger\", trigger)) && _globals.ScrollTrigger.create(trigger, animation);\n},\n _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) {\n _initTween(tween, time, tTime);\n\n if (!tween._initted) {\n return 1;\n }\n\n if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {\n _lazyTweens.push(tween);\n\n tween._lazy = [tTime, suppressEvents];\n return 1;\n }\n},\n _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) {\n var parent = _ref.parent;\n return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent));\n},\n // check parent's _lock because when a timeline repeats/yoyos and does its artificial wrapping, we shouldn't force the ratio back to 0\n_isFromOrFromStart = function _isFromOrFromStart(_ref2) {\n var data = _ref2.data;\n return data === \"isFromStart\" || data === \"isStart\";\n},\n _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) {\n var prevRatio = tween.ratio,\n ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1,\n // if the tween or its parent is reversed and the totalTime is 0, we should go to a ratio of 0. Edge case: if a from() or fromTo() stagger tween is placed later in a timeline, the \"startAt\" zero-duration tween could initially render at a time when the parent timeline's playhead is technically BEFORE where this tween is, so make sure that any \"from\" and \"fromTo\" startAt tweens are rendered the first time at a ratio of 1.\n repeatDelay = tween._rDelay,\n tTime = 0,\n pt,\n iteration,\n prevIteration;\n\n if (repeatDelay && tween._repeat) {\n // in case there's a zero-duration tween that has a repeat with a repeatDelay\n tTime = _clamp(0, tween._tDur, totalTime);\n iteration = _animationCycle(tTime, repeatDelay);\n tween._yoyo && iteration & 1 && (ratio = 1 - ratio);\n\n if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {\n // if iteration changed\n prevRatio = 1 - ratio;\n tween.vars.repeatRefresh && tween._initted && tween.invalidate();\n }\n }\n\n if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {\n if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {\n // if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.\n return;\n }\n\n prevIteration = tween._zTime;\n tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); // when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n suppressEvents || (suppressEvents = totalTime && !prevIteration); // if it was rendered previously at exactly 0 (_zTime) and now the playhead is moving away, DON'T fire callbacks otherwise they'll seem like duplicates.\n\n tween.ratio = ratio;\n tween._from && (ratio = 1 - ratio);\n tween._time = 0;\n tween._tTime = tTime;\n pt = tween._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);\n tween._onUpdate && !suppressEvents && _callback(tween, \"onUpdate\");\n tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, \"onRepeat\");\n\n if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {\n ratio && _removeFromParent(tween, 1);\n\n if (!suppressEvents && !_reverting) {\n _callback(tween, ratio ? \"onComplete\" : \"onReverseComplete\", true);\n\n tween._prom && tween._prom();\n }\n }\n } else if (!tween._zTime) {\n tween._zTime = totalTime;\n }\n},\n _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) {\n var child;\n\n if (time > prevTime) {\n child = animation._first;\n\n while (child && child._start <= time) {\n if (child.data === \"isPause\" && child._start > prevTime) {\n return child;\n }\n\n child = child._next;\n }\n } else {\n child = animation._last;\n\n while (child && child._start >= time) {\n if (child.data === \"isPause\" && child._start < prevTime) {\n return child;\n }\n\n child = child._prev;\n }\n }\n},\n _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) {\n var repeat = animation._repeat,\n dur = _roundPrecise(duration) || 0,\n totalProgress = animation._tTime / animation._tDur;\n totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);\n animation._dur = dur;\n animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);\n totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);\n animation.parent && _setEnd(animation);\n skipUncache || _uncache(animation.parent, animation);\n return animation;\n},\n _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) {\n return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);\n},\n _zeroPosition = {\n _start: 0,\n endTime: _emptyFunc,\n totalDuration: _emptyFunc\n},\n _parsePosition = function _parsePosition(animation, position, percentAnimation) {\n var labels = animation.labels,\n recent = animation._recent || _zeroPosition,\n clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur,\n //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.\n i,\n offset,\n isPercent;\n\n if (_isString(position) && (isNaN(position) || position in labels)) {\n //if the string is a number like \"1\", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).\n offset = position.charAt(0);\n isPercent = position.substr(-1) === \"%\";\n i = position.indexOf(\"=\");\n\n if (offset === \"<\" || offset === \">\") {\n i >= 0 && (position = position.replace(/=/, \"\"));\n return (offset === \"<\" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);\n }\n\n if (i < 0) {\n position in labels || (labels[position] = clippedDuration);\n return labels[position];\n }\n\n offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));\n\n if (isPercent && percentAnimation) {\n offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();\n }\n\n return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;\n }\n\n return position == null ? clippedDuration : +position;\n},\n _createTweenType = function _createTweenType(type, params, timeline) {\n var isLegacy = _isNumber(params[1]),\n varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1),\n vars = params[varsIndex],\n irVars,\n parent;\n\n isLegacy && (vars.duration = params[1]);\n vars.parent = timeline;\n\n if (type) {\n irVars = vars;\n parent = timeline;\n\n while (parent && !(\"immediateRender\" in irVars)) {\n // inheritance hasn't happened yet, but someone may have set a default in an ancestor timeline. We could do vars.immediateRender = _isNotFalse(_inheritDefaults(vars).immediateRender) but that'd exact a slight performance penalty because _inheritDefaults() also runs in the Tween constructor. We're paying a small kb price here to gain speed.\n irVars = parent.vars.defaults || {};\n parent = _isNotFalse(parent.vars.inherit) && parent.parent;\n }\n\n vars.immediateRender = _isNotFalse(irVars.immediateRender);\n type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; // \"from\" vars\n }\n\n return new Tween(params[0], vars, params[varsIndex + 1]);\n},\n _conditionalReturn = function _conditionalReturn(value, func) {\n return value || value === 0 ? func(value) : func;\n},\n _clamp = function _clamp(min, max, value) {\n return value < min ? min : value > max ? max : value;\n},\n getUnit = function getUnit(value, v) {\n return !_isString(value) || !(v = _unitExp.exec(value)) ? \"\" : v[1];\n},\n // note: protect against padded numbers as strings, like \"100.100\". That shouldn't return \"00\" as the unit. If it's numeric, return no unit.\nclamp = function clamp(min, max, value) {\n return _conditionalReturn(value, function (v) {\n return _clamp(min, max, v);\n });\n},\n _slice = [].slice,\n _isArrayLike = function _isArrayLike(value, nonEmpty) {\n return value && _isObject(value) && \"length\" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;\n},\n _flatten = function _flatten(ar, leaveStrings, accumulator) {\n if (accumulator === void 0) {\n accumulator = [];\n }\n\n return ar.forEach(function (value) {\n var _accumulator;\n\n return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);\n }) || accumulator;\n},\n // takes any value and returns an Array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.\ntoArray = function toArray(value, scope, leaveStrings) {\n return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];\n},\n selector = function selector(value) {\n value = toArray(value)[0] || _warn(\"Invalid scope\") || {};\n return function (v) {\n var el = value.current || value.nativeElement || value;\n return toArray(v, el.querySelectorAll ? el : el === value ? _warn(\"Invalid scope\") || _doc.createElement(\"div\") : value);\n };\n},\n shuffle = function shuffle(a) {\n return a.sort(function () {\n return .5 - Math.random();\n });\n},\n // alternative that's a bit faster and more reliably diverse but bigger: for (let j, v, i = a.length; i; j = (Math.random() * i) | 0, v = a[--i], a[i] = a[j], a[j] = v); return a;\n// for distributing values across an Array. Can accept a number, a function or (most commonly) an object which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array.\ndistribute = function distribute(v) {\n if (_isFunction(v)) {\n return v;\n }\n\n var vars = _isObject(v) ? v : {\n each: v\n },\n //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total \"amount\" that's chunked out among them all.\n ease = _parseEase(vars.ease),\n from = vars.from || 0,\n base = parseFloat(vars.base) || 0,\n cache = {},\n isDecimal = from > 0 && from < 1,\n ratios = isNaN(from) || isDecimal,\n axis = vars.axis,\n ratioX = from,\n ratioY = from;\n\n if (_isString(from)) {\n ratioX = ratioY = {\n center: .5,\n edges: .5,\n end: 1\n }[from] || 0;\n } else if (!isDecimal && ratios) {\n ratioX = from[0];\n ratioY = from[1];\n }\n\n return function (i, target, a) {\n var l = (a || vars).length,\n distances = cache[l],\n originX,\n originY,\n x,\n y,\n d,\n j,\n max,\n min,\n wrapAt;\n\n if (!distances) {\n wrapAt = vars.grid === \"auto\" ? 0 : (vars.grid || [1, _bigNum])[1];\n\n if (!wrapAt) {\n max = -_bigNum;\n\n while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {}\n\n wrapAt < l && wrapAt--;\n }\n\n distances = cache[l] = [];\n originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt;\n originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0;\n max = 0;\n min = _bigNum;\n\n for (j = 0; j < l; j++) {\n x = j % wrapAt - originX;\n y = originY - (j / wrapAt | 0);\n distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === \"y\" ? y : x);\n d > max && (max = d);\n d < min && (min = d);\n }\n\n from === \"random\" && shuffle(distances);\n distances.max = max - min;\n distances.min = min;\n distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === \"y\" ? l / wrapAt : wrapAt) || 0) * (from === \"edges\" ? -1 : 1);\n distances.b = l < 0 ? base - l : base;\n distances.u = getUnit(vars.amount || vars.each) || 0; //unit\n\n ease = ease && l < 0 ? _invertEase(ease) : ease;\n }\n\n l = (distances[i] - distances.min) / distances.max || 0;\n return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; //round in order to work around floating point errors\n };\n},\n _roundModifier = function _roundModifier(v) {\n //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.\n var p = Math.pow(10, ((v + \"\").split(\".\")[1] || \"\").length); //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed())\n\n return function (raw) {\n var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);\n\n return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); // n - n % 1 replaces Math.floor() in order to handle negative values properly. For example, Math.floor(-150.00000000000003) is 151!\n };\n},\n snap = function snap(snapTo, value) {\n var isArray = _isArray(snapTo),\n radius,\n is2D;\n\n if (!isArray && _isObject(snapTo)) {\n radius = isArray = snapTo.radius || _bigNum;\n\n if (snapTo.values) {\n snapTo = toArray(snapTo.values);\n\n if (is2D = !_isNumber(snapTo[0])) {\n radius *= radius; //performance optimization so we don't have to Math.sqrt() in the loop.\n }\n } else {\n snapTo = _roundModifier(snapTo.increment);\n }\n }\n\n return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) {\n is2D = snapTo(raw);\n return Math.abs(is2D - raw) <= radius ? is2D : raw;\n } : function (raw) {\n var x = parseFloat(is2D ? raw.x : raw),\n y = parseFloat(is2D ? raw.y : 0),\n min = _bigNum,\n closest = 0,\n i = snapTo.length,\n dx,\n dy;\n\n while (i--) {\n if (is2D) {\n dx = snapTo[i].x - x;\n dy = snapTo[i].y - y;\n dx = dx * dx + dy * dy;\n } else {\n dx = Math.abs(snapTo[i] - x);\n }\n\n if (dx < min) {\n min = dx;\n closest = i;\n }\n }\n\n closest = !radius || min <= radius ? snapTo[closest] : raw;\n return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);\n });\n},\n random = function random(min, max, roundingIncrement, returnFunction) {\n return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () {\n return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + \"\").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;\n });\n},\n pipe = function pipe() {\n for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n\n return function (value) {\n return functions.reduce(function (v, f) {\n return f(v);\n }, value);\n };\n},\n unitize = function unitize(func, unit) {\n return function (value) {\n return func(parseFloat(value)) + (unit || getUnit(value));\n };\n},\n normalize = function normalize(min, max, value) {\n return mapRange(min, max, 0, 1, value);\n},\n _wrapArray = function _wrapArray(a, wrapper, value) {\n return _conditionalReturn(value, function (index) {\n return a[~~wrapper(index)];\n });\n},\n wrap = function wrap(min, max, value) {\n // NOTE: wrap() CANNOT be an arrow function! A very odd compiling bug causes problems (unrelated to GSAP).\n var range = max - min;\n return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) {\n return (range + (value - min) % range) % range + min;\n });\n},\n wrapYoyo = function wrapYoyo(min, max, value) {\n var range = max - min,\n total = range * 2;\n return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) {\n value = (total + (value - min) % total) % total || 0;\n return min + (value > range ? total - value : value);\n });\n},\n _replaceRandom = function _replaceRandom(s) {\n return s.replace(_randomExp, function (match) {\n //replaces all occurrences of random(...) in a string with the calculated random value. can be a range like random(-100, 100, 5) or an array like random([0, 100, 500])\n var arIndex = match.indexOf(\"[\") + 1,\n values = match.substring(arIndex || 7, arIndex ? match.indexOf(\"]\") : match.length - 1).split(_commaDelimExp);\n return random(arIndex ? values : +values[0], arIndex ? 0 : +values[1], +values[2] || 1e-5);\n });\n},\n mapRange = function mapRange(inMin, inMax, outMin, outMax, value) {\n var inRange = inMax - inMin,\n outRange = outMax - outMin;\n return _conditionalReturn(value, function (value) {\n return outMin + ((value - inMin) / inRange * outRange || 0);\n });\n},\n interpolate = function interpolate(start, end, progress, mutate) {\n var func = isNaN(start + end) ? 0 : function (p) {\n return (1 - p) * start + p * end;\n };\n\n if (!func) {\n var isString = _isString(start),\n master = {},\n p,\n i,\n interpolators,\n l,\n il;\n\n progress === true && (mutate = 1) && (progress = null);\n\n if (isString) {\n start = {\n p: start\n };\n end = {\n p: end\n };\n } else if (_isArray(start) && !_isArray(end)) {\n interpolators = [];\n l = start.length;\n il = l - 2;\n\n for (i = 1; i < l; i++) {\n interpolators.push(interpolate(start[i - 1], start[i])); //build the interpolators up front as a performance optimization so that when the function is called many times, it can just reuse them.\n }\n\n l--;\n\n func = function func(p) {\n p *= l;\n var i = Math.min(il, ~~p);\n return interpolators[i](p - i);\n };\n\n progress = end;\n } else if (!mutate) {\n start = _merge(_isArray(start) ? [] : {}, start);\n }\n\n if (!interpolators) {\n for (p in end) {\n _addPropTween.call(master, start, p, \"get\", end[p]);\n }\n\n func = function func(p) {\n return _renderPropTweens(p, master) || (isString ? start.p : start);\n };\n }\n }\n\n return _conditionalReturn(progress, func);\n},\n _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) {\n //used for nextLabel() and previousLabel()\n var labels = timeline.labels,\n min = _bigNum,\n p,\n distance,\n label;\n\n for (p in labels) {\n distance = labels[p] - fromTime;\n\n if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {\n label = p;\n min = distance;\n }\n }\n\n return label;\n},\n _callback = function _callback(animation, type, executeLazyFirst) {\n var v = animation.vars,\n callback = v[type],\n prevContext = _context,\n context = animation._ctx,\n params,\n scope,\n result;\n\n if (!callback) {\n return;\n }\n\n params = v[type + \"Params\"];\n scope = v.callbackScope || animation;\n executeLazyFirst && _lazyTweens.length && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.\n\n context && (_context = context);\n result = params ? callback.apply(scope, params) : callback.call(scope);\n _context = prevContext;\n return result;\n},\n _interrupt = function _interrupt(animation) {\n _removeFromParent(animation);\n\n animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);\n animation.progress() < 1 && _callback(animation, \"onInterrupt\");\n return animation;\n},\n _quickTween,\n _registerPluginQueue = [],\n _createPlugin = function _createPlugin(config) {\n if (!config) return;\n config = !config.name && config[\"default\"] || config; // UMD packaging wraps things oddly, so for example MotionPathHelper becomes {MotionPathHelper:MotionPathHelper, default:MotionPathHelper}.\n\n if (_windowExists() || config.headless) {\n // edge case: some build tools may pass in a null/undefined value\n var name = config.name,\n isFunc = _isFunction(config),\n Plugin = name && !isFunc && config.init ? function () {\n this._props = [];\n } : config,\n //in case someone passes in an object that's not a plugin, like CustomEase\n instanceDefaults = {\n init: _emptyFunc,\n render: _renderPropTweens,\n add: _addPropTween,\n kill: _killPropTweensOf,\n modifier: _addPluginModifier,\n rawVars: 0\n },\n statics = {\n targetTest: 0,\n get: 0,\n getSetter: _getSetter,\n aliases: {},\n register: 0\n };\n\n _wake();\n\n if (config !== Plugin) {\n if (_plugins[name]) {\n return;\n }\n\n _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); //static methods\n\n\n _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); //instance methods\n\n\n _plugins[Plugin.prop = name] = Plugin;\n\n if (config.targetTest) {\n _harnessPlugins.push(Plugin);\n\n _reservedProps[name] = 1;\n }\n\n name = (name === \"css\" ? \"CSS\" : name.charAt(0).toUpperCase() + name.substr(1)) + \"Plugin\"; //for the global name. \"motionPath\" should become MotionPathPlugin\n }\n\n _addGlobal(name, Plugin);\n\n config.register && config.register(gsap, Plugin, PropTween);\n } else {\n _registerPluginQueue.push(config);\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * COLORS\n * --------------------------------------------------------------------------------------\n */\n_255 = 255,\n _colorLookup = {\n aqua: [0, _255, _255],\n lime: [0, _255, 0],\n silver: [192, 192, 192],\n black: [0, 0, 0],\n maroon: [128, 0, 0],\n teal: [0, 128, 128],\n blue: [0, 0, _255],\n navy: [0, 0, 128],\n white: [_255, _255, _255],\n olive: [128, 128, 0],\n yellow: [_255, _255, 0],\n orange: [_255, 165, 0],\n gray: [128, 128, 128],\n purple: [128, 0, 128],\n green: [0, 128, 0],\n red: [_255, 0, 0],\n pink: [_255, 192, 203],\n cyan: [0, _255, _255],\n transparent: [_255, _255, _255, 0]\n},\n // possible future idea to replace the hard-coded color name values - put this in the ticker.wake() where we set the _doc:\n// let ctx = _doc.createElement(\"canvas\").getContext(\"2d\");\n// _forEachName(\"aqua,lime,silver,black,maroon,teal,blue,navy,white,olive,yellow,orange,gray,purple,green,red,pink,cyan\", color => {ctx.fillStyle = color; _colorLookup[color] = splitColor(ctx.fillStyle)});\n_hue = function _hue(h, m1, m2) {\n h += h < 0 ? 1 : h > 1 ? -1 : 0;\n return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0;\n},\n splitColor = function splitColor(v, toHSL, forceAlpha) {\n var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0,\n r,\n g,\n b,\n h,\n s,\n l,\n max,\n min,\n d,\n wasHSL;\n\n if (!a) {\n if (v.substr(-1) === \",\") {\n //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:\"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)\" - in this example \"blue,\" has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.\n v = v.substr(0, v.length - 1);\n }\n\n if (_colorLookup[v]) {\n a = _colorLookup[v];\n } else if (v.charAt(0) === \"#\") {\n if (v.length < 6) {\n //for shorthand like #9F0 or #9F0F (could have alpha)\n r = v.charAt(1);\n g = v.charAt(2);\n b = v.charAt(3);\n v = \"#\" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : \"\");\n }\n\n if (v.length === 9) {\n // hex with alpha, like #fd5e53ff\n a = parseInt(v.substr(1, 6), 16);\n return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];\n }\n\n v = parseInt(v.substr(1), 16);\n a = [v >> 16, v >> 8 & _255, v & _255];\n } else if (v.substr(0, 3) === \"hsl\") {\n a = wasHSL = v.match(_strictNumExp);\n\n if (!toHSL) {\n h = +a[0] % 360 / 360;\n s = +a[1] / 100;\n l = +a[2] / 100;\n g = l <= .5 ? l * (s + 1) : l + s - l * s;\n r = l * 2 - g;\n a.length > 3 && (a[3] *= 1); //cast as number\n\n a[0] = _hue(h + 1 / 3, r, g);\n a[1] = _hue(h, r, g);\n a[2] = _hue(h - 1 / 3, r, g);\n } else if (~v.indexOf(\"=\")) {\n //if relative values are found, just return the raw strings with the relative prefixes in place.\n a = v.match(_numExp);\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n }\n } else {\n a = v.match(_strictNumExp) || _colorLookup.transparent;\n }\n\n a = a.map(Number);\n }\n\n if (toHSL && !wasHSL) {\n r = a[0] / _255;\n g = a[1] / _255;\n b = a[2] / _255;\n max = Math.max(r, g, b);\n min = Math.min(r, g, b);\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;\n h *= 60;\n }\n\n a[0] = ~~(h + .5);\n a[1] = ~~(s * 100 + .5);\n a[2] = ~~(l * 100 + .5);\n }\n\n forceAlpha && a.length < 4 && (a[3] = 1);\n return a;\n},\n _colorOrderData = function _colorOrderData(v) {\n // strips out the colors from the string, finds all the numeric slots (with units) and returns an array of those. The Array also has a \"c\" property which is an Array of the index values where the colors belong. This is to help work around issues where there's a mis-matched order of color/numeric data like drop-shadow(#f00 0px 1px 2px) and drop-shadow(0x 1px 2px #f00). This is basically a helper function used in _formatColors()\n var values = [],\n c = [],\n i = -1;\n v.split(_colorExp).forEach(function (v) {\n var a = v.match(_numWithUnitExp) || [];\n values.push.apply(values, a);\n c.push(i += a.length + 1);\n });\n values.c = c;\n return values;\n},\n _formatColors = function _formatColors(s, toHSL, orderMatchData) {\n var result = \"\",\n colors = (s + result).match(_colorExp),\n type = toHSL ? \"hsla(\" : \"rgba(\",\n i = 0,\n c,\n shell,\n d,\n l;\n\n if (!colors) {\n return s;\n }\n\n colors = colors.map(function (color) {\n return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + \",\" + color[1] + \"%,\" + color[2] + \"%,\" + color[3] : color.join(\",\")) + \")\";\n });\n\n if (orderMatchData) {\n d = _colorOrderData(s);\n c = orderMatchData.c;\n\n if (c.join(result) !== d.c.join(result)) {\n shell = s.replace(_colorExp, \"1\").split(_numWithUnitExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + \"0,0,0,0)\" : (d.length ? d : colors.length ? colors : orderMatchData).shift());\n }\n }\n }\n\n if (!shell) {\n shell = s.split(_colorExp);\n l = shell.length - 1;\n\n for (; i < l; i++) {\n result += shell[i] + colors[i];\n }\n }\n\n return result + shell[l];\n},\n _colorExp = function () {\n var s = \"(?:\\\\b(?:(?:rgb|rgba|hsl|hsla)\\\\(.+?\\\\))|\\\\B#(?:[0-9a-f]{3,4}){1,2}\\\\b\",\n //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.,\n p;\n\n for (p in _colorLookup) {\n s += \"|\" + p + \"\\\\b\";\n }\n\n return new RegExp(s + \")\", \"gi\");\n}(),\n _hslExp = /hsl[a]?\\(/,\n _colorStringFilter = function _colorStringFilter(a) {\n var combined = a.join(\" \"),\n toHSL;\n _colorExp.lastIndex = 0;\n\n if (_colorExp.test(combined)) {\n toHSL = _hslExp.test(combined);\n a[1] = _formatColors(a[1], toHSL);\n a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); // make sure the order of numbers/colors match with the END value.\n\n return true;\n }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TICKER\n * --------------------------------------------------------------------------------------\n */\n_tickerActive,\n _ticker = function () {\n var _getTime = Date.now,\n _lagThreshold = 500,\n _adjustedLag = 33,\n _startTime = _getTime(),\n _lastUpdate = _startTime,\n _gap = 1000 / 240,\n _nextTime = _gap,\n _listeners = [],\n _id,\n _req,\n _raf,\n _self,\n _delta,\n _i,\n _tick = function _tick(v) {\n var elapsed = _getTime() - _lastUpdate,\n manual = v === true,\n overlap,\n dispatch,\n time,\n frame;\n\n (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);\n _lastUpdate += elapsed;\n time = _lastUpdate - _startTime;\n overlap = time - _nextTime;\n\n if (overlap > 0 || manual) {\n frame = ++_self.frame;\n _delta = time - _self.time * 1000;\n _self.time = time = time / 1000;\n _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);\n dispatch = 1;\n }\n\n manual || (_id = _req(_tick)); //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\n if (dispatch) {\n for (_i = 0; _i < _listeners.length; _i++) {\n // use _i and check _listeners.length instead of a variable because a listener could get removed during the loop, and if that happens to an element less than the current index, it'd throw things off in the loop.\n _listeners[_i](time, _delta, frame, v);\n }\n }\n };\n\n _self = {\n time: 0,\n frame: 0,\n tick: function tick() {\n _tick(true);\n },\n deltaRatio: function deltaRatio(fps) {\n return _delta / (1000 / (fps || 60));\n },\n wake: function wake() {\n if (_coreReady) {\n if (!_coreInitted && _windowExists()) {\n _win = _coreInitted = window;\n _doc = _win.document || {};\n _globals.gsap = gsap;\n (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);\n\n _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});\n\n _registerPluginQueue.forEach(_createPlugin);\n }\n\n _raf = typeof requestAnimationFrame !== \"undefined\" && requestAnimationFrame;\n _id && _self.sleep();\n\n _req = _raf || function (f) {\n return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0);\n };\n\n _tickerActive = 1;\n\n _tick(2);\n }\n },\n sleep: function sleep() {\n (_raf ? cancelAnimationFrame : clearTimeout)(_id);\n _tickerActive = 0;\n _req = _emptyFunc;\n },\n lagSmoothing: function lagSmoothing(threshold, adjustedLag) {\n _lagThreshold = threshold || Infinity; // zero should be interpreted as basically unlimited\n\n _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);\n },\n fps: function fps(_fps) {\n _gap = 1000 / (_fps || 240);\n _nextTime = _self.time * 1000 + _gap;\n },\n add: function add(callback, once, prioritize) {\n var func = once ? function (t, d, f, v) {\n callback(t, d, f, v);\n\n _self.remove(func);\n } : callback;\n\n _self.remove(callback);\n\n _listeners[prioritize ? \"unshift\" : \"push\"](func);\n\n _wake();\n\n return func;\n },\n remove: function remove(callback, i) {\n ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--;\n },\n _listeners: _listeners\n };\n return _self;\n}(),\n _wake = function _wake() {\n return !_tickerActive && _ticker.wake();\n},\n //also ensures the core classes are initialized.\n\n/*\n* -------------------------------------------------\n* EASING\n* -------------------------------------------------\n*/\n_easeMap = {},\n _customEaseExp = /^[\\d.\\-M][\\d.\\-,\\s]/,\n _quotesExp = /[\"']/g,\n _parseObjectInString = function _parseObjectInString(value) {\n //takes a string like \"{wiggles:10, type:anticipate})\" and turns it into a real object. Notice it ends in \")\" and includes the {} wrappers. This is because we only use this function for parsing ease configs and prioritized optimization rather than reusability.\n var obj = {},\n split = value.substr(1, value.length - 3).split(\":\"),\n key = split[0],\n i = 1,\n l = split.length,\n index,\n val,\n parsedVal;\n\n for (; i < l; i++) {\n val = split[i];\n index = i !== l - 1 ? val.lastIndexOf(\",\") : val.length;\n parsedVal = val.substr(0, index);\n obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, \"\").trim() : +parsedVal;\n key = val.substr(index + 1).trim();\n }\n\n return obj;\n},\n _valueInParentheses = function _valueInParentheses(value) {\n var open = value.indexOf(\"(\") + 1,\n close = value.indexOf(\")\"),\n nested = value.indexOf(\"(\", open);\n return value.substring(open, ~nested && nested < close ? value.indexOf(\")\", close + 1) : close);\n},\n _configEaseFromString = function _configEaseFromString(name) {\n //name can be a string like \"elastic.out(1,0.5)\", and pass in _easeMap as obj and it'll parse it out and call the actual function like _easeMap.Elastic.easeOut.config(1,0.5). It will also parse custom ease strings as long as CustomEase is loaded and registered (internally as _easeMap._CE).\n var split = (name + \"\").split(\"(\"),\n ease = _easeMap[split[0]];\n return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf(\"{\") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(\",\").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE(\"\", name) : ease;\n},\n _invertEase = function _invertEase(ease) {\n return function (p) {\n return 1 - ease(1 - p);\n };\n},\n // allow yoyoEase to be set in children and have those affected when the parent/ancestor timeline yoyos.\n_propagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) {\n var child = timeline._first,\n ease;\n\n while (child) {\n if (child instanceof Timeline) {\n _propagateYoyoEase(child, isYoyo);\n } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {\n if (child.timeline) {\n _propagateYoyoEase(child.timeline, isYoyo);\n } else {\n ease = child._ease;\n child._ease = child._yEase;\n child._yEase = ease;\n child._yoyo = isYoyo;\n }\n }\n\n child = child._next;\n }\n},\n _parseEase = function _parseEase(ease, defaultEase) {\n return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;\n},\n _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) {\n if (easeOut === void 0) {\n easeOut = function easeOut(p) {\n return 1 - easeIn(1 - p);\n };\n }\n\n if (easeInOut === void 0) {\n easeInOut = function easeInOut(p) {\n return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;\n };\n }\n\n var ease = {\n easeIn: easeIn,\n easeOut: easeOut,\n easeInOut: easeInOut\n },\n lowercaseName;\n\n _forEachName(names, function (name) {\n _easeMap[name] = _globals[name] = ease;\n _easeMap[lowercaseName = name.toLowerCase()] = easeOut;\n\n for (var p in ease) {\n _easeMap[lowercaseName + (p === \"easeIn\" ? \".in\" : p === \"easeOut\" ? \".out\" : \".inOut\")] = _easeMap[name + \".\" + p] = ease[p];\n }\n });\n\n return ease;\n},\n _easeInOutFromOut = function _easeInOutFromOut(easeOut) {\n return function (p) {\n return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2;\n };\n},\n _configElastic = function _configElastic(type, amplitude, period) {\n var p1 = amplitude >= 1 ? amplitude : 1,\n //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.\n p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1),\n p3 = p2 / _2PI * (Math.asin(1 / p1) || 0),\n easeOut = function easeOut(p) {\n return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n p2 = _2PI / p2; //precalculate to optimize\n\n ease.config = function (amplitude, period) {\n return _configElastic(type, amplitude, period);\n };\n\n return ease;\n},\n _configBack = function _configBack(type, overshoot) {\n if (overshoot === void 0) {\n overshoot = 1.70158;\n }\n\n var easeOut = function easeOut(p) {\n return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;\n },\n ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n return 1 - easeOut(1 - p);\n } : _easeInOutFromOut(easeOut);\n\n ease.config = function (overshoot) {\n return _configBack(type, overshoot);\n };\n\n return ease;\n}; // a cheaper (kb and cpu) but more mild way to get a parameterized weighted ease by feeding in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEase = ratio => {\n// \tlet y = 0.5 + ratio / 2;\n// \treturn p => (2 * (1 - p) * p * y + p * p);\n// },\n// a stronger (but more expensive kb/cpu) parameterized weighted ease that lets you feed in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEaseStrong = ratio => {\n// \tratio = .5 + ratio / 2;\n// \tlet o = 1 / 3 * (ratio < .5 ? ratio : 1 - ratio),\n// \t\tb = ratio - o,\n// \t\tc = ratio + o;\n// \treturn p => p === 1 ? p : 3 * b * (1 - p) * (1 - p) * p + 3 * c * (1 - p) * p * p + p * p * p;\n// };\n\n\n_forEachName(\"Linear,Quad,Cubic,Quart,Quint,Strong\", function (name, i) {\n var power = i < 5 ? i + 1 : i;\n\n _insertEase(name + \",Power\" + (power - 1), i ? function (p) {\n return Math.pow(p, power);\n } : function (p) {\n return p;\n }, function (p) {\n return 1 - Math.pow(1 - p, power);\n }, function (p) {\n return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;\n });\n});\n\n_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;\n\n_insertEase(\"Elastic\", _configElastic(\"in\"), _configElastic(\"out\"), _configElastic());\n\n(function (n, c) {\n var n1 = 1 / c,\n n2 = 2 * n1,\n n3 = 2.5 * n1,\n easeOut = function easeOut(p) {\n return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375;\n };\n\n _insertEase(\"Bounce\", function (p) {\n return 1 - easeOut(1 - p);\n }, easeOut);\n})(7.5625, 2.75);\n\n_insertEase(\"Expo\", function (p) {\n return Math.pow(2, 10 * (p - 1)) * p + p * p * p * p * p * p * (1 - p);\n}); // previously 2 ** (10 * (p - 1)) but that doesn't end up with the value quite at the right spot so we do a blended ease to ensure it lands where it should perfectly.\n\n\n_insertEase(\"Circ\", function (p) {\n return -(_sqrt(1 - p * p) - 1);\n});\n\n_insertEase(\"Sine\", function (p) {\n return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;\n});\n\n_insertEase(\"Back\", _configBack(\"in\"), _configBack(\"out\"), _configBack());\n\n_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {\n config: function config(steps, immediateStart) {\n if (steps === void 0) {\n steps = 1;\n }\n\n var p1 = 1 / steps,\n p2 = steps + (immediateStart ? 0 : 1),\n p3 = immediateStart ? 1 : 0,\n max = 1 - _tinyNum;\n return function (p) {\n return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;\n };\n }\n};\n_defaults.ease = _easeMap[\"quad.out\"];\n\n_forEachName(\"onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt\", function (name) {\n return _callbackNames += name + \",\" + name + \"Params,\";\n});\n/*\n * --------------------------------------------------------------------------------------\n * CACHE\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var GSCache = function GSCache(target, harness) {\n this.id = _gsID++;\n target._gsap = this;\n this.target = target;\n this.harness = harness;\n this.get = harness ? harness.get : _getProperty;\n this.set = harness ? harness.getSetter : _getSetter;\n};\n/*\n * --------------------------------------------------------------------------------------\n * ANIMATION\n * --------------------------------------------------------------------------------------\n */\n\nexport var Animation = /*#__PURE__*/function () {\n function Animation(vars) {\n this.vars = vars;\n this._delay = +vars.delay || 0;\n\n if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {\n // TODO: repeat: Infinity on a timeline's children must flag that timeline internally and affect its totalDuration, otherwise it'll stop in the negative direction when reaching the start.\n this._rDelay = vars.repeatDelay || 0;\n this._yoyo = !!vars.yoyo || !!vars.yoyoEase;\n }\n\n this._ts = 1;\n\n _setDuration(this, +vars.duration, 1, 1);\n\n this.data = vars.data;\n\n if (_context) {\n this._ctx = _context;\n\n _context.data.push(this);\n }\n\n _tickerActive || _ticker.wake();\n }\n\n var _proto = Animation.prototype;\n\n _proto.delay = function delay(value) {\n if (value || value === 0) {\n this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);\n this._delay = value;\n return this;\n }\n\n return this._delay;\n };\n\n _proto.duration = function duration(value) {\n return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;\n };\n\n _proto.totalDuration = function totalDuration(value) {\n if (!arguments.length) {\n return this._tDur;\n }\n\n this._dirty = 0;\n return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));\n };\n\n _proto.totalTime = function totalTime(_totalTime, suppressEvents) {\n _wake();\n\n if (!arguments.length) {\n return this._tTime;\n }\n\n var parent = this._dp;\n\n if (parent && parent.smoothChildTiming && this._ts) {\n _alignPlayhead(this, _totalTime);\n\n !parent._dp || parent.parent || _postAddChecks(parent, this); // edge case: if this is a child of a timeline that already completed, for example, we must re-activate the parent.\n //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The start of that child would get pushed out, but one of the ancestors may have completed.\n\n while (parent && parent.parent) {\n if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {\n parent.totalTime(parent._tTime, true);\n }\n\n parent = parent.parent;\n }\n\n if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {\n //if the animation doesn't have a parent, put it back into its last parent (recorded as _dp for exactly cases like this). Limit to parents with autoRemoveChildren (like globalTimeline) so that if the user manually removes an animation from a timeline and then alters its playhead, it doesn't get added back in.\n _addToTimeline(this._dp, this, this._start - this._delay);\n }\n }\n\n if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !this._initted && this._dur && _totalTime || !_totalTime && !this._initted && (this.add || this._ptLookup)) {\n // check for _ptLookup on a Tween instance to ensure it has actually finished being instantiated, otherwise if this.reverse() gets called in the Animation constructor, it could trigger a render() here even though the _targets weren't populated, thus when _init() is called there won't be any PropTweens (it'll act like the tween is non-functional)\n this._ts || (this._pTime = _totalTime); // otherwise, if an animation is paused, then the playhead is moved back to zero, then resumed, it'd revert back to the original time at the pause\n //if (!this._lock) { // avoid endless recursion (not sure we need this yet or if it's worth the performance hit)\n // this._lock = 1;\n\n _lazySafeRender(this, _totalTime, suppressEvents); // this._lock = 0;\n //}\n\n }\n\n return this;\n };\n\n _proto.time = function time(value, suppressEvents) {\n return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; // note: if the modulus results in 0, the playhead could be exactly at the end or the beginning, and we always defer to the END with a non-zero value, otherwise if you set the time() to the very end (duration()), it would render at the START!\n };\n\n _proto.totalProgress = function totalProgress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() >= 0 && this._initted ? 1 : 0;\n };\n\n _proto.progress = function progress(value, suppressEvents) {\n return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;\n };\n\n _proto.iteration = function iteration(value, suppressEvents) {\n var cycleDuration = this.duration() + this._rDelay;\n\n return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;\n } // potential future addition:\n // isPlayingBackwards() {\n // \tlet animation = this,\n // \t\torientation = 1; // 1 = forward, -1 = backward\n // \twhile (animation) {\n // \t\torientation *= animation.reversed() || (animation.repeat() && !(animation.iteration() & 1)) ? -1 : 1;\n // \t\tanimation = animation.parent;\n // \t}\n // \treturn orientation < 0;\n // }\n ;\n\n _proto.timeScale = function timeScale(value, suppressEvents) {\n if (!arguments.length) {\n return this._rts === -_tinyNum ? 0 : this._rts; // recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed.\n }\n\n if (this._rts === value) {\n return this;\n }\n\n var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; // make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation.\n // future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called.\n //(+value < 0 && this._rts >= 0) && _callback(this, \"onReverse\", true);\n // prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes.\n\n this._rts = +value || 0;\n this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; // _ts is the functional timeScale which would be 0 if the animation is paused.\n\n this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false);\n\n _setEnd(this); // if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here.\n\n\n return _recacheAncestors(this);\n };\n\n _proto.paused = function paused(value) {\n if (!arguments.length) {\n return this._ps;\n } // possible future addition - if an animation is removed from its parent and then .restart() or .play() or .resume() is called, perhaps we should force it back into the globalTimeline but be careful because what if it's already at its end? We don't want it to just persist forever and not get released for GC.\n // !this.parent && !value && this._tTime < this._tDur && this !== _globalTimeline && _globalTimeline.add(this);\n\n\n if (this._ps !== value) {\n this._ps = value;\n\n if (value) {\n this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); // if the pause occurs during the delay phase, make sure that's factored in when resuming.\n\n this._ts = this._act = 0; // _ts is the functional timeScale, so a paused tween would effectively have a timeScale of 0. We record the \"real\" timeScale as _rts (recorded time scale)\n } else {\n _wake();\n\n this._ts = this._rts; //only defer to _pTime (pauseTime) if tTime is zero. Remember, someone could pause() an animation, then scrub the playhead and resume(). If the parent doesn't have smoothChildTiming, we render at the rawTime() because the startTime won't get updated.\n\n this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); // edge case: animation.progress(1).pause().play() wouldn't render again because the playhead is already at the end, but the call to totalTime() below will add it back to its parent...and not remove it again (since removing only happens upon rendering at a new time). Offsetting the _tTime slightly is done simply to cause the final render in totalTime() that'll pop it off its timeline (if autoRemoveChildren is true, of course). Check to make sure _zTime isn't -_tinyNum to avoid an edge case where the playhead is pushed to the end but INSIDE a tween/callback, the timeline itself is paused thus halting rendering and leaving a few unrendered. When resuming, it wouldn't render those otherwise.\n }\n }\n\n return this;\n };\n\n _proto.startTime = function startTime(value) {\n if (arguments.length) {\n this._start = _roundPrecise(value);\n var parent = this.parent || this._dp;\n parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, this._start - this._delay);\n return this;\n }\n\n return this._start;\n };\n\n _proto.endTime = function endTime(includeRepeats) {\n return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);\n };\n\n _proto.rawTime = function rawTime(wrapRepeats) {\n var parent = this.parent || this._dp; // _dp = detached parent\n\n return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);\n };\n\n _proto.revert = function revert(config) {\n if (config === void 0) {\n config = _revertConfig;\n }\n\n var prevIsReverting = _reverting;\n _reverting = config;\n\n if (_isRevertWorthy(this)) {\n this.timeline && this.timeline.revert(config);\n this.totalTime(-0.01, config.suppressEvents);\n }\n\n this.data !== \"nested\" && config.kill !== false && this.kill();\n _reverting = prevIsReverting;\n return this;\n };\n\n _proto.globalTime = function globalTime(rawTime) {\n var animation = this,\n time = arguments.length ? rawTime : animation.rawTime();\n\n while (animation) {\n time = animation._start + time / (Math.abs(animation._ts) || 1);\n animation = animation._dp;\n }\n\n return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; // the _startAt tweens for .fromTo() and .from() that have immediateRender should always be FIRST in the timeline (important for context.revert()). \"_sat\" stands for _startAtTween, referring to the parent tween that created the _startAt. We must discern if that tween had immediateRender so that we can know whether or not to prioritize it in revert().\n };\n\n _proto.repeat = function repeat(value) {\n if (arguments.length) {\n this._repeat = value === Infinity ? -2 : value;\n return _onUpdateTotalDuration(this);\n }\n\n return this._repeat === -2 ? Infinity : this._repeat;\n };\n\n _proto.repeatDelay = function repeatDelay(value) {\n if (arguments.length) {\n var time = this._time;\n this._rDelay = value;\n\n _onUpdateTotalDuration(this);\n\n return time ? this.time(time) : this;\n }\n\n return this._rDelay;\n };\n\n _proto.yoyo = function yoyo(value) {\n if (arguments.length) {\n this._yoyo = value;\n return this;\n }\n\n return this._yoyo;\n };\n\n _proto.seek = function seek(position, suppressEvents) {\n return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));\n };\n\n _proto.restart = function restart(includeDelay, suppressEvents) {\n this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));\n this._dur || (this._zTime = -_tinyNum); // ensures onComplete fires on a zero-duration animation that gets restarted.\n\n return this;\n };\n\n _proto.play = function play(from, suppressEvents) {\n from != null && this.seek(from, suppressEvents);\n return this.reversed(false).paused(false);\n };\n\n _proto.reverse = function reverse(from, suppressEvents) {\n from != null && this.seek(from || this.totalDuration(), suppressEvents);\n return this.reversed(true).paused(false);\n };\n\n _proto.pause = function pause(atTime, suppressEvents) {\n atTime != null && this.seek(atTime, suppressEvents);\n return this.paused(true);\n };\n\n _proto.resume = function resume() {\n return this.paused(false);\n };\n\n _proto.reversed = function reversed(value) {\n if (arguments.length) {\n !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); // in case timeScale is zero, reversing would have no effect so we use _tinyNum.\n\n return this;\n }\n\n return this._rts < 0;\n };\n\n _proto.invalidate = function invalidate() {\n this._initted = this._act = 0;\n this._zTime = -_tinyNum;\n return this;\n };\n\n _proto.isActive = function isActive() {\n var parent = this.parent || this._dp,\n start = this._start,\n rawTime;\n return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);\n };\n\n _proto.eventCallback = function eventCallback(type, callback, params) {\n var vars = this.vars;\n\n if (arguments.length > 1) {\n if (!callback) {\n delete vars[type];\n } else {\n vars[type] = callback;\n params && (vars[type + \"Params\"] = params);\n type === \"onUpdate\" && (this._onUpdate = callback);\n }\n\n return this;\n }\n\n return vars[type];\n };\n\n _proto.then = function then(onFulfilled) {\n var self = this,\n prevProm = self._prom;\n return new Promise(function (resolve) {\n var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough,\n _resolve = function _resolve() {\n var _then = self.then;\n self.then = null; // temporarily null the then() method to avoid an infinite loop (see https://github.com/greensock/GSAP/issues/322)\n\n prevProm && prevProm();\n _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);\n resolve(f);\n self.then = _then;\n };\n\n if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {\n _resolve();\n } else {\n self._prom = _resolve;\n }\n });\n };\n\n _proto.kill = function kill() {\n _interrupt(this);\n };\n\n return Animation;\n}();\n\n_setDefaults(Animation.prototype, {\n _time: 0,\n _start: 0,\n _end: 0,\n _tTime: 0,\n _tDur: 0,\n _dirty: 0,\n _repeat: 0,\n _yoyo: false,\n parent: null,\n _initted: false,\n _rDelay: 0,\n _ts: 1,\n _dp: 0,\n ratio: 0,\n _zTime: -_tinyNum,\n _prom: 0,\n _ps: false,\n _rts: 1\n});\n/*\n * -------------------------------------------------\n * TIMELINE\n * -------------------------------------------------\n */\n\n\nexport var Timeline = /*#__PURE__*/function (_Animation) {\n _inheritsLoose(Timeline, _Animation);\n\n function Timeline(vars, position) {\n var _this;\n\n if (vars === void 0) {\n vars = {};\n }\n\n _this = _Animation.call(this, vars) || this;\n _this.labels = {};\n _this.smoothChildTiming = !!vars.smoothChildTiming;\n _this.autoRemoveChildren = !!vars.autoRemoveChildren;\n _this._sort = _isNotFalse(vars.sortChildren);\n _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);\n vars.reversed && _this.reverse();\n vars.paused && _this.paused(true);\n vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);\n return _this;\n }\n\n var _proto2 = Timeline.prototype;\n\n _proto2.to = function to(targets, vars, position) {\n _createTweenType(0, arguments, this);\n\n return this;\n };\n\n _proto2.from = function from(targets, vars, position) {\n _createTweenType(1, arguments, this);\n\n return this;\n };\n\n _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {\n _createTweenType(2, arguments, this);\n\n return this;\n };\n\n _proto2.set = function set(targets, vars, position) {\n vars.duration = 0;\n vars.parent = this;\n _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);\n vars.immediateRender = !!vars.immediateRender;\n new Tween(targets, vars, _parsePosition(this, position), 1);\n return this;\n };\n\n _proto2.call = function call(callback, params, position) {\n return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);\n } //ONLY for backward compatibility! Maybe delete?\n ;\n\n _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.duration = duration;\n vars.stagger = vars.stagger || stagger;\n vars.onComplete = onCompleteAll;\n vars.onCompleteParams = onCompleteAllParams;\n vars.parent = this;\n new Tween(targets, vars, _parsePosition(this, position));\n return this;\n };\n\n _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n vars.runBackwards = 1;\n _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);\n return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {\n toVars.startAt = fromVars;\n _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);\n return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);\n };\n\n _proto2.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._dirty ? this.totalDuration() : this._tDur,\n dur = this._dur,\n tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime),\n // if a paused timeline is resumed (or its _start is updated for another reason...which rounds it), that could result in the playhead shifting a **tiny** amount and a zero-duration child at that spot may get rendered at a different ratio, like its totalTime in render() may be 1e-17 instead of 0, for example.\n crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur),\n time,\n child,\n next,\n iteration,\n cycleDuration,\n prevPaused,\n pauseTween,\n timeScale,\n prevStart,\n prevIteration,\n yoyo,\n isYoyo;\n this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);\n\n if (tTime !== this._tTime || force || crossingStart) {\n if (prevTime !== this._time && dur) {\n //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump).\n tTime += this._time - prevTime;\n totalTime += this._time - prevTime;\n }\n\n time = tTime;\n prevStart = this._start;\n timeScale = this._ts;\n prevPaused = !timeScale;\n\n if (crossingStart) {\n dur || (prevTime = this._zTime); //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n (totalTime || !suppressEvents) && (this._zTime = totalTime);\n }\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n yoyo = this._yoyo;\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && totalTime < 0) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n prevIteration = _roundPrecise(tTime / cycleDuration); // full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)\n\n iteration = ~~prevIteration;\n\n if (iteration && iteration === prevIteration) {\n time = dur;\n iteration--;\n }\n\n time > dur && (time = dur);\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); // edge case - if someone does addPause() at the very beginning of a repeating timeline, that pause is technically at the same spot as the end which causes this._time to get set to 0 when the totalTime would normally place the playhead at the end. See https://gsap.com/forums/topic/23823-closing-nav-animation-not-working-on-ie-and-iphone-6-maybe-other-older-browser/?tab=comments#comment-113005 also, this._tTime - prevIteration * cycleDuration - this._dur <= 0 just checks to make sure it wasn't previously in the \"repeatDelay\" portion\n\n if (yoyo && iteration & 1) {\n time = dur - time;\n isYoyo = 1;\n }\n /*\n make sure children at the end/beginning of the timeline are rendered properly. If, for example,\n a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which\n would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there\n could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So\n we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must\n ensure that zero-duration tweens at the very beginning or end of the Timeline work.\n */\n\n\n if (iteration !== prevIteration && !this._lock) {\n var rewinding = yoyo && prevIteration & 1,\n doesWrap = rewinding === (yoyo && iteration & 1);\n iteration < prevIteration && (rewinding = !rewinding);\n prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; // if the playhead is landing exactly at the end of an iteration, use that totalTime rather than only the duration, otherwise it'll skip the 2nd render since it's effectively at the same time.\n\n this._lock = 1;\n this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;\n this._tTime = tTime; // if a user gets the iteration() inside the onRepeat, for example, it should be accurate.\n\n !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n\n if (this.vars.repeatRefresh && !isYoyo) {\n this.invalidate()._lock = 1;\n prevIteration = iteration; // otherwise, the onStart() may fire on the 2nd iteration.\n }\n\n if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {\n // if prevTime is 0 and we render at the very end, _time will be the end, thus won't match. So in this edge case, prevTime won't match _time but that's okay. If it gets killed in the onRepeat, eject as well.\n return this;\n }\n\n dur = this._dur; // in case the duration changed in the onRepeat\n\n tDur = this._tDur;\n\n if (doesWrap) {\n this._lock = 2;\n prevTime = rewinding ? dur : -0.0001;\n this.render(prevTime, true);\n this.vars.repeatRefresh && !isYoyo && this.invalidate();\n }\n\n this._lock = 0;\n\n if (!this._ts && !prevPaused) {\n return this;\n } //in order for yoyoEase to work properly when there's a stagger, we must swap out the ease in each sub-tween.\n\n\n _propagateYoyoEase(this, isYoyo);\n }\n }\n\n if (this._hasPause && !this._forcing && this._lock < 2) {\n pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));\n\n if (pauseTween) {\n tTime -= time - (time = pauseTween._start);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n this._act = !timeScale; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n if (!this._initted) {\n this._onUpdate = this.vars.onUpdate;\n this._initted = 1;\n this._zTime = totalTime;\n prevTime = 0; // upon init, the playhead should always go forward; someone could invalidate() a completed timeline and then if they restart(), that would make child tweens render in reverse order which could lock in the wrong starting values if they build on each other, like tl.to(obj, {x: 100}).to(obj, {x: 0}).\n }\n\n if (!prevTime && tTime && dur && !suppressEvents && !prevIteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n if (time >= prevTime && totalTime >= 0) {\n child = this._first;\n\n while (child) {\n next = child._next;\n\n if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = -_tinyNum); // it didn't finish rendering, so flag zTime as negative so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n } else {\n child = this._last;\n var adjustedTime = totalTime < 0 ? totalTime : time; //when the playhead goes backward beyond the start of this timeline, we must pass that information down to the child animations so that zero-duration tweens know whether to render their starting or ending values.\n\n while (child) {\n next = child._prev;\n\n if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {\n if (child.parent !== this) {\n // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n return this.render(totalTime, suppressEvents, force);\n }\n\n child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && _isRevertWorthy(child)); // if reverting, we should always force renders of initted tweens (but remember that .fromTo() or .from() may have a _startAt but not _initted yet). If, for example, a .fromTo() tween with a stagger (which creates an internal timeline) gets reverted BEFORE some of its child tweens render for the first time, it may not properly trigger them to revert.\n\n if (time !== this._time || !this._ts && !prevPaused) {\n //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n pauseTween = 0;\n next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); // it didn't finish rendering, so adjust zTime so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n break;\n }\n }\n\n child = next;\n }\n }\n\n if (pauseTween && !suppressEvents) {\n this.pause();\n pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;\n\n if (this._ts) {\n //the callback resumed playback! So since we may have held back the playhead due to where the pause is positioned, go ahead and jump to where it's SUPPOSED to be (if no pause happened).\n this._start = prevStart; //if the pause was at an earlier time and the user resumed in the callback, it could reposition the timeline (changing its startTime), throwing things off slightly, so we make sure the _start doesn't shift.\n\n _setEnd(this);\n\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._onUpdate && !suppressEvents && _callback(this, \"onUpdate\", true);\n if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) {\n // remember, a child's callback may alter this timeline's playhead or timeScale which is why we need to add some of these checks.\n (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {\n _callback(this, tTime === tDur && totalTime >= 0 ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto2.add = function add(child, position) {\n var _this2 = this;\n\n _isNumber(position) || (position = _parsePosition(this, position, child));\n\n if (!(child instanceof Animation)) {\n if (_isArray(child)) {\n child.forEach(function (obj) {\n return _this2.add(obj, position);\n });\n return this;\n }\n\n if (_isString(child)) {\n return this.addLabel(child, position);\n }\n\n if (_isFunction(child)) {\n child = Tween.delayedCall(0, child);\n } else {\n return this;\n }\n }\n\n return this !== child ? _addToTimeline(this, child, position) : this; //don't allow a timeline to be added to itself as a child!\n };\n\n _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {\n if (nested === void 0) {\n nested = true;\n }\n\n if (tweens === void 0) {\n tweens = true;\n }\n\n if (timelines === void 0) {\n timelines = true;\n }\n\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = -_bigNum;\n }\n\n var a = [],\n child = this._first;\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n if (child instanceof Tween) {\n tweens && a.push(child);\n } else {\n timelines && a.push(child);\n nested && a.push.apply(a, child.getChildren(true, tweens, timelines));\n }\n }\n\n child = child._next;\n }\n\n return a;\n };\n\n _proto2.getById = function getById(id) {\n var animations = this.getChildren(1, 1, 1),\n i = animations.length;\n\n while (i--) {\n if (animations[i].vars.id === id) {\n return animations[i];\n }\n }\n };\n\n _proto2.remove = function remove(child) {\n if (_isString(child)) {\n return this.removeLabel(child);\n }\n\n if (_isFunction(child)) {\n return this.killTweensOf(child);\n }\n\n child.parent === this && _removeLinkedListItem(this, child);\n\n if (child === this._recent) {\n this._recent = this._last;\n }\n\n return _uncache(this);\n };\n\n _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {\n if (!arguments.length) {\n return this._tTime;\n }\n\n this._forcing = 1;\n\n if (!this._dp && this._ts) {\n //special case for the global timeline (or any other that has no parent or detached parent).\n this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));\n }\n\n _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);\n\n this._forcing = 0;\n return this;\n };\n\n _proto2.addLabel = function addLabel(label, position) {\n this.labels[label] = _parsePosition(this, position);\n return this;\n };\n\n _proto2.removeLabel = function removeLabel(label) {\n delete this.labels[label];\n return this;\n };\n\n _proto2.addPause = function addPause(position, callback, params) {\n var t = Tween.delayedCall(0, callback || _emptyFunc, params);\n t.data = \"isPause\";\n this._hasPause = 1;\n return _addToTimeline(this, t, _parsePosition(this, position));\n };\n\n _proto2.removePause = function removePause(position) {\n var child = this._first;\n position = _parsePosition(this, position);\n\n while (child) {\n if (child._start === position && child.data === \"isPause\") {\n _removeFromParent(child);\n }\n\n child = child._next;\n }\n };\n\n _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n var tweens = this.getTweensOf(targets, onlyActive),\n i = tweens.length;\n\n while (i--) {\n _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);\n }\n\n return this;\n };\n\n _proto2.getTweensOf = function getTweensOf(targets, onlyActive) {\n var a = [],\n parsedTargets = toArray(targets),\n child = this._first,\n isGlobalTime = _isNumber(onlyActive),\n // a number is interpreted as a global time. If the animation spans\n children;\n\n while (child) {\n if (child instanceof Tween) {\n if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {\n // note: if this is for overwriting, it should only be for tweens that aren't paused and are initted.\n a.push(child);\n }\n } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {\n a.push.apply(a, children);\n }\n\n child = child._next;\n }\n\n return a;\n } // potential future feature - targets() on timelines\n // targets() {\n // \tlet result = [];\n // \tthis.getChildren(true, true, false).forEach(t => result.push(...t.targets()));\n // \treturn result.filter((v, i) => result.indexOf(v) === i);\n // }\n ;\n\n _proto2.tweenTo = function tweenTo(position, vars) {\n vars = vars || {};\n\n var tl = this,\n endTime = _parsePosition(tl, position),\n _vars = vars,\n startAt = _vars.startAt,\n _onStart = _vars.onStart,\n onStartParams = _vars.onStartParams,\n immediateRender = _vars.immediateRender,\n initted,\n tween = Tween.to(tl, _setDefaults({\n ease: vars.ease || \"none\",\n lazy: false,\n immediateRender: false,\n time: endTime,\n overwrite: \"auto\",\n duration: vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,\n onStart: function onStart() {\n tl.pause();\n\n if (!initted) {\n var duration = vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale());\n tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);\n initted = 1;\n }\n\n _onStart && _onStart.apply(tween, onStartParams || []); //in case the user had an onStart in the vars - we don't want to overwrite it.\n }\n }, vars));\n\n return immediateRender ? tween.render(0) : tween;\n };\n\n _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {\n return this.tweenTo(toPosition, _setDefaults({\n startAt: {\n time: _parsePosition(this, fromPosition)\n }\n }, vars));\n };\n\n _proto2.recent = function recent() {\n return this._recent;\n };\n\n _proto2.nextLabel = function nextLabel(afterTime) {\n if (afterTime === void 0) {\n afterTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, afterTime));\n };\n\n _proto2.previousLabel = function previousLabel(beforeTime) {\n if (beforeTime === void 0) {\n beforeTime = this._time;\n }\n\n return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);\n };\n\n _proto2.currentLabel = function currentLabel(value) {\n return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);\n };\n\n _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {\n if (ignoreBeforeTime === void 0) {\n ignoreBeforeTime = 0;\n }\n\n var child = this._first,\n labels = this.labels,\n p;\n amount = _roundPrecise(amount);\n\n while (child) {\n if (child._start >= ignoreBeforeTime) {\n child._start += amount;\n child._end += amount;\n }\n\n child = child._next;\n }\n\n if (adjustLabels) {\n for (p in labels) {\n if (labels[p] >= ignoreBeforeTime) {\n labels[p] += amount;\n }\n }\n }\n\n return _uncache(this);\n };\n\n _proto2.invalidate = function invalidate(soft) {\n var child = this._first;\n this._lock = 0;\n\n while (child) {\n child.invalidate(soft);\n child = child._next;\n }\n\n return _Animation.prototype.invalidate.call(this, soft);\n };\n\n _proto2.clear = function clear(includeLabels) {\n if (includeLabels === void 0) {\n includeLabels = true;\n }\n\n var child = this._first,\n next;\n\n while (child) {\n next = child._next;\n this.remove(child);\n child = next;\n }\n\n this._dp && (this._time = this._tTime = this._pTime = 0);\n includeLabels && (this.labels = {});\n return _uncache(this);\n };\n\n _proto2.totalDuration = function totalDuration(value) {\n var max = 0,\n self = this,\n child = self._last,\n prevStart = _bigNum,\n prev,\n start,\n parent;\n\n if (arguments.length) {\n return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));\n }\n\n if (self._dirty) {\n parent = self.parent;\n\n while (child) {\n prev = child._prev; //record it here in case the tween changes position in the sequence...\n\n child._dirty && child.totalDuration(); //could change the tween._startTime, so make sure the animation's cache is clean before analyzing it.\n\n start = child._start;\n\n if (start > prevStart && self._sort && child._ts && !self._lock) {\n //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence\n self._lock = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add().\n\n _addToTimeline(self, child, start - child._delay, 1)._lock = 0;\n } else {\n prevStart = start;\n }\n\n if (start < 0 && child._ts) {\n //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.\n max -= start;\n\n if (!parent && !self._dp || parent && parent.smoothChildTiming) {\n self._start += _roundPrecise(start / self._ts);\n self._time -= start;\n self._tTime -= start;\n }\n\n self.shiftChildren(-start, false, -1e999);\n prevStart = 0;\n }\n\n child._end > max && child._ts && (max = child._end);\n child = prev;\n }\n\n _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);\n\n self._dirty = 0;\n }\n\n return self._tDur;\n };\n\n Timeline.updateRoot = function updateRoot(time) {\n if (_globalTimeline._ts) {\n _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));\n\n _lastRenderedFrame = _ticker.frame;\n }\n\n if (_ticker.frame >= _nextGCFrame) {\n _nextGCFrame += _config.autoSleep || 120;\n var child = _globalTimeline._first;\n if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) {\n while (child && !child._ts) {\n child = child._next;\n }\n\n child || _ticker.sleep();\n }\n }\n };\n\n return Timeline;\n}(Animation);\n\n_setDefaults(Timeline.prototype, {\n _lock: 0,\n _hasPause: 0,\n _forcing: 0\n});\n\nvar _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) {\n //note: we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter),\n index = 0,\n matchIndex = 0,\n result,\n startNums,\n color,\n endNum,\n chunk,\n startNum,\n hasRandom,\n a;\n pt.b = start;\n pt.e = end;\n start += \"\"; //ensure values are strings\n\n end += \"\";\n\n if (hasRandom = ~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (stringFilter) {\n a = [start, end];\n stringFilter(a, target, prop); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\n start = a[0];\n end = a[1];\n }\n\n startNums = start.match(_complexStringNumExp) || [];\n\n while (result = _complexStringNumExp.exec(end)) {\n endNum = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\") {\n color = 1;\n }\n\n if (endNum !== startNums[matchIndex++]) {\n startNum = parseFloat(startNums[matchIndex - 1]) || 0; //these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum.charAt(1) === \"=\" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,\n m: color && color < 4 ? Math.round : 0\n };\n index = _complexStringNumExp.lastIndex;\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n\n pt.fp = funcParam;\n\n if (_relExp.test(end) || hasRandom) {\n pt.e = 0; //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n }\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {\n _isFunction(end) && (end = end(index || 0, target, targets));\n var currentValue = target[prop],\n parsedStart = start !== \"get\" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf(\"set\") || !_isFunction(target[\"get\" + prop.substr(3)]) ? prop : \"get\" + prop.substr(3)](funcParam) : target[prop](),\n setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc,\n pt;\n\n if (_isString(end)) {\n if (~end.indexOf(\"random(\")) {\n end = _replaceRandom(end);\n }\n\n if (end.charAt(1) === \"=\") {\n pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);\n\n if (pt || pt === 0) {\n // to avoid isNaN, like if someone passes in a value like \"!= whatever\"\n end = pt;\n }\n }\n }\n\n if (!optional || parsedStart !== end || _forceAllPropTweens) {\n if (!isNaN(parsedStart * end) && end !== \"\") {\n // fun fact: any number multiplied by \"\" is evaluated as the number 0!\n pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === \"boolean\" ? _renderBoolean : _renderPlain, 0, setter);\n funcParam && (pt.fp = funcParam);\n modifier && pt.modifier(modifier, this, target);\n return this._pt = pt;\n }\n\n !currentValue && !(prop in target) && _missingPlugin(prop, end);\n return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);\n }\n},\n //creates a copy of the vars object and processes any function-based values (putting the resulting values directly into the copy) as well as strings with \"random()\" in them. It does NOT process relative values.\n_processVars = function _processVars(vars, index, target, targets, tween) {\n _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));\n\n if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {\n return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;\n }\n\n var copy = {},\n p;\n\n for (p in vars) {\n copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);\n }\n\n return copy;\n},\n _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) {\n var plugin, pt, ptLookup, i;\n\n if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n if (tween !== _quickTween) {\n ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; //note: we can't use tween._ptLookup[index] because for staggered tweens, the index from the fullTargets array won't match what it is in each individual tween that spawns from the stagger.\n\n i = plugin._props.length;\n\n while (i--) {\n ptLookup[plugin._props[i]] = pt;\n }\n }\n }\n\n return plugin;\n},\n _overwritingTween,\n //store a reference temporarily so we can avoid overwriting itself.\n_forceAllPropTweens,\n _initTween = function _initTween(tween, time, tTime) {\n var vars = tween.vars,\n ease = vars.ease,\n startAt = vars.startAt,\n immediateRender = vars.immediateRender,\n lazy = vars.lazy,\n onUpdate = vars.onUpdate,\n runBackwards = vars.runBackwards,\n yoyoEase = vars.yoyoEase,\n keyframes = vars.keyframes,\n autoRevert = vars.autoRevert,\n dur = tween._dur,\n prevStartAt = tween._startAt,\n targets = tween._targets,\n parent = tween.parent,\n fullTargets = parent && parent.data === \"nested\" ? parent.vars.targets : targets,\n autoOverwrite = tween._overwrite === \"auto\" && !_suppressOverwrites,\n tl = tween.timeline,\n cleanVars,\n i,\n p,\n pt,\n target,\n hasPriority,\n gsData,\n harness,\n plugin,\n ptLookup,\n index,\n harnessVars,\n overwritten;\n tl && (!keyframes || !ease) && (ease = \"none\");\n tween._ease = _parseEase(ease, _defaults.ease);\n tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;\n\n if (yoyoEase && tween._yoyo && !tween._repeat) {\n //there must have been a parent timeline with yoyo:true that is currently in its yoyo phase, so flip the eases.\n yoyoEase = tween._yEase;\n tween._yEase = tween._ease;\n tween._ease = yoyoEase;\n }\n\n tween._from = !tl && !!vars.runBackwards; //nested timelines should never run backwards - the backwards-ness is in the child tweens.\n\n if (!tl || keyframes && !vars.stagger) {\n //if there's an internal timeline, skip all the parsing because we passed that task down the chain.\n harness = targets[0] ? _getCache(targets[0]).harness : 0;\n harnessVars = harness && vars[harness.prop]; //someone may need to specify CSS-specific values AND non-CSS values, like if the element has an \"x\" property plus it's a standard DOM element. We allow people to distinguish by wrapping plugin-specific stuff in a css:{} object for example.\n\n cleanVars = _copyExcluding(vars, _reservedProps);\n\n if (prevStartAt) {\n prevStartAt._zTime < 0 && prevStartAt.progress(1); // in case it's a lazy startAt that hasn't rendered yet.\n\n time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); // if it's a \"startAt\" (not \"from()\" or runBackwards: true), we only need to do a shallow revert (keep transforms cached in CSSPlugin)\n // don't just _removeFromParent(prevStartAt.render(-1, true)) because that'll leave inline styles. We're creating a new _startAt for \"startAt\" tweens that re-capture things to ensure that if the pre-tween values changed since the tween was created, they're recorded.\n\n prevStartAt._lazy = 0;\n }\n\n if (startAt) {\n _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({\n data: \"isStart\",\n overwrite: false,\n parent: parent,\n immediateRender: true,\n lazy: !prevStartAt && _isNotFalse(lazy),\n startAt: null,\n delay: 0,\n onUpdate: onUpdate && function () {\n return _callback(tween, \"onUpdate\");\n },\n stagger: 0\n }, startAt))); //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, from, to).fromTo(e, to, from);\n\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline! Like when revert() is called and totalTime() gets set.\n\n tween._startAt._sat = tween; // used in globalTime(). _sat stands for _startAtTween\n\n time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); // rare edge case, like if a render is forced in the negative direction of a non-initted tween.\n\n if (immediateRender) {\n if (dur && time <= 0 && tTime <= 0) {\n // check tTime here because in the case of a yoyo tween whose playhead gets pushed to the end like tween.progress(1), we should allow it through so that the onComplete gets fired properly.\n time && (tween._zTime = time);\n return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a Timeline, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n }\n }\n } else if (runBackwards && dur) {\n //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n if (!prevStartAt) {\n time && (immediateRender = false); //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\n p = _setDefaults({\n overwrite: false,\n data: \"isFromStart\",\n //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),\n immediateRender: immediateRender,\n //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n stagger: 0,\n parent: parent //ensures that nested tweens that had a stagger are handled properly, like gsap.from(\".class\", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})\n\n }, cleanVars);\n harnessVars && (p[harness.prop] = harnessVars); // in case someone does something like .from(..., {css:{}})\n\n _removeFromParent(tween._startAt = Tween.set(targets, p));\n\n tween._startAt._dp = 0; // don't allow it to get put back into root timeline!\n\n tween._startAt._sat = tween; // used in globalTime()\n\n time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));\n tween._zTime = time;\n\n if (!immediateRender) {\n _initTween(tween._startAt, _tinyNum, _tinyNum); //ensures that the initial values are recorded\n\n } else if (!time) {\n return;\n }\n }\n }\n\n tween._pt = tween._ptCache = 0;\n lazy = dur && _isNotFalse(lazy) || lazy && !dur;\n\n for (i = 0; i < targets.length; i++) {\n target = targets[i];\n gsData = target._gsap || _harness(targets)[i]._gsap;\n tween._ptLookup[i] = ptLookup = {};\n _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\n index = fullTargets === targets ? i : fullTargets.indexOf(target);\n\n if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {\n tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n plugin._props.forEach(function (name) {\n ptLookup[name] = pt;\n });\n\n plugin.priority && (hasPriority = 1);\n }\n\n if (!harness || harnessVars) {\n for (p in cleanVars) {\n if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {\n plugin.priority && (hasPriority = 1);\n } else {\n ptLookup[p] = pt = _addPropTween.call(tween, target, p, \"get\", cleanVars[p], index, fullTargets, 0, vars.stringFilter);\n }\n }\n }\n\n tween._op && tween._op[i] && tween.kill(target, tween._op[i]);\n\n if (autoOverwrite && tween._pt) {\n _overwritingTween = tween;\n\n _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); // make sure the overwriting doesn't overwrite THIS tween!!!\n\n\n overwritten = !tween.parent;\n _overwritingTween = 0;\n }\n\n tween._pt && lazy && (_lazyLookup[gsData.id] = 1);\n }\n\n hasPriority && _sortPropTweensByPriority(tween);\n tween._onInit && tween._onInit(tween); //plugins like RoundProps must wait until ALL of the PropTweens are instantiated. In the plugin's init() function, it sets the _onInit on the tween instance. May not be pretty/intuitive, but it's fast and keeps file size down.\n }\n\n tween._onUpdate = onUpdate;\n tween._initted = (!tween._op || tween._pt) && !overwritten; // if overwrittenProps resulted in the entire tween being killed, do NOT flag it as initted or else it may render for one tick.\n\n keyframes && time <= 0 && tl.render(_bigNum, true, true); // if there's a 0% keyframe, it'll render in the \"before\" state for any staggered/delayed animations thus when the following tween initializes, it'll use the \"before\" state instead of the \"after\" state as the initial values.\n},\n _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) {\n var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property],\n pt,\n rootPT,\n lookup,\n i;\n\n if (!ptCache) {\n ptCache = tween._ptCache[property] = [];\n lookup = tween._ptLookup;\n i = tween._targets.length;\n\n while (i--) {\n pt = lookup[i][property];\n\n if (pt && pt.d && pt.d._pt) {\n // it's a plugin, so find the nested PropTween\n pt = pt.d._pt;\n\n while (pt && pt.p !== property && pt.fp !== property) {\n // \"fp\" is functionParam for things like setting CSS variables which require .setProperty(\"--var-name\", value)\n pt = pt._next;\n }\n }\n\n if (!pt) {\n // there is no PropTween associated with that property, so we must FORCE one to be created and ditch out of this\n // if the tween has other properties that already rendered at new positions, we'd normally have to rewind to put them back like tween.render(0, true) before forcing an _initTween(), but that can create another edge case like tweening a timeline's progress would trigger onUpdates to fire which could move other things around. It's better to just inform users that .resetTo() should ONLY be used for tweens that already have that property. For example, you can't gsap.to(...{ y: 0 }) and then tween.restTo(\"x\", 200) for example.\n _forceAllPropTweens = 1; // otherwise, when we _addPropTween() and it finds no change between the start and end values, it skips creating a PropTween (for efficiency...why tween when there's no difference?) but in this case we NEED that PropTween created so we can edit it.\n\n tween.vars[property] = \"+=0\";\n\n _initTween(tween, time);\n\n _forceAllPropTweens = 0;\n return skipRecursion ? _warn(property + \" not eligible for reset\") : 1; // if someone tries to do a quickTo() on a special property like borderRadius which must get split into 4 different properties, that's not eligible for .resetTo().\n }\n\n ptCache.push(pt);\n }\n }\n\n i = ptCache.length;\n\n while (i--) {\n rootPT = ptCache[i];\n pt = rootPT._pt || rootPT; // complex values may have nested PropTweens. We only accommodate the FIRST value.\n\n pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;\n pt.c = value - pt.s;\n rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); // mainly for CSSPlugin (end value)\n\n rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); // (beginning value)\n }\n},\n _addAliasesToVars = function _addAliasesToVars(targets, vars) {\n var harness = targets[0] ? _getCache(targets[0]).harness : 0,\n propertyAliases = harness && harness.aliases,\n copy,\n p,\n i,\n aliases;\n\n if (!propertyAliases) {\n return vars;\n }\n\n copy = _merge({}, vars);\n\n for (p in propertyAliases) {\n if (p in copy) {\n aliases = propertyAliases[p].split(\",\");\n i = aliases.length;\n\n while (i--) {\n copy[aliases[i]] = copy[p];\n }\n }\n }\n\n return copy;\n},\n // parses multiple formats, like {\"0%\": {x: 100}, {\"50%\": {x: -20}} and { x: {\"0%\": 100, \"50%\": -20} }, and an \"ease\" can be set on any object. We populate an \"allProps\" object with an Array for each property, like {x: [{}, {}], y:[{}, {}]} with data for each property tween. The objects have a \"t\" (time), \"v\", (value), and \"e\" (ease) property. This allows us to piece together a timeline later.\n_parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) {\n var ease = obj.ease || easeEach || \"power1.inOut\",\n p,\n a;\n\n if (_isArray(obj)) {\n a = allProps[prop] || (allProps[prop] = []); // t = time (out of 100), v = value, e = ease\n\n obj.forEach(function (value, i) {\n return a.push({\n t: i / (obj.length - 1) * 100,\n v: value,\n e: ease\n });\n });\n } else {\n for (p in obj) {\n a = allProps[p] || (allProps[p] = []);\n p === \"ease\" || a.push({\n t: parseFloat(prop),\n v: obj[p],\n e: ease\n });\n }\n }\n},\n _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) {\n return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf(\"random(\") ? _replaceRandom(value) : value;\n},\n _staggerTweenProps = _callbackNames + \"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert\",\n _staggerPropsToSkip = {};\n\n_forEachName(_staggerTweenProps + \",id,stagger,delay,duration,paused,scrollTrigger\", function (name) {\n return _staggerPropsToSkip[name] = 1;\n});\n/*\n * --------------------------------------------------------------------------------------\n * TWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var Tween = /*#__PURE__*/function (_Animation2) {\n _inheritsLoose(Tween, _Animation2);\n\n function Tween(targets, vars, position, skipInherit) {\n var _this3;\n\n if (typeof vars === \"number\") {\n position.duration = vars;\n vars = position;\n position = null;\n }\n\n _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;\n var _this3$vars = _this3.vars,\n duration = _this3$vars.duration,\n delay = _this3$vars.delay,\n immediateRender = _this3$vars.immediateRender,\n stagger = _this3$vars.stagger,\n overwrite = _this3$vars.overwrite,\n keyframes = _this3$vars.keyframes,\n defaults = _this3$vars.defaults,\n scrollTrigger = _this3$vars.scrollTrigger,\n yoyoEase = _this3$vars.yoyoEase,\n parent = vars.parent || _globalTimeline,\n parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : \"length\" in vars) ? [targets] : toArray(targets),\n tl,\n i,\n copy,\n l,\n p,\n curTarget,\n staggerFunc,\n staggerVarsToMerge;\n _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn(\"GSAP target \" + targets + \" not found. https://gsap.com\", !_config.nullTargetWarn) || [];\n _this3._ptLookup = []; //PropTween lookup. An array containing an object for each target, having keys for each tweening property\n\n _this3._overwrite = overwrite;\n\n if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n vars = _this3.vars;\n tl = _this3.timeline = new Timeline({\n data: \"nested\",\n defaults: defaults || {},\n targets: parent && parent.data === \"nested\" ? parent.vars.targets : parsedTargets\n }); // we need to store the targets because for staggers and keyframes, we end up creating an individual tween for each but function-based values need to know the index and the whole Array of targets.\n\n tl.kill();\n tl.parent = tl._dp = _assertThisInitialized(_this3);\n tl._start = 0;\n\n if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n l = parsedTargets.length;\n staggerFunc = stagger && distribute(stagger);\n\n if (_isObject(stagger)) {\n //users can pass in callbacks like onStart/onComplete in the stagger object. These should fire with each individual tween.\n for (p in stagger) {\n if (~_staggerTweenProps.indexOf(p)) {\n staggerVarsToMerge || (staggerVarsToMerge = {});\n staggerVarsToMerge[p] = stagger[p];\n }\n }\n }\n\n for (i = 0; i < l; i++) {\n copy = _copyExcluding(vars, _staggerPropsToSkip);\n copy.stagger = 0;\n yoyoEase && (copy.yoyoEase = yoyoEase);\n staggerVarsToMerge && _merge(copy, staggerVarsToMerge);\n curTarget = parsedTargets[i]; //don't just copy duration or delay because if they're a string or function, we'd end up in an infinite loop because _isFuncOrString() would evaluate as true in the child tweens, entering this loop, etc. So we parse the value straight from vars and default to 0.\n\n copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);\n copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;\n\n if (!stagger && l === 1 && copy.delay) {\n // if someone does delay:\"random(1, 5)\", repeat:-1, for example, the delay shouldn't be inside the repeat.\n _this3._delay = delay = copy.delay;\n _this3._start += delay;\n copy.delay = 0;\n }\n\n tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);\n tl._ease = _easeMap.none;\n }\n\n tl.duration() ? duration = delay = 0 : _this3.timeline = 0; // if the timeline's duration is 0, we don't need a timeline internally!\n } else if (keyframes) {\n _inheritDefaults(_setDefaults(tl.vars.defaults, {\n ease: \"none\"\n }));\n\n tl._ease = _parseEase(keyframes.ease || vars.ease || \"none\");\n var time = 0,\n a,\n kf,\n v;\n\n if (_isArray(keyframes)) {\n keyframes.forEach(function (frame) {\n return tl.to(parsedTargets, frame, \">\");\n });\n tl.duration(); // to ensure tl._dur is cached because we tap into it for performance purposes in the render() method.\n } else {\n copy = {};\n\n for (p in keyframes) {\n p === \"ease\" || p === \"easeEach\" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);\n }\n\n for (p in copy) {\n a = copy[p].sort(function (a, b) {\n return a.t - b.t;\n });\n time = 0;\n\n for (i = 0; i < a.length; i++) {\n kf = a[i];\n v = {\n ease: kf.e,\n duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration\n };\n v[p] = kf.v;\n tl.to(parsedTargets, v, time);\n time += v.duration;\n }\n }\n\n tl.duration() < duration && tl.to({}, {\n duration: duration - tl.duration()\n }); // in case keyframes didn't go to 100%\n }\n }\n\n duration || _this3.duration(duration = tl.duration());\n } else {\n _this3.timeline = 0; //speed optimization, faster lookups (no going up the prototype chain)\n }\n\n if (overwrite === true && !_suppressOverwrites) {\n _overwritingTween = _assertThisInitialized(_this3);\n\n _globalTimeline.killTweensOf(parsedTargets);\n\n _overwritingTween = 0;\n }\n\n _addToTimeline(parent, _assertThisInitialized(_this3), position);\n\n vars.reversed && _this3.reverse();\n vars.paused && _this3.paused(true);\n\n if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== \"nested\") {\n _this3._tTime = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\n _this3.render(Math.max(0, -delay) || 0); //in case delay is negative\n\n }\n\n scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);\n return _this3;\n }\n\n var _proto3 = Tween.prototype;\n\n _proto3.render = function render(totalTime, suppressEvents, force) {\n var prevTime = this._time,\n tDur = this._tDur,\n dur = this._dur,\n isNegative = totalTime < 0,\n tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime,\n time,\n pt,\n iteration,\n cycleDuration,\n prevIteration,\n isYoyo,\n ratio,\n timeline,\n yoyoEase;\n\n if (!dur) {\n _renderZeroDurationTween(this, totalTime, suppressEvents, force);\n } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) {\n // this senses if we're crossing over the start time, in which case we must record _zTime and force the render, but we do it in this lengthy conditional way for performance reasons (usually we can skip the calculations): this._initted && (this._zTime < 0) !== (totalTime < 0)\n time = tTime;\n timeline = this.timeline;\n\n if (this._repeat) {\n //adjust the time for repeats and yoyos\n cycleDuration = dur + this._rDelay;\n\n if (this._repeat < -1 && isNegative) {\n return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n }\n\n time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n if (tTime === tDur) {\n // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n iteration = this._repeat;\n time = dur;\n } else {\n prevIteration = _roundPrecise(tTime / cycleDuration); // full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)\n\n iteration = ~~prevIteration;\n\n if (iteration && iteration === prevIteration) {\n time = dur;\n iteration--;\n } else if (time > dur) {\n time = dur;\n }\n }\n\n isYoyo = this._yoyo && iteration & 1;\n\n if (isYoyo) {\n yoyoEase = this._yEase;\n time = dur - time;\n }\n\n prevIteration = _animationCycle(this._tTime, cycleDuration);\n\n if (time === prevTime && !force && this._initted && iteration === prevIteration) {\n //could be during the repeatDelay part. No need to render and fire callbacks.\n this._tTime = tTime;\n return this;\n }\n\n if (iteration !== prevIteration) {\n timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); //repeatRefresh functionality\n\n if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) {\n // this._time will === cycleDuration when we render at EXACTLY the end of an iteration. Without this condition, it'd often do the repeatRefresh render TWICE (again on the very next tick).\n this._lock = force = 1; //force, otherwise if lazy is true, the _attemptInitTween() will return and we'll jump out and get caught bouncing on each tick.\n\n this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;\n }\n }\n }\n\n if (!this._initted) {\n if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {\n this._tTime = 0; // in constructor if immediateRender is true, we set _tTime to -_tinyNum to have the playhead cross the starting point but we can't leave _tTime as a negative number.\n\n return this;\n }\n\n if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {\n // rare edge case - during initialization, an onUpdate in the _startAt (.fromTo()) might force this tween to render at a different spot in which case we should ditch this render() call so that it doesn't revert the values. But we also don't want to dump if we're doing a repeatRefresh render!\n return this;\n }\n\n if (dur !== this._dur) {\n // while initting, a plugin like InertiaPlugin might alter the duration, so rerun from the start to ensure everything renders as it should.\n return this.render(totalTime, suppressEvents, force);\n }\n }\n\n this._tTime = tTime;\n this._time = time;\n\n if (!this._act && this._ts) {\n this._act = 1; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n this._lazy = 0;\n }\n\n this.ratio = ratio = (yoyoEase || this._ease)(time / dur);\n\n if (this._from) {\n this.ratio = ratio = 1 - ratio;\n }\n\n if (!prevTime && tTime && !suppressEvents && !prevIteration) {\n _callback(this, \"onStart\");\n\n if (this._tTime !== tTime) {\n // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n return this;\n }\n }\n\n pt = this._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n\n timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);\n\n if (this._onUpdate && !suppressEvents) {\n isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\n _callback(this, \"onUpdate\");\n }\n\n this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n\n if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {\n isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);\n (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if we're rendering at exactly a time of 0, as there could be autoRevert values that should get set on the next tick (if the playhead goes backward beyond the startTime, negative totalTime). Don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {\n // if prevTime and tTime are zero, we shouldn't fire the onReverseComplete. This could happen if you gsap.to(... {paused:true}).play();\n _callback(this, tTime === tDur ? \"onComplete\" : \"onReverseComplete\", true);\n\n this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n }\n }\n }\n\n return this;\n };\n\n _proto3.targets = function targets() {\n return this._targets;\n };\n\n _proto3.invalidate = function invalidate(soft) {\n // \"soft\" gives us a way to clear out everything EXCEPT the recorded pre-\"from\" portion of from() tweens. Otherwise, for example, if you tween.progress(1).render(0, true true).invalidate(), the \"from\" values would persist and then on the next render, the from() tweens would initialize and the current value would match the \"from\" values, thus animate from the same value to the same value (no animation). We tap into this in ScrollTrigger's refresh() where we must push a tween to completion and then back again but honor its init state in case the tween is dependent on another tween further up on the page.\n (!soft || !this.vars.runBackwards) && (this._startAt = 0);\n this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;\n this._ptLookup = [];\n this.timeline && this.timeline.invalidate(soft);\n return _Animation2.prototype.invalidate.call(this, soft);\n };\n\n _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) {\n _tickerActive || _ticker.wake();\n this._ts || this.play();\n var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts),\n ratio;\n this._initted || _initTween(this, time);\n ratio = this._ease(time / this._dur); // don't just get tween.ratio because it may not have rendered yet.\n // possible future addition to allow an object with multiple values to update, like tween.resetTo({x: 100, y: 200}); At this point, it doesn't seem worth the added kb given the fact that most users will likely opt for the convenient gsap.quickTo() way of interacting with this method.\n // if (_isObject(property)) { // performance optimization\n // \tfor (p in property) {\n // \t\tif (_updatePropTweens(this, p, property[p], value ? value[p] : null, start, ratio, time)) {\n // \t\t\treturn this.resetTo(property, value, start, startIsRelative); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n // \t\t}\n // \t}\n // } else {\n\n if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) {\n return this.resetTo(property, value, start, startIsRelative, 1); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n } //}\n\n\n _alignPlayhead(this, 0);\n\n this.parent || _addLinkedListItem(this._dp, this, \"_first\", \"_last\", this._dp._sort ? \"_start\" : 0);\n return this.render(0);\n };\n\n _proto3.kill = function kill(targets, vars) {\n if (vars === void 0) {\n vars = \"all\";\n }\n\n if (!targets && (!vars || vars === \"all\")) {\n this._lazy = this._pt = 0;\n this.parent ? _interrupt(this) : this.scrollTrigger && this.scrollTrigger.kill(!!_reverting);\n return this;\n }\n\n if (this.timeline) {\n var tDur = this.timeline.totalDuration();\n this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); // if nothing is left tweening, interrupt.\n\n this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); // if a nested tween is killed that changes the duration, it should affect this tween's duration. We must use the ratio, though, because sometimes the internal timeline is stretched like for keyframes where they don't all add up to whatever the parent tween's duration was set to.\n\n return this;\n }\n\n var parsedTargets = this._targets,\n killingTargets = targets ? toArray(targets) : parsedTargets,\n propTweenLookup = this._ptLookup,\n firstPT = this._pt,\n overwrittenProps,\n curLookup,\n curOverwriteProps,\n props,\n p,\n pt,\n i;\n\n if ((!vars || vars === \"all\") && _arraysMatch(parsedTargets, killingTargets)) {\n vars === \"all\" && (this._pt = 0);\n return _interrupt(this);\n }\n\n overwrittenProps = this._op = this._op || [];\n\n if (vars !== \"all\") {\n //so people can pass in a comma-delimited list of property names\n if (_isString(vars)) {\n p = {};\n\n _forEachName(vars, function (name) {\n return p[name] = 1;\n });\n\n vars = p;\n }\n\n vars = _addAliasesToVars(parsedTargets, vars);\n }\n\n i = parsedTargets.length;\n\n while (i--) {\n if (~killingTargets.indexOf(parsedTargets[i])) {\n curLookup = propTweenLookup[i];\n\n if (vars === \"all\") {\n overwrittenProps[i] = vars;\n props = curLookup;\n curOverwriteProps = {};\n } else {\n curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};\n props = vars;\n }\n\n for (p in props) {\n pt = curLookup && curLookup[p];\n\n if (pt) {\n if (!(\"kill\" in pt.d) || pt.d.kill(p) === true) {\n _removeLinkedListItem(this, pt, \"_pt\");\n }\n\n delete curLookup[p];\n }\n\n if (curOverwriteProps !== \"all\") {\n curOverwriteProps[p] = 1;\n }\n }\n }\n }\n\n this._initted && !this._pt && firstPT && _interrupt(this); //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\n return this;\n };\n\n Tween.to = function to(targets, vars) {\n return new Tween(targets, vars, arguments[2]);\n };\n\n Tween.from = function from(targets, vars) {\n return _createTweenType(1, arguments);\n };\n\n Tween.delayedCall = function delayedCall(delay, callback, params, scope) {\n return new Tween(callback, 0, {\n immediateRender: false,\n lazy: false,\n overwrite: false,\n delay: delay,\n onComplete: callback,\n onReverseComplete: callback,\n onCompleteParams: params,\n onReverseCompleteParams: params,\n callbackScope: scope\n }); // we must use onReverseComplete too for things like timeline.add(() => {...}) which should be triggered in BOTH directions (forward and reverse)\n };\n\n Tween.fromTo = function fromTo(targets, fromVars, toVars) {\n return _createTweenType(2, arguments);\n };\n\n Tween.set = function set(targets, vars) {\n vars.duration = 0;\n vars.repeatDelay || (vars.repeat = 0);\n return new Tween(targets, vars);\n };\n\n Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n return _globalTimeline.killTweensOf(targets, props, onlyActive);\n };\n\n return Tween;\n}(Animation);\n\n_setDefaults(Tween.prototype, {\n _targets: [],\n _lazy: 0,\n _startAt: 0,\n _op: 0,\n _onInit: 0\n}); //add the pertinent timeline methods to Tween instances so that users can chain conveniently and create a timeline automatically. (removed due to concerns that it'd ultimately add to more confusion especially for beginners)\n// _forEachName(\"to,from,fromTo,set,call,add,addLabel,addPause\", name => {\n// \tTween.prototype[name] = function() {\n// \t\tlet tl = new Timeline();\n// \t\treturn _addToTimeline(tl, this)[name].apply(tl, toArray(arguments));\n// \t}\n// });\n//for backward compatibility. Leverage the timeline calls.\n\n\n_forEachName(\"staggerTo,staggerFrom,staggerFromTo\", function (name) {\n Tween[name] = function () {\n var tl = new Timeline(),\n params = _slice.call(arguments, 0);\n\n params.splice(name === \"staggerFromTo\" ? 5 : 4, 0, 0);\n return tl[name].apply(tl, params);\n };\n});\n/*\n * --------------------------------------------------------------------------------------\n * PROPTWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _setterPlain = function _setterPlain(target, property, value) {\n return target[property] = value;\n},\n _setterFunc = function _setterFunc(target, property, value) {\n return target[property](value);\n},\n _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) {\n return target[property](data.fp, value);\n},\n _setterAttribute = function _setterAttribute(target, property, value) {\n return target.setAttribute(property, value);\n},\n _getSetter = function _getSetter(target, property) {\n return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;\n},\n _renderPlain = function _renderPlain(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data);\n},\n _renderBoolean = function _renderBoolean(ratio, data) {\n return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);\n},\n _renderComplexString = function _renderComplexString(ratio, data) {\n var pt = data._pt,\n s = \"\";\n\n if (!ratio && data.b) {\n //b = beginning string\n s = data.b;\n } else if (ratio === 1 && data.e) {\n //e = ending string\n s = data.e;\n } else {\n while (pt) {\n s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; //we use the \"p\" property for the text inbetween (like a suffix). And in the context of a complex string, the modifier (m) is typically just Math.round(), like for RGB colors.\n\n pt = pt._next;\n }\n\n s += data.c; //we use the \"c\" of the PropTween to store the final chunk of non-numeric text.\n }\n\n data.set(data.t, data.p, s, data);\n},\n _renderPropTweens = function _renderPropTweens(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n},\n _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) {\n var pt = this._pt,\n next;\n\n while (pt) {\n next = pt._next;\n pt.p === property && pt.modifier(modifier, tween, target);\n pt = next;\n }\n},\n _killPropTweensOf = function _killPropTweensOf(property) {\n var pt = this._pt,\n hasNonDependentRemaining,\n next;\n\n while (pt) {\n next = pt._next;\n\n if (pt.p === property && !pt.op || pt.op === property) {\n _removeLinkedListItem(this, pt, \"_pt\");\n } else if (!pt.dep) {\n hasNonDependentRemaining = 1;\n }\n\n pt = next;\n }\n\n return !hasNonDependentRemaining;\n},\n _setterWithModifier = function _setterWithModifier(target, property, value, data) {\n data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);\n},\n _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) {\n var pt = parent._pt,\n next,\n pt2,\n first,\n last; //sorts the PropTween linked list in order of priority because some plugins need to do their work after ALL of the PropTweens were created (like RoundPropsPlugin and ModifiersPlugin)\n\n while (pt) {\n next = pt._next;\n pt2 = first;\n\n while (pt2 && pt2.pr > pt.pr) {\n pt2 = pt2._next;\n }\n\n if (pt._prev = pt2 ? pt2._prev : last) {\n pt._prev._next = pt;\n } else {\n first = pt;\n }\n\n if (pt._next = pt2) {\n pt2._prev = pt;\n } else {\n last = pt;\n }\n\n pt = next;\n }\n\n parent._pt = first;\n}; //PropTween key: t = target, p = prop, r = renderer, d = data, s = start, c = change, op = overwriteProperty (ONLY populated when it's different than p), pr = priority, _next/_prev for the linked list siblings, set = setter, m = modifier, mSet = modifierSetter (the original setter, before a modifier was added)\n\n\nexport var PropTween = /*#__PURE__*/function () {\n function PropTween(next, target, prop, start, change, renderer, data, setter, priority) {\n this.t = target;\n this.s = start;\n this.c = change;\n this.p = prop;\n this.r = renderer || _renderPlain;\n this.d = data || this;\n this.set = setter || _setterPlain;\n this.pr = priority || 0;\n this._next = next;\n\n if (next) {\n next._prev = this;\n }\n }\n\n var _proto4 = PropTween.prototype;\n\n _proto4.modifier = function modifier(func, tween, target) {\n this.mSet = this.mSet || this.set; //in case it was already set (a PropTween can only have one modifier)\n\n this.set = _setterWithModifier;\n this.m = func;\n this.mt = target; //modifier target\n\n this.tween = tween;\n };\n\n return PropTween;\n}(); //Initialization tasks\n\n_forEachName(_callbackNames + \"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger\", function (name) {\n return _reservedProps[name] = 1;\n});\n\n_globals.TweenMax = _globals.TweenLite = Tween;\n_globals.TimelineLite = _globals.TimelineMax = Timeline;\n_globalTimeline = new Timeline({\n sortChildren: false,\n defaults: _defaults,\n autoRemoveChildren: true,\n id: \"root\",\n smoothChildTiming: true\n});\n_config.stringFilter = _colorStringFilter;\n\nvar _media = [],\n _listeners = {},\n _emptyArray = [],\n _lastMediaTime = 0,\n _contextID = 0,\n _dispatch = function _dispatch(type) {\n return (_listeners[type] || _emptyArray).map(function (f) {\n return f();\n });\n},\n _onMediaChange = function _onMediaChange() {\n var time = Date.now(),\n matches = [];\n\n if (time - _lastMediaTime > 2) {\n _dispatch(\"matchMediaInit\");\n\n _media.forEach(function (c) {\n var queries = c.queries,\n conditions = c.conditions,\n match,\n p,\n anyMatch,\n toggled;\n\n for (p in queries) {\n match = _win.matchMedia(queries[p]).matches; // Firefox doesn't update the \"matches\" property of the MediaQueryList object correctly - it only does so as it calls its change handler - so we must re-create a media query here to ensure it's accurate.\n\n match && (anyMatch = 1);\n\n if (match !== conditions[p]) {\n conditions[p] = match;\n toggled = 1;\n }\n }\n\n if (toggled) {\n c.revert();\n anyMatch && matches.push(c);\n }\n });\n\n _dispatch(\"matchMediaRevert\");\n\n matches.forEach(function (c) {\n return c.onMatch(c, function (func) {\n return c.add(null, func);\n });\n });\n _lastMediaTime = time;\n\n _dispatch(\"matchMedia\");\n }\n};\n\nvar Context = /*#__PURE__*/function () {\n function Context(func, scope) {\n this.selector = scope && selector(scope);\n this.data = [];\n this._r = []; // returned/cleanup functions\n\n this.isReverted = false;\n this.id = _contextID++; // to work around issues that frameworks like Vue cause by making things into Proxies which make it impossible to do something like _media.indexOf(this) because \"this\" would no longer refer to the Context instance itself - it'd refer to a Proxy! We needed a way to identify the context uniquely\n\n func && this.add(func);\n }\n\n var _proto5 = Context.prototype;\n\n _proto5.add = function add(name, func, scope) {\n // possible future addition if we need the ability to add() an animation to a context and for whatever reason cannot create that animation inside of a context.add(() => {...}) function.\n // if (name && _isFunction(name.revert)) {\n // \tthis.data.push(name);\n // \treturn (name._ctx = this);\n // }\n if (_isFunction(name)) {\n scope = func;\n func = name;\n name = _isFunction;\n }\n\n var self = this,\n f = function f() {\n var prev = _context,\n prevSelector = self.selector,\n result;\n prev && prev !== self && prev.data.push(self);\n scope && (self.selector = selector(scope));\n _context = self;\n result = func.apply(self, arguments);\n _isFunction(result) && self._r.push(result);\n _context = prev;\n self.selector = prevSelector;\n self.isReverted = false;\n return result;\n };\n\n self.last = f;\n return name === _isFunction ? f(self, function (func) {\n return self.add(null, func);\n }) : name ? self[name] = f : f;\n };\n\n _proto5.ignore = function ignore(func) {\n var prev = _context;\n _context = null;\n func(this);\n _context = prev;\n };\n\n _proto5.getTweens = function getTweens() {\n var a = [];\n this.data.forEach(function (e) {\n return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === \"nested\") && a.push(e);\n });\n return a;\n };\n\n _proto5.clear = function clear() {\n this._r.length = this.data.length = 0;\n };\n\n _proto5.kill = function kill(revert, matchMedia) {\n var _this4 = this;\n\n if (revert) {\n (function () {\n var tweens = _this4.getTweens(),\n i = _this4.data.length,\n t;\n\n while (i--) {\n // Flip plugin tweens are very different in that they should actually be pushed to their end. The plugin replaces the timeline's .revert() method to do exactly that. But we also need to remove any of those nested tweens inside the flip timeline so that they don't get individually reverted.\n t = _this4.data[i];\n\n if (t.data === \"isFlip\") {\n t.revert();\n t.getChildren(true, true, false).forEach(function (tween) {\n return tweens.splice(tweens.indexOf(tween), 1);\n });\n }\n } // save as an object so that we can cache the globalTime for each tween to optimize performance during the sort\n\n\n tweens.map(function (t) {\n return {\n g: t._dur || t._delay || t._sat && !t._sat.vars.immediateRender ? t.globalTime(0) : -Infinity,\n t: t\n };\n }).sort(function (a, b) {\n return b.g - a.g || -Infinity;\n }).forEach(function (o) {\n return o.t.revert(revert);\n }); // note: all of the _startAt tweens should be reverted in reverse order that they were created, and they'll all have the same globalTime (-1) so the \" || -1\" in the sort keeps the order properly.\n\n i = _this4.data.length;\n\n while (i--) {\n // make sure we loop backwards so that, for example, SplitTexts that were created later on the same element get reverted first\n t = _this4.data[i];\n\n if (t instanceof Timeline) {\n if (t.data !== \"nested\") {\n t.scrollTrigger && t.scrollTrigger.revert();\n t.kill(); // don't revert() the timeline because that's duplicating efforts since we already reverted all the tweens\n }\n } else {\n !(t instanceof Tween) && t.revert && t.revert(revert);\n }\n }\n\n _this4._r.forEach(function (f) {\n return f(revert, _this4);\n });\n\n _this4.isReverted = true;\n })();\n } else {\n this.data.forEach(function (e) {\n return e.kill && e.kill();\n });\n }\n\n this.clear();\n\n if (matchMedia) {\n var i = _media.length;\n\n while (i--) {\n // previously, we checked _media.indexOf(this), but some frameworks like Vue enforce Proxy objects that make it impossible to get the proper result that way, so we must use a unique ID number instead.\n _media[i].id === this.id && _media.splice(i, 1);\n }\n }\n } // killWithCleanup() {\n // \tthis.kill();\n // \tthis._r.forEach(f => f(false, this));\n // }\n ;\n\n _proto5.revert = function revert(config) {\n this.kill(config || {});\n };\n\n return Context;\n}();\n\nvar MatchMedia = /*#__PURE__*/function () {\n function MatchMedia(scope) {\n this.contexts = [];\n this.scope = scope;\n _context && _context.data.push(this);\n }\n\n var _proto6 = MatchMedia.prototype;\n\n _proto6.add = function add(conditions, func, scope) {\n _isObject(conditions) || (conditions = {\n matches: conditions\n });\n var context = new Context(0, scope || this.scope),\n cond = context.conditions = {},\n mq,\n p,\n active;\n _context && !context.selector && (context.selector = _context.selector); // in case a context is created inside a context. Like a gsap.matchMedia() that's inside a scoped gsap.context()\n\n this.contexts.push(context);\n func = context.add(\"onMatch\", func);\n context.queries = conditions;\n\n for (p in conditions) {\n if (p === \"all\") {\n active = 1;\n } else {\n mq = _win.matchMedia(conditions[p]);\n\n if (mq) {\n _media.indexOf(context) < 0 && _media.push(context);\n (cond[p] = mq.matches) && (active = 1);\n mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener(\"change\", _onMediaChange);\n }\n }\n }\n\n active && func(context, function (f) {\n return context.add(null, f);\n });\n return this;\n } // refresh() {\n // \tlet time = _lastMediaTime,\n // \t\tmedia = _media;\n // \t_lastMediaTime = -1;\n // \t_media = this.contexts;\n // \t_onMediaChange();\n // \t_lastMediaTime = time;\n // \t_media = media;\n // }\n ;\n\n _proto6.revert = function revert(config) {\n this.kill(config || {});\n };\n\n _proto6.kill = function kill(revert) {\n this.contexts.forEach(function (c) {\n return c.kill(revert, true);\n });\n };\n\n return MatchMedia;\n}();\n/*\n * --------------------------------------------------------------------------------------\n * GSAP\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _gsap = {\n registerPlugin: function registerPlugin() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n args.forEach(function (config) {\n return _createPlugin(config);\n });\n },\n timeline: function timeline(vars) {\n return new Timeline(vars);\n },\n getTweensOf: function getTweensOf(targets, onlyActive) {\n return _globalTimeline.getTweensOf(targets, onlyActive);\n },\n getProperty: function getProperty(target, property, unit, uncache) {\n _isString(target) && (target = toArray(target)[0]); //in case selector text or an array is passed in\n\n var getter = _getCache(target || {}).get,\n format = unit ? _passThrough : _numericIfPossible;\n\n unit === \"native\" && (unit = \"\");\n return !target ? target : !property ? function (property, unit, uncache) {\n return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n },\n quickSetter: function quickSetter(target, property, unit) {\n target = toArray(target);\n\n if (target.length > 1) {\n var setters = target.map(function (t) {\n return gsap.quickSetter(t, property, unit);\n }),\n l = setters.length;\n return function (value) {\n var i = l;\n\n while (i--) {\n setters[i](value);\n }\n };\n }\n\n target = target[0] || {};\n\n var Plugin = _plugins[property],\n cache = _getCache(target),\n p = cache.harness && (cache.harness.aliases || {})[property] || property,\n // in case it's an alias, like \"rotate\" for \"rotation\".\n setter = Plugin ? function (value) {\n var p = new Plugin();\n _quickTween._pt = 0;\n p.init(target, unit ? value + unit : value, _quickTween, 0, [target]);\n p.render(1, p);\n _quickTween._pt && _renderPropTweens(1, _quickTween);\n } : cache.set(target, p);\n\n return Plugin ? setter : function (value) {\n return setter(target, p, unit ? value + unit : value, cache, 1);\n };\n },\n quickTo: function quickTo(target, property, vars) {\n var _setDefaults2;\n\n var tween = gsap.to(target, _setDefaults((_setDefaults2 = {}, _setDefaults2[property] = \"+=0.1\", _setDefaults2.paused = true, _setDefaults2.stagger = 0, _setDefaults2), vars || {})),\n func = function func(value, start, startIsRelative) {\n return tween.resetTo(property, value, start, startIsRelative);\n };\n\n func.tween = tween;\n return func;\n },\n isTweening: function isTweening(targets) {\n return _globalTimeline.getTweensOf(targets, true).length > 0;\n },\n defaults: function defaults(value) {\n value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));\n return _mergeDeep(_defaults, value || {});\n },\n config: function config(value) {\n return _mergeDeep(_config, value || {});\n },\n registerEffect: function registerEffect(_ref3) {\n var name = _ref3.name,\n effect = _ref3.effect,\n plugins = _ref3.plugins,\n defaults = _ref3.defaults,\n extendTimeline = _ref3.extendTimeline;\n (plugins || \"\").split(\",\").forEach(function (pluginName) {\n return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + \" effect requires \" + pluginName + \" plugin.\");\n });\n\n _effects[name] = function (targets, vars, tl) {\n return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl);\n };\n\n if (extendTimeline) {\n Timeline.prototype[name] = function (targets, vars, position) {\n return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);\n };\n }\n },\n registerEase: function registerEase(name, ease) {\n _easeMap[name] = _parseEase(ease);\n },\n parseEase: function parseEase(ease, defaultEase) {\n return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;\n },\n getById: function getById(id) {\n return _globalTimeline.getById(id);\n },\n exportRoot: function exportRoot(vars, includeDelayedCalls) {\n if (vars === void 0) {\n vars = {};\n }\n\n var tl = new Timeline(vars),\n child,\n next;\n tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);\n\n _globalTimeline.remove(tl);\n\n tl._dp = 0; //otherwise it'll get re-activated when adding children and be re-introduced into _globalTimeline's linked list (then added to itself).\n\n tl._time = tl._tTime = _globalTimeline._time;\n child = _globalTimeline._first;\n\n while (child) {\n next = child._next;\n\n if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {\n _addToTimeline(tl, child, child._start - child._delay);\n }\n\n child = next;\n }\n\n _addToTimeline(_globalTimeline, tl, 0);\n\n return tl;\n },\n context: function context(func, scope) {\n return func ? new Context(func, scope) : _context;\n },\n matchMedia: function matchMedia(scope) {\n return new MatchMedia(scope);\n },\n matchMediaRefresh: function matchMediaRefresh() {\n return _media.forEach(function (c) {\n var cond = c.conditions,\n found,\n p;\n\n for (p in cond) {\n if (cond[p]) {\n cond[p] = false;\n found = 1;\n }\n }\n\n found && c.revert();\n }) || _onMediaChange();\n },\n addEventListener: function addEventListener(type, callback) {\n var a = _listeners[type] || (_listeners[type] = []);\n ~a.indexOf(callback) || a.push(callback);\n },\n removeEventListener: function removeEventListener(type, callback) {\n var a = _listeners[type],\n i = a && a.indexOf(callback);\n i >= 0 && a.splice(i, 1);\n },\n utils: {\n wrap: wrap,\n wrapYoyo: wrapYoyo,\n distribute: distribute,\n random: random,\n snap: snap,\n normalize: normalize,\n getUnit: getUnit,\n clamp: clamp,\n splitColor: splitColor,\n toArray: toArray,\n selector: selector,\n mapRange: mapRange,\n pipe: pipe,\n unitize: unitize,\n interpolate: interpolate,\n shuffle: shuffle\n },\n install: _install,\n effects: _effects,\n ticker: _ticker,\n updateRoot: Timeline.updateRoot,\n plugins: _plugins,\n globalTimeline: _globalTimeline,\n core: {\n PropTween: PropTween,\n globals: _addGlobal,\n Tween: Tween,\n Timeline: Timeline,\n Animation: Animation,\n getCache: _getCache,\n _removeLinkedListItem: _removeLinkedListItem,\n reverting: function reverting() {\n return _reverting;\n },\n context: function context(toAdd) {\n if (toAdd && _context) {\n _context.data.push(toAdd);\n\n toAdd._ctx = _context;\n }\n\n return _context;\n },\n suppressOverwrites: function suppressOverwrites(value) {\n return _suppressOverwrites = value;\n }\n }\n};\n\n_forEachName(\"to,from,fromTo,delayedCall,set,killTweensOf\", function (name) {\n return _gsap[name] = Tween[name];\n});\n\n_ticker.add(Timeline.updateRoot);\n\n_quickTween = _gsap.to({}, {\n duration: 0\n}); // ---- EXTRA PLUGINS --------------------------------------------------------\n\nvar _getPluginPropTween = function _getPluginPropTween(plugin, prop) {\n var pt = plugin._pt;\n\n while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {\n pt = pt._next;\n }\n\n return pt;\n},\n _addModifiers = function _addModifiers(tween, modifiers) {\n var targets = tween._targets,\n p,\n i,\n pt;\n\n for (p in modifiers) {\n i = targets.length;\n\n while (i--) {\n pt = tween._ptLookup[i][p];\n\n if (pt && (pt = pt.d)) {\n if (pt._pt) {\n // is a plugin\n pt = _getPluginPropTween(pt, p);\n }\n\n pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);\n }\n }\n }\n},\n _buildModifierPlugin = function _buildModifierPlugin(name, modifier) {\n return {\n name: name,\n headless: 1,\n rawVars: 1,\n //don't pre-process function-based values or \"random()\" strings.\n init: function init(target, vars, tween) {\n tween._onInit = function (tween) {\n var temp, p;\n\n if (_isString(vars)) {\n temp = {};\n\n _forEachName(vars, function (name) {\n return temp[name] = 1;\n }); //if the user passes in a comma-delimited list of property names to roundProps, like \"x,y\", we round to whole numbers.\n\n\n vars = temp;\n }\n\n if (modifier) {\n temp = {};\n\n for (p in vars) {\n temp[p] = modifier(vars[p]);\n }\n\n vars = temp;\n }\n\n _addModifiers(tween, vars);\n };\n }\n };\n}; //register core plugins\n\n\nexport var gsap = _gsap.registerPlugin({\n name: \"attr\",\n init: function init(target, vars, tween, index, targets) {\n var p, pt, v;\n this.tween = tween;\n\n for (p in vars) {\n v = target.getAttribute(p) || \"\";\n pt = this.add(target, \"setAttribute\", (v || 0) + \"\", vars[p], index, targets, 0, 0, p);\n pt.op = p;\n pt.b = v; // record the beginning value so we can revert()\n\n this._props.push(p);\n }\n },\n render: function render(ratio, data) {\n var pt = data._pt;\n\n while (pt) {\n _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); // if reverting, go back to the original (pt.b)\n\n pt = pt._next;\n }\n }\n}, {\n name: \"endArray\",\n headless: 1,\n init: function init(target, value) {\n var i = value.length;\n\n while (i--) {\n this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);\n }\n }\n}, _buildModifierPlugin(\"roundProps\", _roundModifier), _buildModifierPlugin(\"modifiers\"), _buildModifierPlugin(\"snap\", snap)) || _gsap; //to prevent the core plugins from being dropped via aggressive tree shaking, we must include them in the variable declaration in this way.\n\nTween.version = Timeline.version = gsap.version = \"3.14.2\";\n_coreReady = 1;\n_windowExists() && _wake();\nvar Power0 = _easeMap.Power0,\n Power1 = _easeMap.Power1,\n Power2 = _easeMap.Power2,\n Power3 = _easeMap.Power3,\n Power4 = _easeMap.Power4,\n Linear = _easeMap.Linear,\n Quad = _easeMap.Quad,\n Cubic = _easeMap.Cubic,\n Quart = _easeMap.Quart,\n Quint = _easeMap.Quint,\n Strong = _easeMap.Strong,\n Elastic = _easeMap.Elastic,\n Back = _easeMap.Back,\n SteppedEase = _easeMap.SteppedEase,\n Bounce = _easeMap.Bounce,\n Sine = _easeMap.Sine,\n Expo = _easeMap.Expo,\n Circ = _easeMap.Circ;\nexport { Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };\nexport { Tween as TweenMax, Tween as TweenLite, Timeline as TimelineMax, Timeline as TimelineLite, gsap as default, wrap, wrapYoyo, distribute, random, snap, normalize, getUnit, clamp, splitColor, toArray, selector, mapRange, pipe, unitize, interpolate, shuffle }; //export some internal methods/orojects for use in CSSPlugin so that we can externalize that file and allow custom builds that exclude it.\n\nexport { _getProperty, _numExp, _numWithUnitExp, _isString, _isUndefined, _renderComplexString, _relExp, _setDefaults, _removeLinkedListItem, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _replaceRandom, _checkPlugin, _plugins, _ticker, _config, _roundModifier, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative };","/*!\n * CSSPlugin 3.14.2\n * https://gsap.com\n *\n * Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nimport { gsap, _getProperty, _numExp, _numWithUnitExp, getUnit, _isString, _isUndefined, _renderComplexString, _relExp, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _checkPlugin, _replaceRandom, _plugins, GSCache, PropTween, _config, _ticker, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative, _setDefaults, _removeLinkedListItem //for the commented-out className feature.\n} from \"./gsap-core.js\";\n\nvar _win,\n _doc,\n _docElement,\n _pluginInitted,\n _tempDiv,\n _tempDivStyler,\n _recentSetterPlugin,\n _reverting,\n _windowExists = function _windowExists() {\n return typeof window !== \"undefined\";\n},\n _transformProps = {},\n _RAD2DEG = 180 / Math.PI,\n _DEG2RAD = Math.PI / 180,\n _atan2 = Math.atan2,\n _bigNum = 1e8,\n _capsExp = /([A-Z])/g,\n _horizontalExp = /(left|right|width|margin|padding|x)/i,\n _complexExp = /[\\s,\\(]\\S/,\n _propertyAliases = {\n autoAlpha: \"opacity,visibility\",\n scale: \"scaleX,scaleY\",\n alpha: \"opacity\"\n},\n _renderCSSProp = function _renderCSSProp(ratio, data) {\n return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderPropWithEnd = function _renderPropWithEnd(ratio, data) {\n return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) {\n return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data);\n},\n //if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)\n_renderCSSPropWithBeginningAndEnd = function _renderCSSPropWithBeginningAndEnd(ratio, data) {\n return data.set(data.t, data.p, ratio === 1 ? data.e : ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data);\n},\n //if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)\n_renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) {\n var value = data.s + data.c * ratio;\n data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data);\n},\n _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) {\n return data.set(data.t, data.p, ratio ? data.e : data.b, data);\n},\n _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) {\n return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);\n},\n _setterCSSStyle = function _setterCSSStyle(target, property, value) {\n return target.style[property] = value;\n},\n _setterCSSProp = function _setterCSSProp(target, property, value) {\n return target.style.setProperty(property, value);\n},\n _setterTransform = function _setterTransform(target, property, value) {\n return target._gsap[property] = value;\n},\n _setterScale = function _setterScale(target, property, value) {\n return target._gsap.scaleX = target._gsap.scaleY = value;\n},\n _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache.scaleX = cache.scaleY = value;\n cache.renderTransform(ratio, cache);\n},\n _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) {\n var cache = target._gsap;\n cache[property] = value;\n cache.renderTransform(ratio, cache);\n},\n _transformProp = \"transform\",\n _transformOriginProp = _transformProp + \"Origin\",\n _saveStyle = function _saveStyle(property, isNotCSS) {\n var _this = this;\n\n var target = this.target,\n style = target.style,\n cache = target._gsap;\n\n if (property in _transformProps && style) {\n this.tfm = this.tfm || {};\n\n if (property !== \"transform\") {\n property = _propertyAliases[property] || property;\n ~property.indexOf(\",\") ? property.split(\",\").forEach(function (a) {\n return _this.tfm[a] = _get(target, a);\n }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); // note: scale would map to \"scaleX,scaleY\", thus we loop and apply them both.\n\n property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);\n } else {\n return _propertyAliases.transform.split(\",\").forEach(function (p) {\n return _saveStyle.call(_this, p, isNotCSS);\n });\n }\n\n if (this.props.indexOf(_transformProp) >= 0) {\n return;\n }\n\n if (cache.svg) {\n this.svgo = target.getAttribute(\"data-svg-origin\");\n this.props.push(_transformOriginProp, isNotCSS, \"\");\n }\n\n property = _transformProp;\n }\n\n (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);\n},\n _removeIndependentTransforms = function _removeIndependentTransforms(style) {\n if (style.translate) {\n style.removeProperty(\"translate\");\n style.removeProperty(\"scale\");\n style.removeProperty(\"rotate\");\n }\n},\n _revertStyle = function _revertStyle() {\n var props = this.props,\n target = this.target,\n style = target.style,\n cache = target._gsap,\n i,\n p;\n\n for (i = 0; i < props.length; i += 3) {\n // stored like this: property, isNotCSS, value\n if (!props[i + 1]) {\n props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === \"--\" ? props[i] : props[i].replace(_capsExp, \"-$1\").toLowerCase());\n } else if (props[i + 1] === 2) {\n // non-CSS value (function-based)\n target[props[i]](props[i + 2]);\n } else {\n // non-CSS value (not function-based)\n target[props[i]] = props[i + 2];\n }\n }\n\n if (this.tfm) {\n for (p in this.tfm) {\n cache[p] = this.tfm[p];\n }\n\n if (cache.svg) {\n cache.renderTransform();\n target.setAttribute(\"data-svg-origin\", this.svgo || \"\");\n }\n\n i = _reverting();\n\n if ((!i || !i.isStart) && !style[_transformProp]) {\n _removeIndependentTransforms(style);\n\n if (cache.zOrigin && style[_transformOriginProp]) {\n style[_transformOriginProp] += \" \" + cache.zOrigin + \"px\"; // since we're uncaching, we must put the zOrigin back into the transformOrigin so that we can pull it out accurately when we parse again. Otherwise, we'd lose the z portion of the origin since we extract it to protect from Safari bugs.\n\n cache.zOrigin = 0;\n cache.renderTransform();\n }\n\n cache.uncache = 1; // if it's a startAt that's being reverted in the _initTween() of the core, we don't need to uncache transforms. This is purely a performance optimization.\n }\n }\n},\n _getStyleSaver = function _getStyleSaver(target, properties) {\n var saver = {\n target: target,\n props: [],\n revert: _revertStyle,\n save: _saveStyle\n };\n target._gsap || gsap.core.getCache(target); // just make sure there's a _gsap cache defined because we read from it in _saveStyle() and it's more efficient to just check it here once.\n\n properties && target.style && target.nodeType && properties.split(\",\").forEach(function (p) {\n return saver.save(p);\n }); // make sure it's a DOM node too.\n\n return saver;\n},\n _supports3D,\n _createElement = function _createElement(type, ns) {\n var e = _doc.createElementNS ? _doc.createElementNS((ns || \"http://www.w3.org/1999/xhtml\").replace(/^https/, \"http\"), type) : _doc.createElement(type); //some servers swap in https for http in the namespace which can break things, making \"style\" inaccessible.\n\n return e && e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://gsap.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/).\n},\n _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) {\n var cs = getComputedStyle(target);\n return cs[property] || cs.getPropertyValue(property.replace(_capsExp, \"-$1\").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || \"\"; //css variables may not need caps swapped out for dashes and lowercase.\n},\n _prefixes = \"O,Moz,ms,Ms,Webkit\".split(\",\"),\n _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) {\n var e = element || _tempDiv,\n s = e.style,\n i = 5;\n\n if (property in s && !preferPrefix) {\n return property;\n }\n\n property = property.charAt(0).toUpperCase() + property.substr(1);\n\n while (i-- && !(_prefixes[i] + property in s)) {}\n\n return i < 0 ? null : (i === 3 ? \"ms\" : i >= 0 ? _prefixes[i] : \"\") + property;\n},\n _initCore = function _initCore() {\n if (_windowExists() && window.document) {\n _win = window;\n _doc = _win.document;\n _docElement = _doc.documentElement;\n _tempDiv = _createElement(\"div\") || {\n style: {}\n };\n _tempDivStyler = _createElement(\"div\");\n _transformProp = _checkPropPrefix(_transformProp);\n _transformOriginProp = _transformProp + \"Origin\";\n _tempDiv.style.cssText = \"border-width:0;line-height:0;position:absolute;padding:0\"; //make sure to override certain properties that may contaminate measurements, in case the user has overreaching style sheets.\n\n _supports3D = !!_checkPropPrefix(\"perspective\");\n _reverting = gsap.core.reverting;\n _pluginInitted = 1;\n }\n},\n _getReparentedCloneBBox = function _getReparentedCloneBBox(target) {\n //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it).\n var owner = target.ownerSVGElement,\n svg = _createElement(\"svg\", owner && owner.getAttribute(\"xmlns\") || \"http://www.w3.org/2000/svg\"),\n clone = target.cloneNode(true),\n bbox;\n\n clone.style.display = \"block\";\n svg.appendChild(clone);\n\n _docElement.appendChild(svg);\n\n try {\n bbox = clone.getBBox();\n } catch (e) {}\n\n svg.removeChild(clone);\n\n _docElement.removeChild(svg);\n\n return bbox;\n},\n _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) {\n var i = attributesArray.length;\n\n while (i--) {\n if (target.hasAttribute(attributesArray[i])) {\n return target.getAttribute(attributesArray[i]);\n }\n }\n},\n _getBBox = function _getBBox(target) {\n var bounds, cloned;\n\n try {\n bounds = target.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118\n } catch (error) {\n bounds = _getReparentedCloneBBox(target);\n cloned = 1;\n }\n\n bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target)); //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case.\n\n return bounds && !bounds.width && !bounds.x && !bounds.y ? {\n x: +_getAttributeFallbacks(target, [\"x\", \"cx\", \"x1\"]) || 0,\n y: +_getAttributeFallbacks(target, [\"y\", \"cy\", \"y1\"]) || 0,\n width: 0,\n height: 0\n } : bounds;\n},\n _isSVG = function _isSVG(e) {\n return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));\n},\n //reports if the element is an SVG on which getBBox() actually works\n_removeProperty = function _removeProperty(target, property) {\n if (property) {\n var style = target.style,\n first2Chars;\n\n if (property in _transformProps && property !== _transformOriginProp) {\n property = _transformProp;\n }\n\n if (style.removeProperty) {\n first2Chars = property.substr(0, 2);\n\n if (first2Chars === \"ms\" || property.substr(0, 6) === \"webkit\") {\n //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be \"ms-transform\" instead of \"-ms-transform\" for IE9, for example)\n property = \"-\" + property;\n }\n\n style.removeProperty(first2Chars === \"--\" ? property : property.replace(_capsExp, \"-$1\").toLowerCase());\n } else {\n //note: old versions of IE use \"removeAttribute()\" instead of \"removeProperty()\"\n style.removeAttribute(property);\n }\n }\n},\n _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) {\n var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);\n plugin._pt = pt;\n pt.b = beginning;\n pt.e = end;\n\n plugin._props.push(property);\n\n return pt;\n},\n _nonConvertibleUnits = {\n deg: 1,\n rad: 1,\n turn: 1\n},\n _nonStandardLayouts = {\n grid: 1,\n flex: 1\n},\n //takes a single value like 20px and converts it to the unit specified, like \"%\", returning only the numeric amount.\n_convertToUnit = function _convertToUnit(target, property, value, unit) {\n var curValue = parseFloat(value) || 0,\n curUnit = (value + \"\").trim().substr((curValue + \"\").length) || \"px\",\n // some browsers leave extra whitespace at the beginning of CSS variables, hence the need to trim()\n style = _tempDiv.style,\n horizontal = _horizontalExp.test(property),\n isRootSVG = target.tagName.toLowerCase() === \"svg\",\n measureProperty = (isRootSVG ? \"client\" : \"offset\") + (horizontal ? \"Width\" : \"Height\"),\n amount = 100,\n toPixels = unit === \"px\",\n toPercent = unit === \"%\",\n px,\n parent,\n cache,\n isSVG;\n\n if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {\n return curValue;\n }\n\n curUnit !== \"px\" && !toPixels && (curValue = _convertToUnit(target, property, value, \"px\"));\n isSVG = target.getCTM && _isSVG(target);\n\n if ((toPercent || curUnit === \"%\") && (_transformProps[property] || ~property.indexOf(\"adius\"))) {\n px = isSVG ? target.getBBox()[horizontal ? \"width\" : \"height\"] : target[measureProperty];\n return _round(toPercent ? curValue / px * amount : curValue / 100 * px);\n }\n\n style[horizontal ? \"width\" : \"height\"] = amount + (toPixels ? curUnit : unit);\n parent = unit !== \"rem\" && ~property.indexOf(\"adius\") || unit === \"em\" && target.appendChild && !isRootSVG ? target : target.parentNode;\n\n if (isSVG) {\n parent = (target.ownerSVGElement || {}).parentNode;\n }\n\n if (!parent || parent === _doc || !parent.appendChild) {\n parent = _doc.body;\n }\n\n cache = parent._gsap;\n\n if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {\n return _round(curValue / cache.width * amount);\n } else {\n if (toPercent && (property === \"height\" || property === \"width\")) {\n // if we're dealing with width/height that's inside a container with padding and/or it's a flexbox/grid container, we must apply it to the target itself rather than the _tempDiv in order to ensure complete accuracy, factoring in the parent's padding.\n var v = target.style[property];\n target.style[property] = amount + unit;\n px = target[measureProperty];\n v ? target.style[property] = v : _removeProperty(target, property);\n } else {\n (toPercent || curUnit === \"%\") && !_nonStandardLayouts[_getComputedProperty(parent, \"display\")] && (style.position = _getComputedProperty(target, \"position\"));\n parent === target && (style.position = \"static\"); // like for borderRadius, if it's a % we must have it relative to the target itself but that may not have position: relative or position: absolute in which case it'd go up the chain until it finds its offsetParent (bad). position: static protects against that.\n\n parent.appendChild(_tempDiv);\n px = _tempDiv[measureProperty];\n parent.removeChild(_tempDiv);\n style.position = \"absolute\";\n }\n\n if (horizontal && toPercent) {\n cache = _getCache(parent);\n cache.time = _ticker.time;\n cache.width = parent[measureProperty];\n }\n }\n\n return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);\n},\n _get = function _get(target, property, unit, uncache) {\n var value;\n _pluginInitted || _initCore();\n\n if (property in _propertyAliases && property !== \"transform\") {\n property = _propertyAliases[property];\n\n if (~property.indexOf(\",\")) {\n property = property.split(\",\")[0];\n }\n }\n\n if (_transformProps[property] && property !== \"transform\") {\n value = _parseTransform(target, uncache);\n value = property !== \"transformOrigin\" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + \" \" + value.zOrigin + \"px\";\n } else {\n value = target.style[property];\n\n if (!value || value === \"auto\" || uncache || ~(value + \"\").indexOf(\"calc(\")) {\n value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === \"opacity\" ? 1 : 0); // note: some browsers, like Firefox, don't report borderRadius correctly! Instead, it only reports every corner like borderTopLeftRadius\n }\n }\n\n return unit && !~(value + \"\").trim().indexOf(\" \") ? _convertToUnit(target, property, value, unit) + unit : value;\n},\n _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) {\n // note: we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n if (!start || start === \"none\") {\n // some browsers like Safari actually PREFER the prefixed property and mis-report the unprefixed value like clipPath (BUG). In other words, even though clipPath exists in the style (\"clipPath\" in target.style) and it's set in the CSS properly (along with -webkit-clip-path), Safari reports clipPath as \"none\" whereas WebkitClipPath reports accurately like \"ellipse(100% 0% at 50% 0%)\", so in this case we must SWITCH to using the prefixed property instead. See https://gsap.com/forums/topic/18310-clippath-doesnt-work-on-ios/\n var p = _checkPropPrefix(prop, target, 1),\n s = p && _getComputedProperty(target, p, 1);\n\n if (s && s !== start) {\n prop = p;\n start = s;\n } else if (prop === \"borderColor\") {\n start = _getComputedProperty(target, \"borderTopColor\"); // Firefox bug: always reports \"borderColor\" as \"\", so we must fall back to borderTopColor. See https://gsap.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/\n }\n }\n\n var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString),\n index = 0,\n matchIndex = 0,\n a,\n result,\n startValues,\n startNum,\n color,\n startValue,\n endValue,\n endNum,\n chunk,\n endUnit,\n startUnit,\n endValues;\n pt.b = start;\n pt.e = end;\n start += \"\"; // ensure values are strings\n\n end += \"\";\n\n if (end.substring(0, 6) === \"var(--\") {\n end = _getComputedProperty(target, end.substring(4, end.indexOf(\")\")));\n }\n\n if (end === \"auto\") {\n startValue = target.style[prop];\n target.style[prop] = end;\n end = _getComputedProperty(target, prop) || end;\n startValue ? target.style[prop] = startValue : _removeProperty(target, prop);\n }\n\n a = [start, end];\n\n _colorStringFilter(a); // pass an array with the starting and ending values and let the filter do whatever it needs to the values. If colors are found, it returns true and then we must match where the color shows up order-wise because for things like boxShadow, sometimes the browser provides the computed values with the color FIRST, but the user provides it with the color LAST, so flip them if necessary. Same for drop-shadow().\n\n\n start = a[0];\n end = a[1];\n startValues = start.match(_numWithUnitExp) || [];\n endValues = end.match(_numWithUnitExp) || [];\n\n if (endValues.length) {\n while (result = _numWithUnitExp.exec(end)) {\n endValue = result[0];\n chunk = end.substring(index, result.index);\n\n if (color) {\n color = (color + 1) % 5;\n } else if (chunk.substr(-5) === \"rgba(\" || chunk.substr(-5) === \"hsla(\") {\n color = 1;\n }\n\n if (endValue !== (startValue = startValues[matchIndex++] || \"\")) {\n startNum = parseFloat(startValue) || 0;\n startUnit = startValue.substr((startNum + \"\").length);\n endValue.charAt(1) === \"=\" && (endValue = _parseRelative(startNum, endValue) + startUnit);\n endNum = parseFloat(endValue);\n endUnit = endValue.substr((endNum + \"\").length);\n index = _numWithUnitExp.lastIndex - endUnit.length;\n\n if (!endUnit) {\n //if something like \"perspective:300\" is passed in and we must add a unit to the end\n endUnit = endUnit || _config.units[prop] || startUnit;\n\n if (index === end.length) {\n end += endUnit;\n pt.e += endUnit;\n }\n }\n\n if (startUnit !== endUnit) {\n startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;\n } // these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n\n pt._pt = {\n _next: pt._pt,\n p: chunk || matchIndex === 1 ? chunk : \",\",\n //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n s: startNum,\n c: endNum - startNum,\n m: color && color < 4 || prop === \"zIndex\" ? Math.round : 0\n };\n }\n }\n\n pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n } else {\n pt.r = prop === \"display\" && end === \"none\" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;\n }\n\n _relExp.test(end) && (pt.e = 0); //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n\n this._pt = pt; //start the linked list with this new PropTween. Remember, we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within another plugin too, thus \"this\" would refer to the plugin.\n\n return pt;\n},\n _keywordToPercent = {\n top: \"0%\",\n bottom: \"100%\",\n left: \"0%\",\n right: \"100%\",\n center: \"50%\"\n},\n _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) {\n var split = value.split(\" \"),\n x = split[0],\n y = split[1] || \"50%\";\n\n if (x === \"top\" || x === \"bottom\" || y === \"left\" || y === \"right\") {\n //the user provided them in the wrong order, so flip them\n value = x;\n x = y;\n y = value;\n }\n\n split[0] = _keywordToPercent[x] || x;\n split[1] = _keywordToPercent[y] || y;\n return split.join(\" \");\n},\n _renderClearProps = function _renderClearProps(ratio, data) {\n if (data.tween && data.tween._time === data.tween._dur) {\n var target = data.t,\n style = target.style,\n props = data.u,\n cache = target._gsap,\n prop,\n clearTransforms,\n i;\n\n if (props === \"all\" || props === true) {\n style.cssText = \"\";\n clearTransforms = 1;\n } else {\n props = props.split(\",\");\n i = props.length;\n\n while (--i > -1) {\n prop = props[i];\n\n if (_transformProps[prop]) {\n clearTransforms = 1;\n prop = prop === \"transformOrigin\" ? _transformOriginProp : _transformProp;\n }\n\n _removeProperty(target, prop);\n }\n }\n\n if (clearTransforms) {\n _removeProperty(target, _transformProp);\n\n if (cache) {\n cache.svg && target.removeAttribute(\"transform\");\n style.scale = style.rotate = style.translate = \"none\";\n\n _parseTransform(target, 1); // force all the cached values back to \"normal\"/identity, otherwise if there's another tween that's already set to render transforms on this element, it could display the wrong values.\n\n\n cache.uncache = 1;\n\n _removeIndependentTransforms(style);\n }\n }\n }\n},\n // note: specialProps should return 1 if (and only if) they have a non-zero priority. It indicates we need to sort the linked list.\n_specialProps = {\n clearProps: function clearProps(plugin, target, property, endValue, tween) {\n if (tween.data !== \"isFromStart\") {\n var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);\n pt.u = endValue;\n pt.pr = -10;\n pt.tween = tween;\n\n plugin._props.push(property);\n\n return 1;\n }\n }\n /* className feature (about 0.4kb gzipped).\n , className(plugin, target, property, endValue, tween) {\n \tlet _renderClassName = (ratio, data) => {\n \t\t\tdata.css.render(ratio, data.css);\n \t\t\tif (!ratio || ratio === 1) {\n \t\t\t\tlet inline = data.rmv,\n \t\t\t\t\ttarget = data.t,\n \t\t\t\t\tp;\n \t\t\t\ttarget.setAttribute(\"class\", ratio ? data.e : data.b);\n \t\t\t\tfor (p in inline) {\n \t\t\t\t\t_removeProperty(target, p);\n \t\t\t\t}\n \t\t\t}\n \t\t},\n \t\t_getAllStyles = (target) => {\n \t\t\tlet styles = {},\n \t\t\t\tcomputed = getComputedStyle(target),\n \t\t\t\tp;\n \t\t\tfor (p in computed) {\n \t\t\t\tif (isNaN(p) && p !== \"cssText\" && p !== \"length\") {\n \t\t\t\t\tstyles[p] = computed[p];\n \t\t\t\t}\n \t\t\t}\n \t\t\t_setDefaults(styles, _parseTransform(target, 1));\n \t\t\treturn styles;\n \t\t},\n \t\tstartClassList = target.getAttribute(\"class\"),\n \t\tstyle = target.style,\n \t\tcssText = style.cssText,\n \t\tcache = target._gsap,\n \t\tclassPT = cache.classPT,\n \t\tinlineToRemoveAtEnd = {},\n \t\tdata = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== \"=\") ? endValue : startClassList.replace(new RegExp(\"(?:\\\\s|^)\" + endValue.substr(2) + \"(?![\\\\w-])\"), \"\") + ((endValue.charAt(0) === \"+\") ? \" \" + endValue.substr(2) : \"\")},\n \t\tchangingVars = {},\n \t\tstartVars = _getAllStyles(target),\n \t\ttransformRelated = /(transform|perspective)/i,\n \t\tendVars, p;\n \tif (classPT) {\n \t\tclassPT.r(1, classPT.d);\n \t\t_removeLinkedListItem(classPT.d.plugin, classPT, \"_pt\");\n \t}\n \ttarget.setAttribute(\"class\", data.e);\n \tendVars = _getAllStyles(target, true);\n \ttarget.setAttribute(\"class\", startClassList);\n \tfor (p in endVars) {\n \t\tif (endVars[p] !== startVars[p] && !transformRelated.test(p)) {\n \t\t\tchangingVars[p] = endVars[p];\n \t\t\tif (!style[p] && style[p] !== \"0\") {\n \t\t\t\tinlineToRemoveAtEnd[p] = 1;\n \t\t\t}\n \t\t}\n \t}\n \tcache.classPT = plugin._pt = new PropTween(plugin._pt, target, \"className\", 0, 0, _renderClassName, data, 0, -11);\n \tif (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.\n \t\tstyle.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).\n \t}\n \t_parseTransform(target, true); //to clear the caching of transforms\n \tdata.css = new gsap.plugins.css();\n \tdata.css.init(target, changingVars, tween);\n \tplugin._props.push(...data.css._props);\n \treturn 1;\n }\n */\n\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TRANSFORMS\n * --------------------------------------------------------------------------------------\n */\n_identity2DMatrix = [1, 0, 0, 1, 0, 0],\n _rotationalProperties = {},\n _isNullTransform = function _isNullTransform(value) {\n return value === \"matrix(1, 0, 0, 1, 0, 0)\" || value === \"none\" || !value;\n},\n _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) {\n var matrixString = _getComputedProperty(target, _transformProp);\n\n return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);\n},\n _getMatrix = function _getMatrix(target, force2D) {\n var cache = target._gsap || _getCache(target),\n style = target.style,\n matrix = _getComputedTransformMatrixAsArray(target),\n parent,\n nextSibling,\n temp,\n addedToDOM;\n\n if (cache.svg && target.getAttribute(\"transform\")) {\n temp = target.transform.baseVal.consolidate().matrix; //ensures that even complex values like \"translate(50,60) rotate(135,0,0)\" are parsed because it mashes it into a matrix.\n\n matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];\n return matrix.join(\",\") === \"1,0,0,1,0,0\" ? _identity2DMatrix : matrix;\n } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {\n //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not \"none\". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).\n temp = style.display;\n style.display = \"block\";\n parent = target.parentNode;\n\n if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) {\n // note: in 3.3.0 we switched target.offsetParent to _doc.body.contains(target) to avoid [sometimes unnecessary] MutationObserver calls but that wasn't adequate because there are edge cases where nested position: fixed elements need to get reparented to accurately sense transforms. See https://github.com/greensock/GSAP/issues/388 and https://github.com/greensock/GSAP/issues/375. Note: position: fixed elements report a null offsetParent but they could also be invisible because they're in an ancestor with display: none, so we check getBoundingClientRect(). We only want to alter the DOM if we absolutely have to because it can cause iframe content to reload, like a Vimeo video.\n addedToDOM = 1; //flag\n\n nextSibling = target.nextElementSibling;\n\n _docElement.appendChild(target); //we must add it to the DOM in order to get values properly\n\n }\n\n matrix = _getComputedTransformMatrixAsArray(target);\n temp ? style.display = temp : _removeProperty(target, \"display\");\n\n if (addedToDOM) {\n nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);\n }\n }\n\n return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;\n},\n _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {\n var cache = target._gsap,\n matrix = matrixArray || _getMatrix(target, true),\n xOriginOld = cache.xOrigin || 0,\n yOriginOld = cache.yOrigin || 0,\n xOffsetOld = cache.xOffset || 0,\n yOffsetOld = cache.yOffset || 0,\n a = matrix[0],\n b = matrix[1],\n c = matrix[2],\n d = matrix[3],\n tx = matrix[4],\n ty = matrix[5],\n originSplit = origin.split(\" \"),\n xOrigin = parseFloat(originSplit[0]) || 0,\n yOrigin = parseFloat(originSplit[1]) || 0,\n bounds,\n determinant,\n x,\n y;\n\n if (!originIsAbsolute) {\n bounds = _getBBox(target);\n xOrigin = bounds.x + (~originSplit[0].indexOf(\"%\") ? xOrigin / 100 * bounds.width : xOrigin);\n yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf(\"%\") ? yOrigin / 100 * bounds.height : yOrigin); // if (!(\"xOrigin\" in cache) && (xOrigin || yOrigin)) { // added in 3.12.3, reverted in 3.12.4; requires more exploration\n // \txOrigin -= bounds.x;\n // \tyOrigin -= bounds.y;\n // }\n } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {\n //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero.\n x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;\n y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;\n xOrigin = x;\n yOrigin = y; // theory: we only had to do this for smoothing and it assumes that the previous one was not originIsAbsolute.\n }\n\n if (smooth || smooth !== false && cache.smooth) {\n tx = xOrigin - xOriginOld;\n ty = yOrigin - yOriginOld;\n cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;\n cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;\n } else {\n cache.xOffset = cache.yOffset = 0;\n }\n\n cache.xOrigin = xOrigin;\n cache.yOrigin = yOrigin;\n cache.smooth = !!smooth;\n cache.origin = origin;\n cache.originIsAbsolute = !!originIsAbsolute;\n target.style[_transformOriginProp] = \"0px 0px\"; //otherwise, if someone sets an origin via CSS, it will likely interfere with the SVG transform attribute ones (because remember, we're baking the origin into the matrix() value).\n\n if (pluginToAddPropTweensTo) {\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOrigin\", xOriginOld, xOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOrigin\", yOriginOld, yOrigin);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOffset\", xOffsetOld, cache.xOffset);\n\n _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOffset\", yOffsetOld, cache.yOffset);\n }\n\n target.setAttribute(\"data-svg-origin\", xOrigin + \" \" + yOrigin);\n},\n _parseTransform = function _parseTransform(target, uncache) {\n var cache = target._gsap || new GSCache(target);\n\n if (\"x\" in cache && !uncache && !cache.uncache) {\n return cache;\n }\n\n var style = target.style,\n invertedScaleX = cache.scaleX < 0,\n px = \"px\",\n deg = \"deg\",\n cs = getComputedStyle(target),\n origin = _getComputedProperty(target, _transformOriginProp) || \"0\",\n x,\n y,\n z,\n scaleX,\n scaleY,\n rotation,\n rotationX,\n rotationY,\n skewX,\n skewY,\n perspective,\n xOrigin,\n yOrigin,\n matrix,\n angle,\n cos,\n sin,\n a,\n b,\n c,\n d,\n a12,\n a22,\n t1,\n t2,\n t3,\n a13,\n a23,\n a33,\n a42,\n a43,\n a32;\n x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;\n scaleX = scaleY = 1;\n cache.svg = !!(target.getCTM && _isSVG(target));\n\n if (cs.translate) {\n // accommodate independent transforms by combining them into normal ones.\n if (cs.translate !== \"none\" || cs.scale !== \"none\" || cs.rotate !== \"none\") {\n style[_transformProp] = (cs.translate !== \"none\" ? \"translate3d(\" + (cs.translate + \" 0 0\").split(\" \").slice(0, 3).join(\", \") + \") \" : \"\") + (cs.rotate !== \"none\" ? \"rotate(\" + cs.rotate + \") \" : \"\") + (cs.scale !== \"none\" ? \"scale(\" + cs.scale.split(\" \").join(\",\") + \") \" : \"\") + (cs[_transformProp] !== \"none\" ? cs[_transformProp] : \"\");\n }\n\n style.scale = style.rotate = style.translate = \"none\";\n }\n\n matrix = _getMatrix(target, cache.svg);\n\n if (cache.svg) {\n if (cache.uncache) {\n // if cache.uncache is true (and maybe if origin is 0,0), we need to set element.style.transformOrigin = (cache.xOrigin - bbox.x) + \"px \" + (cache.yOrigin - bbox.y) + \"px\". Previously we let the data-svg-origin stay instead, but when introducing revert(), it complicated things.\n t2 = target.getBBox();\n origin = cache.xOrigin - t2.x + \"px \" + (cache.yOrigin - t2.y) + \"px\";\n t1 = \"\";\n } else {\n t1 = !uncache && target.getAttribute(\"data-svg-origin\"); // Remember, to work around browser inconsistencies we always force SVG elements' transformOrigin to 0,0 and offset the translation accordingly.\n }\n\n _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);\n }\n\n xOrigin = cache.xOrigin || 0;\n yOrigin = cache.yOrigin || 0;\n\n if (matrix !== _identity2DMatrix) {\n a = matrix[0]; //a11\n\n b = matrix[1]; //a21\n\n c = matrix[2]; //a31\n\n d = matrix[3]; //a41\n\n x = a12 = matrix[4];\n y = a22 = matrix[5]; //2D matrix\n\n if (matrix.length === 6) {\n scaleX = Math.sqrt(a * a + b * b);\n scaleY = Math.sqrt(d * d + c * c);\n rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).\n\n skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;\n skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));\n\n if (cache.svg) {\n x -= xOrigin - (xOrigin * a + yOrigin * c);\n y -= yOrigin - (xOrigin * b + yOrigin * d);\n } //3D matrix\n\n } else {\n a32 = matrix[6];\n a42 = matrix[7];\n a13 = matrix[8];\n a23 = matrix[9];\n a33 = matrix[10];\n a43 = matrix[11];\n x = matrix[12];\n y = matrix[13];\n z = matrix[14];\n angle = _atan2(a32, a33);\n rotationX = angle * _RAD2DEG; //rotationX\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a12 * cos + a13 * sin;\n t2 = a22 * cos + a23 * sin;\n t3 = a32 * cos + a33 * sin;\n a13 = a12 * -sin + a13 * cos;\n a23 = a22 * -sin + a23 * cos;\n a33 = a32 * -sin + a33 * cos;\n a43 = a42 * -sin + a43 * cos;\n a12 = t1;\n a22 = t2;\n a32 = t3;\n } //rotationY\n\n\n angle = _atan2(-c, a33);\n rotationY = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(-angle);\n sin = Math.sin(-angle);\n t1 = a * cos - a13 * sin;\n t2 = b * cos - a23 * sin;\n t3 = c * cos - a33 * sin;\n a43 = d * sin + a43 * cos;\n a = t1;\n b = t2;\n c = t3;\n } //rotationZ\n\n\n angle = _atan2(b, a);\n rotation = angle * _RAD2DEG;\n\n if (angle) {\n cos = Math.cos(angle);\n sin = Math.sin(angle);\n t1 = a * cos + b * sin;\n t2 = a12 * cos + a22 * sin;\n b = b * cos - a * sin;\n a22 = a22 * cos - a12 * sin;\n a = t1;\n a12 = t2;\n }\n\n if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {\n //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.\n rotationX = rotation = 0;\n rotationY = 180 - rotationY;\n }\n\n scaleX = _round(Math.sqrt(a * a + b * b + c * c));\n scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));\n angle = _atan2(a12, a22);\n skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0;\n perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;\n }\n\n if (cache.svg) {\n //sense if there are CSS transforms applied on an SVG element in which case we must overwrite them when rendering. The transform attribute is more reliable cross-browser, but we can't just remove the CSS ones because they may be applied in a CSS rule somewhere (not just inline).\n t1 = target.getAttribute(\"transform\");\n cache.forceCSS = target.setAttribute(\"transform\", \"\") || !_isNullTransform(_getComputedProperty(target, _transformProp));\n t1 && target.setAttribute(\"transform\", t1);\n }\n }\n\n if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {\n if (invertedScaleX) {\n scaleX *= -1;\n skewX += rotation <= 0 ? 180 : -180;\n rotation += rotation <= 0 ? 180 : -180;\n } else {\n scaleY *= -1;\n skewX += skewX <= 0 ? 180 : -180;\n }\n }\n\n uncache = uncache || cache.uncache;\n cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;\n cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;\n cache.z = z + px;\n cache.scaleX = _round(scaleX);\n cache.scaleY = _round(scaleY);\n cache.rotation = _round(rotation) + deg;\n cache.rotationX = _round(rotationX) + deg;\n cache.rotationY = _round(rotationY) + deg;\n cache.skewX = skewX + deg;\n cache.skewY = skewY + deg;\n cache.transformPerspective = perspective + px;\n\n if (cache.zOrigin = parseFloat(origin.split(\" \")[2]) || !uncache && cache.zOrigin || 0) {\n style[_transformOriginProp] = _firstTwoOnly(origin);\n }\n\n cache.xOffset = cache.yOffset = 0;\n cache.force3D = _config.force3D;\n cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;\n cache.uncache = 0;\n return cache;\n},\n _firstTwoOnly = function _firstTwoOnly(value) {\n return (value = value.split(\" \"))[0] + \" \" + value[1];\n},\n //for handling transformOrigin values, stripping out the 3rd dimension\n_addPxTranslate = function _addPxTranslate(target, start, value) {\n var unit = getUnit(start);\n return _round(parseFloat(start) + parseFloat(_convertToUnit(target, \"x\", value + \"px\", unit))) + unit;\n},\n _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) {\n cache.z = \"0px\";\n cache.rotationY = cache.rotationX = \"0deg\";\n cache.force3D = 0;\n\n _renderCSSTransforms(ratio, cache);\n},\n _zeroDeg = \"0deg\",\n _zeroPx = \"0px\",\n _endParenthesis = \") \",\n _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) {\n var _ref = cache || this,\n xPercent = _ref.xPercent,\n yPercent = _ref.yPercent,\n x = _ref.x,\n y = _ref.y,\n z = _ref.z,\n rotation = _ref.rotation,\n rotationY = _ref.rotationY,\n rotationX = _ref.rotationX,\n skewX = _ref.skewX,\n skewY = _ref.skewY,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n transformPerspective = _ref.transformPerspective,\n force3D = _ref.force3D,\n target = _ref.target,\n zOrigin = _ref.zOrigin,\n transforms = \"\",\n use3D = force3D === \"auto\" && ratio && ratio !== 1 || force3D === true; // Safari has a bug that causes it not to render 3D transform-origin values properly, so we force the z origin to 0, record it in the cache, and then do the math here to offset the translate values accordingly (basically do the 3D transform-origin part manually)\n\n\n if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {\n var angle = parseFloat(rotationY) * _DEG2RAD,\n a13 = Math.sin(angle),\n a33 = Math.cos(angle),\n cos;\n\n angle = parseFloat(rotationX) * _DEG2RAD;\n cos = Math.cos(angle);\n x = _addPxTranslate(target, x, a13 * cos * -zOrigin);\n y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);\n z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);\n }\n\n if (transformPerspective !== _zeroPx) {\n transforms += \"perspective(\" + transformPerspective + _endParenthesis;\n }\n\n if (xPercent || yPercent) {\n transforms += \"translate(\" + xPercent + \"%, \" + yPercent + \"%) \";\n }\n\n if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {\n transforms += z !== _zeroPx || use3D ? \"translate3d(\" + x + \", \" + y + \", \" + z + \") \" : \"translate(\" + x + \", \" + y + _endParenthesis;\n }\n\n if (rotation !== _zeroDeg) {\n transforms += \"rotate(\" + rotation + _endParenthesis;\n }\n\n if (rotationY !== _zeroDeg) {\n transforms += \"rotateY(\" + rotationY + _endParenthesis;\n }\n\n if (rotationX !== _zeroDeg) {\n transforms += \"rotateX(\" + rotationX + _endParenthesis;\n }\n\n if (skewX !== _zeroDeg || skewY !== _zeroDeg) {\n transforms += \"skew(\" + skewX + \", \" + skewY + _endParenthesis;\n }\n\n if (scaleX !== 1 || scaleY !== 1) {\n transforms += \"scale(\" + scaleX + \", \" + scaleY + _endParenthesis;\n }\n\n target.style[_transformProp] = transforms || \"translate(0, 0)\";\n},\n _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {\n var _ref2 = cache || this,\n xPercent = _ref2.xPercent,\n yPercent = _ref2.yPercent,\n x = _ref2.x,\n y = _ref2.y,\n rotation = _ref2.rotation,\n skewX = _ref2.skewX,\n skewY = _ref2.skewY,\n scaleX = _ref2.scaleX,\n scaleY = _ref2.scaleY,\n target = _ref2.target,\n xOrigin = _ref2.xOrigin,\n yOrigin = _ref2.yOrigin,\n xOffset = _ref2.xOffset,\n yOffset = _ref2.yOffset,\n forceCSS = _ref2.forceCSS,\n tx = parseFloat(x),\n ty = parseFloat(y),\n a11,\n a21,\n a12,\n a22,\n temp;\n\n rotation = parseFloat(rotation);\n skewX = parseFloat(skewX);\n skewY = parseFloat(skewY);\n\n if (skewY) {\n //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.\n skewY = parseFloat(skewY);\n skewX += skewY;\n rotation += skewY;\n }\n\n if (rotation || skewX) {\n rotation *= _DEG2RAD;\n skewX *= _DEG2RAD;\n a11 = Math.cos(rotation) * scaleX;\n a21 = Math.sin(rotation) * scaleX;\n a12 = Math.sin(rotation - skewX) * -scaleY;\n a22 = Math.cos(rotation - skewX) * scaleY;\n\n if (skewX) {\n skewY *= _DEG2RAD;\n temp = Math.tan(skewX - skewY);\n temp = Math.sqrt(1 + temp * temp);\n a12 *= temp;\n a22 *= temp;\n\n if (skewY) {\n temp = Math.tan(skewY);\n temp = Math.sqrt(1 + temp * temp);\n a11 *= temp;\n a21 *= temp;\n }\n }\n\n a11 = _round(a11);\n a21 = _round(a21);\n a12 = _round(a12);\n a22 = _round(a22);\n } else {\n a11 = scaleX;\n a22 = scaleY;\n a21 = a12 = 0;\n }\n\n if (tx && !~(x + \"\").indexOf(\"px\") || ty && !~(y + \"\").indexOf(\"px\")) {\n tx = _convertToUnit(target, \"x\", x, \"px\");\n ty = _convertToUnit(target, \"y\", y, \"px\");\n }\n\n if (xOrigin || yOrigin || xOffset || yOffset) {\n tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);\n ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);\n }\n\n if (xPercent || yPercent) {\n //The SVG spec doesn't support percentage-based translation in the \"transform\" attribute, so we merge it into the translation to simulate it.\n temp = target.getBBox();\n tx = _round(tx + xPercent / 100 * temp.width);\n ty = _round(ty + yPercent / 100 * temp.height);\n }\n\n temp = \"matrix(\" + a11 + \",\" + a21 + \",\" + a12 + \",\" + a22 + \",\" + tx + \",\" + ty + \")\";\n target.setAttribute(\"transform\", temp);\n forceCSS && (target.style[_transformProp] = temp); //some browsers prioritize CSS transforms over the transform attribute. When we sense that the user has CSS transforms applied, we must overwrite them this way (otherwise some browser simply won't render the transform attribute changes!)\n},\n _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) {\n var cap = 360,\n isString = _isString(endValue),\n endNum = parseFloat(endValue) * (isString && ~endValue.indexOf(\"rad\") ? _RAD2DEG : 1),\n change = endNum - startNum,\n finalValue = startNum + change + \"deg\",\n direction,\n pt;\n\n if (isString) {\n direction = endValue.split(\"_\")[1];\n\n if (direction === \"short\") {\n change %= cap;\n\n if (change !== change % (cap / 2)) {\n change += change < 0 ? cap : -cap;\n }\n }\n\n if (direction === \"cw\" && change < 0) {\n change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap;\n } else if (direction === \"ccw\" && change > 0) {\n change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap;\n }\n }\n\n plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);\n pt.e = finalValue;\n pt.u = \"deg\";\n\n plugin._props.push(property);\n\n return pt;\n},\n _assign = function _assign(target, source) {\n // Internet Explorer doesn't have Object.assign(), so we recreate it here.\n for (var p in source) {\n target[p] = source[p];\n }\n\n return target;\n},\n _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) {\n //for handling cases where someone passes in a whole transform string, like transform: \"scale(2, 3) rotate(20deg) translateY(30em)\"\n var startCache = _assign({}, target._gsap),\n exclude = \"perspective,force3D,transformOrigin,svgOrigin\",\n style = target.style,\n endCache,\n p,\n startValue,\n endValue,\n startNum,\n endNum,\n startUnit,\n endUnit;\n\n if (startCache.svg) {\n startValue = target.getAttribute(\"transform\");\n target.setAttribute(\"transform\", \"\");\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n\n _removeProperty(target, _transformProp);\n\n target.setAttribute(\"transform\", startValue);\n } else {\n startValue = getComputedStyle(target)[_transformProp];\n style[_transformProp] = transforms;\n endCache = _parseTransform(target, 1);\n style[_transformProp] = startValue;\n }\n\n for (p in _transformProps) {\n startValue = startCache[p];\n endValue = endCache[p];\n\n if (startValue !== endValue && exclude.indexOf(p) < 0) {\n //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);\n endNum = parseFloat(endValue);\n plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);\n plugin._pt.u = endUnit || 0;\n\n plugin._props.push(p);\n }\n }\n\n _assign(endCache, startCache);\n}; // handle splitting apart padding, margin, borderWidth, and borderRadius into their 4 components. Firefox, for example, won't report borderRadius correctly - it will only do borderTopLeftRadius and the other corners. We also want to handle paddingTop, marginLeft, borderRightWidth, etc.\n\n\n_forEachName(\"padding,margin,Width,Radius\", function (name, index) {\n var t = \"Top\",\n r = \"Right\",\n b = \"Bottom\",\n l = \"Left\",\n props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) {\n return index < 2 ? name + side : \"border\" + side + name;\n });\n\n _specialProps[index > 1 ? \"border\" + name : name] = function (plugin, target, property, endValue, tween) {\n var a, vars;\n\n if (arguments.length < 4) {\n // getter, passed target, property, and unit (from _get())\n a = props.map(function (prop) {\n return _get(plugin, prop, property);\n });\n vars = a.join(\" \");\n return vars.split(a[0]).length === 5 ? a[0] : vars;\n }\n\n a = (endValue + \"\").split(\" \");\n vars = {};\n props.forEach(function (prop, i) {\n return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];\n });\n plugin.init(target, vars, tween);\n };\n});\n\nexport var CSSPlugin = {\n name: \"css\",\n register: _initCore,\n targetTest: function targetTest(target) {\n return target.style && target.nodeType;\n },\n init: function init(target, vars, tween, index, targets) {\n var props = this._props,\n style = target.style,\n startAt = tween.vars.startAt,\n startValue,\n endValue,\n endNum,\n startNum,\n type,\n specialProp,\n p,\n startUnit,\n endUnit,\n relative,\n isTransformRelated,\n transformPropTween,\n cache,\n smooth,\n hasPriority,\n inlineProps,\n finalTransformValue;\n _pluginInitted || _initCore(); // we may call init() multiple times on the same plugin instance, like when adding special properties, so make sure we don't overwrite the revert data or inlineProps\n\n this.styles = this.styles || _getStyleSaver(target);\n inlineProps = this.styles.props;\n this.tween = tween;\n\n for (p in vars) {\n if (p === \"autoRound\") {\n continue;\n }\n\n endValue = vars[p];\n\n if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {\n // plugins\n continue;\n }\n\n type = typeof endValue;\n specialProp = _specialProps[p];\n\n if (type === \"function\") {\n endValue = endValue.call(tween, index, target, targets);\n type = typeof endValue;\n }\n\n if (type === \"string\" && ~endValue.indexOf(\"random(\")) {\n endValue = _replaceRandom(endValue);\n }\n\n if (specialProp) {\n specialProp(this, target, p, endValue, tween) && (hasPriority = 1);\n } else if (p.substr(0, 2) === \"--\") {\n //CSS variable\n startValue = (getComputedStyle(target).getPropertyValue(p) + \"\").trim();\n endValue += \"\";\n _colorExp.lastIndex = 0;\n\n if (!_colorExp.test(startValue)) {\n // colors don't have units\n startUnit = getUnit(startValue);\n endUnit = getUnit(endValue);\n endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);\n }\n\n this.add(style, \"setProperty\", startValue, endValue, index, targets, 0, 0, p);\n props.push(p);\n inlineProps.push(p, 0, style[p]);\n } else if (type !== \"undefined\") {\n if (startAt && p in startAt) {\n // in case someone hard-codes a complex value as the start, like top: \"calc(2vh / 2)\". Without this, it'd use the computed value (always in px)\n startValue = typeof startAt[p] === \"function\" ? startAt[p].call(tween, index, target, targets) : startAt[p];\n _isString(startValue) && ~startValue.indexOf(\"random(\") && (startValue = _replaceRandom(startValue));\n getUnit(startValue + \"\") || startValue === \"auto\" || (startValue += _config.units[p] || getUnit(_get(target, p)) || \"\"); // for cases when someone passes in a unitless value like {x: 100}; if we try setting translate(100, 0px) it won't work.\n\n (startValue + \"\").charAt(1) === \"=\" && (startValue = _get(target, p)); // can't work with relative values\n } else {\n startValue = _get(target, p);\n }\n\n startNum = parseFloat(startValue);\n relative = type === \"string\" && endValue.charAt(1) === \"=\" && endValue.substr(0, 2);\n relative && (endValue = endValue.substr(2));\n endNum = parseFloat(endValue);\n\n if (p in _propertyAliases) {\n if (p === \"autoAlpha\") {\n //special case where we control the visibility along with opacity. We still allow the opacity value to pass through and get tweened.\n if (startNum === 1 && _get(target, \"visibility\") === \"hidden\" && endNum) {\n //if visibility is initially set to \"hidden\", we should interpret that as intent to make opacity 0 (a convenience)\n startNum = 0;\n }\n\n inlineProps.push(\"visibility\", 0, style.visibility);\n\n _addNonTweeningPT(this, style, \"visibility\", startNum ? \"inherit\" : \"hidden\", endNum ? \"inherit\" : \"hidden\", !endNum);\n }\n\n if (p !== \"scale\" && p !== \"transform\") {\n p = _propertyAliases[p];\n ~p.indexOf(\",\") && (p = p.split(\",\")[0]);\n }\n }\n\n isTransformRelated = p in _transformProps; //--- TRANSFORM-RELATED ---\n\n if (isTransformRelated) {\n this.styles.save(p);\n finalTransformValue = endValue; // this is always the same as endValue except when it's a var(--) value, in which case we need to calculate the end value.\n\n if (type === \"string\" && endValue.substring(0, 6) === \"var(--\") {\n endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(\")\")));\n\n if (endValue.substring(0, 5) === \"calc(\") {\n var origPerspective = target.style.perspective;\n target.style.perspective = endValue;\n endValue = _getComputedProperty(target, \"perspective\");\n origPerspective ? target.style.perspective = origPerspective : _removeProperty(target, \"perspective\");\n }\n\n endNum = parseFloat(endValue);\n }\n\n if (!transformPropTween) {\n cache = target._gsap;\n cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); // if, for example, gsap.set(... {transform:\"translateX(50vw)\"}), the _get() call doesn't parse the transform, thus cache.renderTransform won't be set yet so force the parsing of the transform here.\n\n smooth = vars.smoothOrigin !== false && cache.smooth;\n transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); //the first time through, create the rendering PropTween so that it runs LAST (in the linked list, we keep adding to the beginning)\n\n transformPropTween.dep = 1; //flag it as dependent so that if things get killed/overwritten and this is the only PropTween left, we can safely kill the whole tween.\n }\n\n if (p === \"scale\") {\n this._pt = new PropTween(this._pt, cache, \"scaleY\", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);\n this._pt.u = 0;\n props.push(\"scaleY\", p);\n p += \"X\";\n } else if (p === \"transformOrigin\") {\n inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);\n endValue = _convertKeywordsToPercentages(endValue); //in case something like \"left top\" or \"bottom right\" is passed in. Convert to percentages.\n\n if (cache.svg) {\n _applySVGOrigin(target, endValue, 0, smooth, 0, this);\n } else {\n endUnit = parseFloat(endValue.split(\" \")[2]) || 0; //handle the zOrigin separately!\n\n endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, \"zOrigin\", cache.zOrigin, endUnit);\n\n _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));\n }\n\n continue;\n } else if (p === \"svgOrigin\") {\n _applySVGOrigin(target, endValue, 1, smooth, 0, this);\n\n continue;\n } else if (p in _rotationalProperties) {\n _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);\n\n continue;\n } else if (p === \"smoothOrigin\") {\n _addNonTweeningPT(this, cache, \"smooth\", cache.smooth, endValue);\n\n continue;\n } else if (p === \"force3D\") {\n cache[p] = endValue;\n continue;\n } else if (p === \"transform\") {\n _addRawTransformPTs(this, endValue, target);\n\n continue;\n }\n } else if (!(p in style)) {\n p = _checkPropPrefix(p) || p;\n }\n\n if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {\n startUnit = (startValue + \"\").substr((startNum + \"\").length);\n endNum || (endNum = 0); // protect against NaN\n\n endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);\n startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));\n this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === \"px\" || p === \"zIndex\") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);\n this._pt.u = endUnit || 0;\n\n if (isTransformRelated && finalTransformValue !== endValue) {\n this._pt.b = startValue;\n this._pt.e = finalTransformValue;\n this._pt.r = _renderCSSPropWithBeginningAndEnd;\n } else if (startUnit !== endUnit && endUnit !== \"%\") {\n //when the tween goes all the way back to the beginning, we need to revert it to the OLD/ORIGINAL value (with those units). We record that as a \"b\" (beginning) property and point to a render method that handles that. (performance optimization)\n this._pt.b = startValue;\n this._pt.r = _renderCSSPropWithBeginning;\n }\n } else if (!(p in style)) {\n if (p in target) {\n //maybe it's not a style - it could be a property added directly to an element in which case we'll try to animate that.\n this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);\n } else if (p !== \"parseTransform\") {\n _missingPlugin(p, endValue);\n\n continue;\n }\n } else {\n _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);\n }\n\n isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : typeof target[p] === \"function\" ? inlineProps.push(p, 2, target[p]()) : inlineProps.push(p, 1, startValue || target[p]));\n props.push(p);\n }\n }\n\n hasPriority && _sortPropTweensByPriority(this);\n },\n render: function render(ratio, data) {\n if (data.tween._time || !_reverting()) {\n var pt = data._pt;\n\n while (pt) {\n pt.r(ratio, pt.d);\n pt = pt._next;\n }\n } else {\n data.styles.revert();\n }\n },\n get: _get,\n aliases: _propertyAliases,\n getSetter: function getSetter(target, property, plugin) {\n //returns a setter function that accepts target, property, value and applies it accordingly. Remember, properties like \"x\" aren't as simple as target.style.property = value because they've got to be applied to a proxy object and then merged into a transform string in a renderer.\n var p = _propertyAliases[property];\n p && p.indexOf(\",\") < 0 && (property = p);\n return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, \"x\")) ? plugin && _recentSetterPlugin === plugin ? property === \"scale\" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === \"scale\" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf(\"-\") ? _setterCSSProp : _getSetter(target, property);\n },\n core: {\n _removeProperty: _removeProperty,\n _getMatrix: _getMatrix\n }\n};\ngsap.utils.checkPrefix = _checkPropPrefix;\ngsap.core.getStyleSaver = _getStyleSaver;\n\n(function (positionAndScale, rotation, others, aliases) {\n var all = _forEachName(positionAndScale + \",\" + rotation + \",\" + others, function (name) {\n _transformProps[name] = 1;\n });\n\n _forEachName(rotation, function (name) {\n _config.units[name] = \"deg\";\n _rotationalProperties[name] = 1;\n });\n\n _propertyAliases[all[13]] = positionAndScale + \",\" + rotation;\n\n _forEachName(aliases, function (name) {\n var split = name.split(\":\");\n _propertyAliases[split[1]] = all[split[0]];\n });\n})(\"x,y,z,scale,scaleX,scaleY,xPercent,yPercent\", \"rotation,rotationX,rotationY,skewX,skewY\", \"transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective\", \"0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY\");\n\n_forEachName(\"x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective\", function (name) {\n _config.units[name] = \"px\";\n});\n\ngsap.registerPlugin(CSSPlugin);\nexport { CSSPlugin as default, _getBBox, _createElement, _checkPropPrefix as checkPrefix };","import { gsap, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ, TweenLite, TimelineLite, TimelineMax } from \"./gsap-core.js\";\nimport { CSSPlugin } from \"./CSSPlugin.js\";\nvar gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap,\n // to protect from tree shaking\nTweenMaxWithCSS = gsapWithCSS.core.Tween;\nexport { gsapWithCSS as gsap, gsapWithCSS as default, CSSPlugin, TweenMaxWithCSS as TweenMax, TweenLite, TimelineMax, TimelineLite, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };","import { BasePet } from '../basePet';\r\nimport { KittySprite } from './sprite';\r\nimport { KittyAI, KittyState } from './ai';\r\nimport { PhysicsEngine } from '../../core/physics';\r\nimport { YarnBall } from './ball';\r\nimport { Poop } from './poop';\r\nimport { Footsteps } from './footsteps';\r\nimport { gsap } from 'gsap';\r\nimport { Body, Vector } from 'matter-js';\r\n\r\nexport class Kitty extends BasePet {\r\n private sprite: KittySprite;\r\n private ai: KittyAI;\r\n private physics: PhysicsEngine;\r\n private ball: YarnBall | null = null;\r\n private footsteps: Footsteps | null = null;\r\n private lastTime: number = 0;\r\n private poops: Poop[] = [];\r\n \r\n private lastStepX: number = 0;\r\n private stepDistance: number = 20;\r\n\r\n constructor() {\r\n super();\r\n this.sprite = new KittySprite();\r\n this.ai = new KittyAI();\r\n this.physics = new PhysicsEngine();\r\n this.x = Math.random() * (window.innerWidth - 64);\r\n this.y = window.innerHeight - 80;\r\n }\r\n\r\n mount(container: HTMLElement): void {\r\n this.container = container;\r\n this.element = this.sprite.getElement();\r\n this.element.style.position = 'absolute';\r\n this.element.style.zIndex = '2147483647';\r\n this.container.appendChild(this.element);\r\n \r\n this.physics.addFloor(window.innerWidth, window.innerHeight);\r\n this.footsteps = new Footsteps(container);\r\n \r\n // Funny Feature: Laser Pointer (hold Shift)\r\n this.setupLaserPointer();\r\n\r\n // Funny Feature: Scared Jump\r\n this.element.style.pointerEvents = 'auto';\r\n this.element.addEventListener('mousedown', () => this.handleScaredJump());\r\n \r\n // Randomly spawn a yarn ball\r\n setTimeout(() => this.spawnBall(), 5000);\r\n\r\n window.addEventListener('resize', this.handleResize.bind(this));\r\n\r\n this.setPosition(this.x, this.y);\r\n requestAnimationFrame(this.tick.bind(this));\r\n }\r\n\r\n private handleResize() {\r\n this.physics.addFloor(window.innerWidth, window.innerHeight);\r\n }\r\n\r\n private spawnBall() {\r\n if (!this.container) return;\r\n const body = this.physics.addBall(Math.random() * window.innerWidth, -50, 12);\r\n this.ball = new YarnBall(this.container, body);\r\n }\r\n\r\n update(delta: number): void {\r\n const ballPos = this.ball ? this.ball.body.position : undefined;\r\n const { state, x, y, facing } = this.ai.update(delta, this.x, this.y, ballPos);\r\n \r\n // Random Meow\r\n if (Math.random() < 0.001) {\r\n const texts = [\"MEOW\", \"PURR\", \"HELLO\", \"JS FTW\", \"PET ME\", \"I LOVE CODE\", \"FEED ME\", \"MEOWWW\"];\r\n this.sprite.showMessage(texts[Math.floor(Math.random() * texts.length)]);\r\n }\r\n\r\n // Handle State Changes\r\n if (state !== this.state) {\r\n this.onStateChange(this.state as KittyState, state);\r\n this.state = state;\r\n }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n // Physics update\r\n this.physics.update(delta);\r\n if (this.ball) this.ball.update();\r\n\r\n // Footprints\r\n if (this.state.includes('walk') || this.state === 'chase-ball' || this.state === 'zoomies') {\r\n if (Math.abs(this.x - this.lastStepX) > this.stepDistance) {\r\n this.footsteps?.addStep(this.x + 32, this.y + 56);\r\n this.lastStepX = this.x;\r\n }\r\n }\r\n\r\n // Interaction with ball\r\n if (this.ball && (state === 'chase-ball' || state === 'pounce')) {\r\n const dist = Vector.magnitude(Vector.sub(this.ball.body.position, { x: this.x + 32, y: this.y + 32 }));\r\n if (dist < 60) {\r\n // Kick the ball!\r\n const force = Vector.create(facing === 'left' ? -0.08 : 0.08, -0.04);\r\n Body.applyForce(this.ball.body, this.ball.body.position, force);\r\n }\r\n }\r\n\r\n this.sprite.update(delta, state, facing);\r\n this.setPosition(this.x, this.y);\r\n }\r\n\r\n private onStateChange(oldState: KittyState, newState: KittyState) {\r\n if (newState === 'poop' && this.container) {\r\n setTimeout(() => {\r\n this.poops.push(new Poop(this.container!, this.x + 20, this.y + 40));\r\n }, 2000);\r\n }\r\n\r\n if (newState === 'jump') {\r\n this.sprite.showMessage(\"BOING!\", 1000);\r\n gsap.to(this.element, {\r\n y: this.y - 100,\r\n duration: 0.5,\r\n ease: \"power2.out\",\r\n yoyo: true,\r\n repeat: 1,\r\n onComplete: () => {\r\n this.setPosition(this.x, this.y);\r\n }\r\n });\r\n }\r\n\r\n if (newState === 'sleep') {\r\n this.sprite.showMessage(\"Zzz...\", 2000);\r\n }\r\n\r\n if (newState === 'poop') {\r\n this.sprite.showMessage(\"Oopsy!\", 2000);\r\n }\r\n\r\n if (newState === 'purr') {\r\n this.sprite.showMessage(\"❤️ PURRR ❤️\", 3000);\r\n }\r\n }\r\n\r\n private handleScaredJump() {\r\n if (this.state === 'sleep' || this.state === 'idle' || this.state === 'sit') {\r\n // Add a \"vibration\" effect before jumping for comedy\r\n gsap.to(this.element, { x: \"+=2\", yoyo: true, repeat: 10, duration: 0.05 });\r\n setTimeout(() => {\r\n this.onStateChange(this.state as KittyState, 'jump');\r\n }, 500);\r\n }\r\n }\r\n\r\n private laserActive = false;\r\n private laserEl: HTMLDivElement | null = null;\r\n\r\n private setupLaserPointer() {\r\n window.addEventListener('keydown', (e) => {\r\n if (e.shiftKey) {\r\n this.laserActive = true;\r\n this.showLaser();\r\n }\r\n });\r\n window.addEventListener('keyup', (e) => {\r\n if (!e.shiftKey) {\r\n this.laserActive = false;\r\n this.hideLaser();\r\n }\r\n });\r\n window.addEventListener('mousemove', (e) => {\r\n if (this.laserActive && this.laserEl) {\r\n this.laserEl.style.transform = `translate(${e.clientX - 4}px, ${e.clientY - 4}px)`;\r\n // Force kitty AI to track laser using casting to bypass private access for demonstration\r\n (this.ai as any).mouseX = e.clientX;\r\n (this.ai as any).mouseY = e.clientY;\r\n (this.ai as any).isChasingMouse = true;\r\n }\r\n });\r\n }\r\n\r\n private showLaser() {\r\n if (!this.container || this.laserEl) return;\r\n this.laserEl = document.createElement('div');\r\n Object.assign(this.laserEl.style, {\r\n position: 'fixed',\r\n width: '8px',\r\n height: '8px',\r\n borderRadius: '50%',\r\n background: 'red',\r\n boxShadow: '0 0 10px red',\r\n pointerEvents: 'none',\r\n zIndex: '2147483647',\r\n top: '0',\r\n left: '0'\r\n });\r\n this.container.appendChild(this.laserEl);\r\n }\r\n\r\n private hideLaser() {\r\n if (this.laserEl && this.laserEl.parentNode) {\r\n this.laserEl.parentNode.removeChild(this.laserEl);\r\n }\r\n this.laserEl = null;\r\n }\r\n\r\n private tick(time: number) {\r\n if (!this.lastTime) this.lastTime = time;\r\n const delta = time - this.lastTime;\r\n this.lastTime = time;\r\n\r\n this.update(delta);\r\n \r\n if (this.element && this.element.parentNode) {\r\n requestAnimationFrame(this.tick.bind(this));\r\n }\r\n }\r\n\r\n destroy(): void {\r\n if (this.element && this.element.parentNode) {\r\n this.element.parentNode.removeChild(this.element);\r\n }\r\n this.element = null;\r\n // Cleanup other parts\r\n }\r\n}\r\n","import { isLocalhost } from './environment';\r\nimport { Overlay } from './overlay';\r\nimport { Kitty } from '../pets/kitty/kitty';\r\n\r\nexport const inject = () => {\r\n if (!isLocalhost()) return;\r\n\r\n // Wait for DOM to be ready\r\n if (document.readyState === 'loading') {\r\n document.addEventListener('DOMContentLoaded', init);\r\n } else {\r\n init();\r\n }\r\n};\r\n\r\nlet overlay: Overlay | null = null;\r\nlet kitty: Kitty | null = null;\r\n\r\nfunction init() {\r\n if (overlay) return; // Already initialized\r\n\r\n overlay = new Overlay();\r\n overlay.mount();\r\n\r\n kitty = new Kitty();\r\n kitty.mount(overlay.shadowContainer);\r\n}\r\n\r\nexport const destroy = () => {\r\n if (kitty) kitty.destroy();\r\n if (overlay) overlay.destroy();\r\n kitty = null;\r\n overlay = null;\r\n};\r\n","import type { Plugin } from 'vite';\r\n\r\nexport function devKittyPlugin(): Plugin {\r\n return {\r\n name: 'vite-plugin-dev-kitty',\r\n apply: 'serve', // Only in dev mode\r\n transformIndexHtml(html: string) {\r\n return {\r\n html,\r\n tags: [\r\n {\r\n tag: 'script',\r\n attrs: { type: 'module' },\r\n children: 'import \"dev-kitty\";',\r\n injectTo: 'body'\r\n }\r\n ]\r\n };\r\n }\r\n };\r\n}\r\n"],"mappings":"wyBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,eA2BC,SAA0CC,EAAMC,EAAS,CACtD,OAAOH,IAAY,UAAY,OAAOC,IAAW,SACnDA,GAAO,QAAUE,EAAQ,EAClB,OAAO,QAAW,YAAc,OAAO,IAC9C,OAAO,SAAU,CAAC,EAAGA,CAAO,EACrB,OAAOH,IAAY,SAC1BA,GAAQ,OAAYG,EAAQ,EAE5BD,EAAK,OAAYC,EAAQ,CAC3B,GAAGH,GAAM,UAAW,CACpB,OAAiB,SAASI,EAAS,CAEzB,IAAIC,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,EAAU,CAGtC,GAAGF,EAAiBE,CAAQ,EAC3B,OAAOF,EAAiBE,CAAQ,EAAE,QAGnC,IAAIN,EAASI,EAAiBE,CAAQ,EAAI,CACzC,EAAGA,EACH,EAAG,GACH,QAAS,CAAC,CACX,EAGA,OAAAH,EAAQG,CAAQ,EAAE,KAAKN,EAAO,QAASA,EAAQA,EAAO,QAASK,CAAmB,EAGlFL,EAAO,EAAI,GAGJA,EAAO,OACf,CAIA,OAAAK,EAAoB,EAAIF,EAGxBE,EAAoB,EAAID,EAGxBC,EAAoB,EAAI,SAASN,EAASQ,EAAMC,EAAQ,CACnDH,EAAoB,EAAEN,EAASQ,CAAI,GACtC,OAAO,eAAeR,EAASQ,EAAM,CAAE,WAAY,GAAM,IAAKC,CAAO,CAAC,CAExE,EAGAH,EAAo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root","factory","modules","installedModules","__webpack_require__","moduleId","name","getter","value","mode","ns","key","object","property","Common","obj","deep","argsStart","args","deepClone","i","source","prop","keys","values","path","begin","end","val","parts","array","j","temp","choices","min","max","_seededRandom","colorString","message","warning","haystack","needle","list","func","mapped","graph","result","visited","node","neighbors","neighbor","funcs","chain","lastResult","l","base","decomp","Bounds","vertices","bounds","velocity","vertex","point","boundsA","boundsB","vector","position","deltaX","deltaY","Vector","x","y","angle","output","cos","sin","magnitude","vectorA","vectorB","vectorC","scalar","negate","Vertices","points","body","pathPattern","match","area","centre","cross","average","signed","mass","numerator","denominator","v","n","verticesLength","translateX","translateY","pointX","pointY","dx","dy","nextVertex","scaleX","scaleY","delta","radius","quality","qualityMin","qualityMax","newVertices","prevVertex","currentRadius","prevNormal","nextNormal","diagonalRadius","radiusVector","midNormal","scaledVertex","precision","alpha","theta","vertexA","vertexB","flag","k","z","upper","lower","Body","Sleeping","Axes","options","defaults","_initProperties","isNonColliding","defaultFillStyle","defaultStrokeStyle","defaultLineWidth","settings","isStatic","part","moment","density","inertia","autoHull","hull","hullCentre","total","relative","updateVelocity","timeScale","speed","translation","rotation","totalArea","totalInertia","deltaTime","deltaTimeSquared","correction","frictionAir","velocityPrevX","velocityPrevY","bodyVelocity","force","offset","properties","Events","eventNames","callback","names","callbacks","newCallbacks","event","eventClone","events","Composite","composite","isModified","updateParents","updateChildren","childComposite","objects","compositeA","compositeB","bodies","constraint","keepStatic","constraints","composites","id","type","recursive","motionSleepThreshold","angularSpeed","motion","minMotion","maxMotion","pairs","pair","collision","bodyA","bodyB","sleepingBody","movingBody","isSleeping","wasSleeping","Collision","Pair","_supports","_overlapAB","_overlapBA","minOverlap","normal","tangent","penetration","supports","depth","minAxis","normalX","normalY","supportsB","supportCount","supportsA","verticesA","verticesB","axes","verticesALength","verticesBLength","verticesAX","verticesAY","verticesBX","verticesBY","axesLength","overlapMin","overlapAxisNumber","overlap","overlapAB","overlapBA","dot","axis","axisX","axisY","minA","minB","maxA","maxB","direction","bodyAPositionX","bodyAPositionY","nearestDistance","vertexC","distance","Contact","timestamp","contacts","parentA","parentB","supportA","contactA","supportB","contactB","isActive","Constraint","initialPointA","initialPointB","length","render","impulse","fixedA","fixedB","pointA","pointB","pointAWorld","pointBWorld","currentLength","difference","isRigid","stiffness","damping","massTotal","inertiaTotal","resistanceTotal","torque","share","normalVelocity","relativeVelocity","zero","pointAX","pointAY","pointBX","pointBY","gradient","xx","Bodies","width","height","rectangle","chamfer","slope","roof","x1","x2","x3","verticesPath","trapezoid","maxSides","circle","sides","yy","polygon","vertexSets","flagInternal","removeCollinear","minimumArea","removeDuplicatePoints","canDecomp","isConvex","isConcave","concave","decomposed","chunk","chunkVertices","coincident_max_dist","partA","partB","pav","pbv","da","db","Detector","detector","bodiesLength","canCollide","collides","collisions","collisionIndex","boundXMax","boundYMax","boundYMin","bodyAStatic","partsALength","partsASingle","partsBLength","partsAStart","partsBStart","filterA","filterB","Mouse","element","mouse","touches","scale","pixelRatio","elementBounds","rootNode","scrollX","scrollY","Plugin","plugin","registered","pluginVersion","registeredVersion","dependency","parsed","plugins","dependencies","sortedDependencies","status","tracked","parsedBase","resolved","pattern","range","major","minor","patch","version","r","Engine","Resolver","Pairs","engine","startTime","world","timing","allBodies","allConstraints","positionDamping","engineA","engineB","gravity","gravityScale","contactCount","pairsLength","contactShare","positionImpulse","positionDampen","slopDampen","positionWarming","verticesTranslate","boundsUpdate","positionImpulseX","positionImpulseY","contact","contactVertex","normalImpulse","tangentImpulse","impulseX","impulseY","timeScaleSquared","timeScaleCubed","restingThresh","restingThreshTangent","frictionNormalMultiplier","frictionMaxStatic","maxFriction","tangentX","tangentY","inverseMassTotal","friction","bodyAVelocityX","bodyAVelocityY","bodyAAngularVelocity","bodyBVelocityX","bodyBVelocityY","bodyBAngularVelocity","offsetAX","offsetAY","offsetBX","offsetBY","velocityPointAX","velocityPointAY","velocityPointBX","velocityPointBY","relativeVelocityX","relativeVelocityY","tangentVelocity","normalOverlap","normalForce","frictionLimit","oAcN","oBcN","contactNormalImpulse","contactTangentImpulse","pairUpdate","pairCreate","pairSetActive","pairsTable","pairsList","pairsListLength","pairsListIndex","collisionStart","collisionEnd","collisionActive","collisionsLength","collisionStartIndex","collisionEndIndex","collisionActiveIndex","Matter","Composites","deprecated","columns","rows","columnGap","rowGap","stack","currentX","currentY","lastBody","row","maxHeight","column","bodyHeight","bodyWidth","xOffsetA","yOffsetA","xOffsetB","yOffsetB","bodyAHeight","bodyAWidth","bodyBHeight","bodyBWidth","crossBrace","col","bodyC","stackX","stackY","actualRows","lastBodyWidth","start","xOffset","number","size","newtonsCradle","separation","wheelSize","group","wheelBase","wheelAOffset","wheelBOffset","wheelYOffset","car","wheelA","wheelB","axelA","axelB","particleRadius","particleOptions","constraintOptions","softBody","Grid","grid","forceUpdate","buckets","bucket","bucketId","gridChanged","newRegion","union","isInsideNewRegion","isInsideOldRegion","regionA","regionB","startCol","endCol","startRow","endRow","gridPairs","pairId","bucketLength","pairKeys","pairKeysLength","MouseConstraint","mouseConstraint","mouseEvents","Query","overlaps","startPoint","endPoint","rayWidth","rayAngle","rayLength","rayX","rayY","ray","outside","Render","_requestAnimationFrame","_cancelAnimationFrame","_createCanvas","loop","time","_updateTiming","canvas","_getPixelRatio","padding","center","viewHeight","viewWidth","outerRatio","innerRatio","boundsWidth","boundsHeight","boundsScaleX","boundsScaleY","context","background","_applyBackground","sections","section","deltaHistory","elapsedHistory","timestampElapsedHistory","engineDeltaHistory","engineUpdatesHistory","engineElapsedHistory","lastEngineUpdatesPerFrame","lastEngineDelta","deltaMean","_mean","elapsedMean","engineDeltaMean","engineUpdatesMean","engineElapsedMean","timestampElapsedMean","rateMean","neededUpdatesPerFrame","fps","graphHeight","gap","count","label","indicator","plotY","c","coils","showInternalEdges","sprite","texture","_getTexture","corrected","normalPosX","normalPosY","inspector","selected","item","historySize","devicePixelRatio","backingStorePixelRatio","imagePath","image","cssBackground","Runner","runner","onFrame","tickStartTime","engineDelta","updateCount","frameDelta","deltaHistorySorted","deltaHistoryWindow","frameDeltaSmoothed","maxUpdates","updateStartTime","elapsedTimeTotal","elapsedTimeUpdates","elapsedNextEstimate","valuesLength","SAT","Svg","sampleLength","il","segment","segments","segmentsQueue","lastSegment","lastPoint","segmentIndex","lx","ly","addPoint","px","py","pathSegType","isRelative","addSegmentPoint","segType","x0","y0","y1","y2","segs","len","seg","World","index_exports","__export","Kitty","Overlay","index_default","destroy","devKittyPlugin","inject","isLocalhost","hostname","Overlay","__publicField","BasePet","__publicField","x","y","_KittySprite","__publicField","svg","delta","state","facing","head","body","tail","zzz","legs","eyes","e","l","off","i","legOff","leg","vib","text","duration","bubble","bubbleText","KittySprite","KittyAI","__publicField","e","delta","currentX","currentY","ballPos","width","margin","distToMouse","oldState","nextX","nextY","moveSpeed","dx","groundY","targetY","state","roll","import_matter_js","PhysicsEngine","__publicField","delta","cappedDelta","x","y","radius","ball","width","height","import_matter_js","YarnBall","container","body","__publicField","isDragging","e","x","y","Poop","container","x","y","__publicField","smell","Footsteps","container","__publicField","x","y","step","el","firstChild","_assertThisInitialized","self","_inheritsLoose","subClass","superClass","_config","_defaults","_suppressOverwrites","_reverting","_context","_bigNum","_tinyNum","_2PI","_HALF_PI","_gsID","_sqrt","_cos","_sin","_isString","value","_isFunction","_isNumber","_isUndefined","_isObject","_isNotFalse","_windowExists","_isFuncOrString","_isTypedArray","_isArray","_randomExp","_commaDelimExp","_strictNumExp","_numExp","_numWithUnitExp","_complexStringNumExp","_relExp","_delimitedValueExp","_unitExp","_globalTimeline","_win","_coreInitted","_doc","_globals","_installScope","_coreReady","_install","scope","_merge","gsap","_missingPlugin","property","_warn","message","suppress","_addGlobal","name","obj","_emptyFunc","_startAtRevertConfig","_revertConfigNoKill","_revertConfig","_reservedProps","_lazyTweens","_lazyLookup","_lastRenderedFrame","_plugins","_effects","_nextGCFrame","_harnessPlugins","_callbackNames","_harness","targets","target","harnessPlugin","i","GSCache","_getCache","toArray","_getProperty","v","_forEachName","names","func","_round","_roundPrecise","_parseRelative","start","operator","end","_arrayContainsAny","toSearch","toFind","l","_lazyRender","a","tween","_isRevertWorthy","animation","_lazySafeRender","time","suppressEvents","force","_numericIfPossible","n","_passThrough","p","_setDefaults","defaults","_setKeyframeDefaults","excludeDuration","base","toMerge","_mergeDeep","_copyExcluding","excluding","copy","_inheritDefaults","vars","parent","_arraysMatch","a1","a2","match","_addLinkedListItem","child","firstProp","lastProp","sortBy","prev","t","_removeLinkedListItem","next","_removeFromParent","onlyIfParentHasAutoRemove","_uncache","_recacheAncestors","_rewindStartAt","totalTime","_hasNoPausedAncestors","_elapsedCycleDuration","_animationCycle","tTime","cycleDuration","whole","_parentToChildTotalTime","parentTime","_setEnd","_alignPlayhead","_postAddChecks","timeline","_clamp","_addToTimeline","position","skipChecks","_parsePosition","_isFromOrFromStart","_scrollTrigger","trigger","_attemptInitTween","_initTween","_ticker","_parentPlayheadIsBeforeStart","_ref","_ref2","data","_renderZeroDurationTween","prevRatio","ratio","repeatDelay","pt","iteration","prevIteration","_callback","_findNextPauseTween","prevTime","_setDuration","duration","skipUncache","leavePlayhead","repeat","dur","totalProgress","_onUpdateTotalDuration","Timeline","_zeroPosition","percentAnimation","labels","recent","clippedDuration","offset","isPercent","_createTweenType","type","params","isLegacy","varsIndex","irVars","Tween","_conditionalReturn","min","max","getUnit","clamp","_slice","_isArrayLike","nonEmpty","_flatten","ar","leaveStrings","accumulator","_accumulator","_wake","selector","el","shuffle","distribute","ease","_parseEase","from","cache","isDecimal","ratios","axis","ratioX","ratioY","distances","originX","originY","x","y","d","j","wrapAt","_invertEase","_roundModifier","raw","snap","snapTo","isArray","radius","is2D","closest","dx","dy","random","roundingIncrement","returnFunction","pipe","_len","functions","_key","f","unitize","unit","normalize","mapRange","_wrapArray","wrapper","index","wrap","range","wrapYoyo","total","_replaceRandom","s","arIndex","values","inMin","inMax","outMin","outMax","inRange","outRange","interpolate","progress","mutate","isString","master","interpolators","il","_addPropTween","_renderPropTweens","_getLabelInDirection","fromTime","backward","distance","label","executeLazyFirst","callback","prevContext","context","result","_interrupt","_quickTween","_registerPluginQueue","_createPlugin","config","isFunc","Plugin","instanceDefaults","_killPropTweensOf","_addPluginModifier","statics","_getSetter","PropTween","_255","_colorLookup","_hue","h","m1","m2","splitColor","toHSL","forceAlpha","g","b","wasHSL","_colorOrderData","c","_colorExp","_formatColors","orderMatchData","colors","shell","color","_hslExp","_colorStringFilter","combined","_tickerActive","_getTime","_lagThreshold","_adjustedLag","_startTime","_lastUpdate","_gap","_nextTime","_listeners","_id","_req","_raf","_self","_delta","_i","_tick","elapsed","manual","overlap","dispatch","frame","fps","threshold","adjustedLag","_fps","once","prioritize","_easeMap","_customEaseExp","_quotesExp","_parseObjectInString","split","key","val","parsedVal","_valueInParentheses","open","close","nested","_configEaseFromString","_propagateYoyoEase","isYoyo","defaultEase","_insertEase","easeIn","easeOut","easeInOut","lowercaseName","_easeInOutFromOut","_configElastic","amplitude","period","p1","p2","p3","_configBack","overshoot","power","n1","n2","n3","steps","immediateStart","harness","Animation","_proto","_totalTime","includeRepeats","wrapRepeats","prevIsReverting","rawTime","includeDelay","atTime","onFulfilled","prevProm","resolve","_resolve","_then","_Animation","_this","_proto2","fromVars","toVars","stagger","onCompleteAll","onCompleteAllParams","tDur","crossingStart","prevPaused","pauseTween","timeScale","prevStart","yoyo","rewinding","doesWrap","adjustedTime","_this2","tweens","timelines","ignoreBeforeTime","id","animations","_totalTime2","props","onlyActive","_overwritingTween","parsedTargets","isGlobalTime","children","tl","endTime","_vars","startAt","_onStart","onStartParams","immediateRender","initted","fromPosition","toPosition","afterTime","beforeTime","amount","adjustLabels","soft","includeLabels","_addComplexStringPropTween","prop","setter","stringFilter","funcParam","_renderComplexString","matchIndex","startNums","endNum","chunk","startNum","hasRandom","modifier","optional","currentValue","parsedStart","_setterFuncWithParam","_setterFunc","_setterPlain","_forceAllPropTweens","_renderBoolean","_renderPlain","_processVars","_parseFuncOrString","_checkPlugin","plugin","ptLookup","lazy","onUpdate","runBackwards","yoyoEase","keyframes","autoRevert","prevStartAt","fullTargets","autoOverwrite","cleanVars","hasPriority","gsData","harnessVars","overwritten","_sortPropTweensByPriority","_updatePropTweens","startIsRelative","skipRecursion","ptCache","rootPT","lookup","_addAliasesToVars","propertyAliases","aliases","_parseKeyframe","allProps","easeEach","_staggerTweenProps","_staggerPropsToSkip","_Animation2","skipInherit","_this3","_this3$vars","delay","overwrite","scrollTrigger","curTarget","staggerFunc","staggerVarsToMerge","kf","_proto3","isNegative","killingTargets","propTweenLookup","firstPT","overwrittenProps","curLookup","curOverwriteProps","_setterAttribute","hasNonDependentRemaining","_setterWithModifier","pt2","first","last","change","renderer","priority","_proto4","_media","_emptyArray","_lastMediaTime","_contextID","_dispatch","_onMediaChange","matches","queries","conditions","anyMatch","toggled","Context","_proto5","prevSelector","e","revert","matchMedia","_this4","o","MatchMedia","_proto6","cond","mq","active","_gsap","_len2","args","_key2","uncache","getter","format","setters","_setDefaults2","_ref3","effect","plugins","extendTimeline","pluginName","includeDelayedCalls","found","toAdd","_getPluginPropTween","_addModifiers","modifiers","_buildModifierPlugin","temp","Power0","Power1","Power2","Power3","Power4","Linear","Quad","Cubic","Quart","Quint","Strong","Elastic","Back","SteppedEase","Bounce","Sine","Expo","Circ","_win","_doc","_docElement","_pluginInitted","_tempDiv","_tempDivStyler","_recentSetterPlugin","_reverting","_windowExists","_transformProps","_RAD2DEG","_DEG2RAD","_atan2","_bigNum","_capsExp","_horizontalExp","_complexExp","_propertyAliases","_renderCSSProp","ratio","data","_renderPropWithEnd","_renderCSSPropWithBeginning","_renderCSSPropWithBeginningAndEnd","_renderRoundedCSSProp","value","_renderNonTweeningValue","_renderNonTweeningValueOnlyAtEnd","_setterCSSStyle","target","property","_setterCSSProp","_setterTransform","_setterScale","_setterScaleWithRender","cache","_setterTransformWithRender","_transformProp","_transformOriginProp","_saveStyle","isNotCSS","_this","style","a","_get","p","_removeIndependentTransforms","_revertStyle","props","i","_getStyleSaver","properties","saver","gsap","_supports3D","_createElement","type","ns","_getComputedProperty","skipPrefixFallback","cs","_checkPropPrefix","_prefixes","element","preferPrefix","e","s","_initCore","_getReparentedCloneBBox","owner","svg","clone","bbox","_getAttributeFallbacks","attributesArray","_getBBox","bounds","cloned","_isSVG","_removeProperty","first2Chars","_addNonTweeningPT","plugin","beginning","end","onlySetAtEnd","pt","PropTween","_nonConvertibleUnits","_nonStandardLayouts","_convertToUnit","unit","curValue","curUnit","horizontal","isRootSVG","measureProperty","amount","toPixels","toPercent","px","parent","isSVG","_round","_ticker","v","_getCache","uncache","_parseTransform","_firstTwoOnly","_specialProps","_getProperty","_tweenComplexCSSString","prop","start","_renderComplexString","index","matchIndex","result","startValues","startNum","color","startValue","endValue","endNum","chunk","endUnit","startUnit","endValues","_colorStringFilter","_numWithUnitExp","_parseRelative","_config","_relExp","_keywordToPercent","_convertKeywordsToPercentages","split","x","y","_renderClearProps","clearTransforms","tween","_identity2DMatrix","_rotationalProperties","_isNullTransform","_getComputedTransformMatrixAsArray","matrixString","_numExp","_getMatrix","force2D","matrix","nextSibling","temp","addedToDOM","_applySVGOrigin","origin","originIsAbsolute","smooth","matrixArray","pluginToAddPropTweensTo","xOriginOld","yOriginOld","xOffsetOld","yOffsetOld","b","c","d","tx","ty","originSplit","xOrigin","yOrigin","determinant","GSCache","invertedScaleX","deg","z","scaleX","scaleY","rotation","rotationX","rotationY","skewX","skewY","perspective","angle","cos","sin","a12","a22","t1","t2","t3","a13","a23","a33","a42","a43","a32","_renderSVGTransforms","_renderCSSTransforms","_renderNon3DTransforms","_addPxTranslate","getUnit","_zeroDeg","_zeroPx","_endParenthesis","_ref","xPercent","yPercent","transformPerspective","force3D","zOrigin","transforms","use3D","_ref2","xOffset","yOffset","forceCSS","a11","a21","_addRotationalPropTween","cap","isString","_isString","change","finalValue","direction","_assign","source","_addRawTransformPTs","startCache","exclude","endCache","_forEachName","name","t","r","l","side","vars","CSSPlugin","targets","startAt","specialProp","relative","isTransformRelated","transformPropTween","hasPriority","inlineProps","finalTransformValue","_plugins","_checkPlugin","_replaceRandom","_colorExp","origPerspective","_missingPlugin","_sortPropTweensByPriority","_isUndefined","_getSetter","positionAndScale","others","aliases","all","gsapWithCSS","gsap","CSSPlugin","TweenMaxWithCSS","import_matter_js","Kitty","BasePet","__publicField","KittySprite","KittyAI","PhysicsEngine","container","Footsteps","body","YarnBall","delta","ballPos","state","x","y","facing","texts","force","oldState","newState","Poop","gsapWithCSS","e","time","inject","isLocalhost","init","overlay","kitty","Overlay","Kitty","destroy","devKittyPlugin","html","inject","index_default","inject","devKittyPlugin"]}