UNPKG

vexchords

Version:
182 lines (159 loc) 730 kB
var vexchords = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./builder.js": /*!********************!*\ !*** ./builder.js ***! \********************/ /*! exports provided: POSITIONS, SHAPES, build */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POSITIONS\", function() { return POSITIONS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SHAPES\", function() { return SHAPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"build\", function() { return build; });\n/*\n * Vex Chords\n * Mohit Muthanna Cheppudira -- http://0xfe.blogspot.com\n */\nvar SHAPES = {\n 'M E': {\n name: 'Maj',\n chord: [[3, 2], [4, 3], [5, 3]],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }]\n },\n 'm E': {\n name: 'm',\n chord: [[4, 3], [5, 3]],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }]\n },\n '7 E': {\n name: '7',\n chord: [[2, 4], [3, 2], [5, 3]],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }]\n },\n 'm7 E': {\n name: 'm7',\n chord: [[2, 4], [5, 3]],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }]\n },\n 'M7 E': {\n name: 'Maj7',\n chord: [[1, 'x'], [2, 1], [3, 2], [4, 2], [5, 'x'], [6, 1]]\n },\n 'dim E': {\n name: 'dim',\n chord: [[1, 'x'], [3, 2], [5, 'x'], [6, 2]],\n positionText: 1,\n barres: [{\n fromString: 4,\n toString: 2,\n fret: 1\n }]\n },\n 'm7b5 E': {\n name: 'm7b5',\n chord: [[1, 'x'], [2, 1], [3, 2], [4, 2], [5, 'x'], [6, 2]],\n positionText: 1\n },\n 'sus4 E': {\n name: 'sus4',\n chord: [],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }, {\n fromString: 5,\n toString: 3,\n fret: 3\n }]\n },\n '7sus4 E': {\n name: '7sus4',\n chord: [[3, 3], [5, 3]],\n barres: [{\n fromString: 6,\n toString: 1,\n fret: 1\n }]\n },\n '13 E': {\n name: '13',\n chord: [[1, 'x'], [2, 4], [3, 3], [4, 2], [5, 'x'], [6, 2]],\n positionText: 1\n },\n 'M A': {\n name: 'Maj',\n chord: [[2, 3], [3, 3], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n 'm A': {\n name: 'm',\n chord: [[2, 2], [3, 3], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n '7 A': {\n name: '7',\n chord: [[2, 3], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n 'm7 A': {\n name: 'm7',\n chord: [[2, 2], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n 'm7b5 A': {\n name: 'm7b5',\n chord: [[2, 2], [4, 2], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 3,\n fret: 1\n }]\n },\n 'dim A': {\n name: 'dim',\n chord: [[1, 'x'], [2, 3], [3, 1], [4, 3], [5, 2], [6, 'x']],\n positionText: 1\n },\n 'M7 A': {\n name: 'Maj7',\n chord: [[2, 3], [3, 2], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n 'sus2 A': {\n name: 'sus2',\n chord: [[3, 3], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n 'sus4 A': {\n name: 'sus4',\n chord: [[2, 4], [3, 3], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n '7sus4 A': {\n name: '7sus4',\n chord: [[2, 4], [4, 3], [6, 'x']],\n barres: [{\n fromString: 5,\n toString: 1,\n fret: 1\n }]\n },\n '9 A': {\n name: '9',\n chord: [[1, 'x'], [2, 2], [3, 2], [4, 1], [5, 2], [6, 'x']],\n positionText: 1\n },\n '7b9 A': {\n name: '7b9',\n chord: [[1, 'x'], [2, 1], [3, 2], [4, 1], [5, 2], [6, 'x']],\n positionText: 1\n },\n '7#9 A': {\n name: '7#9',\n chord: [[1, 'x'], [2, 3], [3, 2], [4, 1], [5, 2], [6, 'x']],\n positionText: 1\n },\n '13 A': {\n name: '13',\n chord: [[1, 4], [2, 4], [3, 2], [4, 4], [5, 2], [6, 'x']],\n positionText: 1\n }\n};\nvar POSITIONS = {\n E: {\n A: 5,\n 'A#': 6,\n Bb: 6,\n B: 7,\n C: 8,\n 'C#': 9,\n Db: 9,\n D: 10,\n 'D#': 11,\n Eb: 11,\n E: 12,\n F: 1,\n 'F#': 2,\n Gb: 2,\n G: 3,\n 'G#': 4,\n Ab: 4\n },\n A: {\n A: 12,\n 'A#': 1,\n Bb: 1,\n B: 2,\n C: 3,\n 'C#': 4,\n Db: 4,\n D: 5,\n 'D#': 6,\n Eb: 6,\n E: 7,\n F: 8,\n 'F#': 9,\n Gb: 9,\n G: 10,\n 'G#': 11,\n Ab: 11\n }\n};\n\nfunction build(key, string, shape) {\n var theString = string.toUpperCase();\n var position = POSITIONS[theString][key];\n var struct = SHAPES[shape];\n return {\n name: key + struct.name,\n chord: struct.chord,\n position: position,\n positionText: struct.positionText,\n barres: struct.barres\n };\n}\n\n\n\n//# sourceURL=webpack://%5Bname%5D/./builder.js?"); /***/ }), /***/ "./chordbox.js": /*!*********************!*\ !*** ./chordbox.js ***! \*********************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _svgdotjs_svg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @svgdotjs/svg.js */ \"./node_modules/@svgdotjs/svg.js/src/main.js\");\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/*\n * Vex Chords v2\n * Mohit Muthanna Cheppudira -- http://0xfe.blogspot.com\n */\n // ChordBox implements the rendering logic for the chord\n// diagrams.\n\nvar ChordBox =\n/*#__PURE__*/\nfunction () {\n // sel can be a selector or an element.\n function ChordBox(sel, params) {\n var _this = this;\n\n _classCallCheck(this, ChordBox);\n\n this.sel = sel;\n this.params = _objectSpread({}, {\n numStrings: 6,\n numFrets: 5,\n x: 0,\n y: 0,\n width: 100,\n height: 120,\n strokeWidth: 1,\n showTuning: true,\n defaultColor: '#666',\n bgColor: '#fff',\n labelColor: '#fff',\n fontFamily: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n fontSize: undefined,\n fontStyle: 'light',\n fontWeight: '100',\n labelWeight: '100'\n }, params); // Setup defaults if not specifically overridden\n\n ['bridgeColor', 'stringColor', 'fretColor', 'strokeColor', 'textColor'].forEach(function (param) {\n _this.params[param] = _this.params[param] || _this.params.defaultColor;\n });\n ['stringWidth', 'fretWidth'].forEach(function (param) {\n _this.params[param] = _this.params[param] || _this.params.strokeWidth;\n }); // Create canvas and add it to the DOM\n\n this.canvas = Object(_svgdotjs_svg_js__WEBPACK_IMPORTED_MODULE_0__[\"SVG\"])().addTo(sel).size(this.params.width, this.params.height); // Size and shift board\n\n this.width = this.params.width * 0.75;\n this.height = this.params.height * 0.75;\n this.x = this.params.x + this.params.width * 0.15;\n this.y = this.params.y + this.params.height * 0.15;\n this.numStrings = this.params.numStrings;\n this.numFrets = this.params.numFrets;\n this.spacing = this.width / this.numStrings;\n this.fretSpacing = this.height / (this.numFrets + 2); // Add room on sides for finger positions on 1. and 6. string\n\n this.x += this.spacing / 2;\n this.y += this.fretSpacing;\n this.metrics = {\n circleRadius: this.width / 20,\n barreRadius: this.width / 25,\n fontSize: this.params.fontSize || Math.ceil(this.width / 8),\n barShiftX: this.width / 28,\n bridgeStrokeWidth: Math.ceil(this.height / 36)\n }; // Content\n\n this.position = 0;\n this.positionText = 0;\n this.chord = [];\n this.bars = [];\n this.tuning = ['E', 'A', 'D', 'G', 'B', 'E'];\n }\n\n _createClass(ChordBox, [{\n key: \"setNumFrets\",\n value: function setNumFrets(numFrets) {\n this.numFrets = numFrets;\n this.fretSpacing = this.height / (this.numFrets + 1);\n return this;\n }\n }, {\n key: \"setPositionText\",\n value: function setPositionText(position) {\n this.positionText = position;\n return this;\n }\n }, {\n key: \"drawText\",\n value: function drawText(x, y, msg, attrs) {\n var textAttrs = _objectSpread({}, {\n family: this.params.fontFamily,\n size: this.metrics.fontSize,\n style: this.params.fontStyle,\n weight: this.params.fontWeight\n }, attrs);\n\n var text = this.canvas.text(\"\".concat(msg)).stroke(this.params.textColor).fill(this.params.textColor).font(textAttrs);\n return text.move(x - text.length() / 2, y);\n }\n }, {\n key: \"drawLine\",\n value: function drawLine(x, y, newX, newY) {\n return this.canvas.line(0, 0, newX - x, newY - y).move(x, y);\n }\n }, {\n key: \"draw\",\n value: function draw(_ref) {\n var chord = _ref.chord,\n position = _ref.position,\n barres = _ref.barres,\n positionText = _ref.positionText,\n tuning = _ref.tuning;\n this.chord = chord;\n this.position = position || 0;\n this.positionText = positionText || 0;\n this.barres = barres || [];\n this.tuning = tuning || ['E', 'A', 'D', 'G', 'B', 'E'];\n\n if (this.tuning.length === 0) {\n this.fretSpacing = this.height / (this.numFrets + 1);\n }\n\n var spacing = this.spacing;\n var fretSpacing = this.fretSpacing; // Draw guitar bridge\n\n if (this.position <= 1) {\n var fromX = this.x;\n var fromY = this.y - this.metrics.bridgeStrokeWidth;\n this.canvas.rect(this.x + spacing * (this.numStrings - 1) - fromX, this.y - fromY).move(fromX, fromY).stroke({\n width: 0\n }).fill(this.params.bridgeColor);\n } else {\n // Draw position number\n this.drawText(this.x - this.spacing / 2 - this.spacing * 0.1, this.y + this.fretSpacing * this.positionText, this.position);\n } // Draw strings\n\n\n for (var i = 0; i < this.numStrings; i += 1) {\n this.drawLine(this.x + spacing * i, this.y, this.x + spacing * i, this.y + fretSpacing * this.numFrets).stroke({\n width: this.params.stringWidth,\n color: this.params.stringColor\n });\n } // Draw frets\n\n\n for (var _i = 0; _i < this.numFrets + 1; _i += 1) {\n this.drawLine(this.x, this.y + fretSpacing * _i, this.x + spacing * (this.numStrings - 1), this.y + fretSpacing * _i).stroke({\n width: this.params.fretWidth,\n color: this.params.fretColor\n });\n } // Draw tuning keys\n\n\n if (this.params.showTuning && this.tuning.length !== 0) {\n for (var _i2 = 0; _i2 < Math.min(this.numStrings, this.tuning.length); _i2 += 1) {\n this.drawText(this.x + this.spacing * _i2, this.y + this.numFrets * this.fretSpacing + this.fretSpacing / 12, this.tuning[_i2]);\n }\n } // Draw chord\n\n\n for (var _i3 = 0; _i3 < this.chord.length; _i3 += 1) {\n // Light up string, fret, and optional label.\n this.lightUp({\n string: this.chord[_i3][0],\n fret: this.chord[_i3][1],\n label: this.chord.length > 2 ? this.chord[_i3][2] : undefined\n });\n } // Draw barres\n\n\n for (var _i4 = 0; _i4 < this.barres.length; _i4 += 1) {\n this.lightBar(this.barres[_i4].fromString, this.barres[_i4].toString, this.barres[_i4].fret);\n }\n }\n }, {\n key: \"lightUp\",\n value: function lightUp(_ref2) {\n var string = _ref2.string,\n fret = _ref2.fret,\n label = _ref2.label;\n var stringNum = this.numStrings - string;\n var shiftPosition = this.position === 1 && this.positionText === 1 ? this.positionText : 0;\n var mute = fret === 'x';\n var fretNum = fret === 'x' ? 0 : fret - shiftPosition;\n var x = this.x + this.spacing * stringNum;\n var y = this.y + this.fretSpacing * fretNum;\n\n if (fretNum === 0) {\n y -= this.metrics.bridgeStrokeWidth;\n }\n\n if (!mute) {\n this.canvas.circle().move(x, y - this.fretSpacing / 2).radius(this.metrics.circleRadius).stroke({\n color: this.params.strokeColor,\n width: this.params.strokeWidth\n }).fill(fretNum > 0 ? this.params.strokeColor : this.params.bgColor);\n } else {\n this.drawText(x, y - this.fretSpacing, 'X');\n }\n\n if (label) {\n var fontSize = this.metrics.fontSize * 0.55;\n var textYShift = fontSize * 0.66;\n this.drawText(x, y - this.fretSpacing / 2 - textYShift, label, {\n weight: this.params.labelWeight,\n size: fontSize\n }).stroke({\n width: 0.7,\n color: fretNum !== 0 ? this.params.labelColor : this.params.strokeColor\n }).fill(fretNum !== 0 ? this.params.labelColor : this.params.strokeColor);\n }\n\n return this;\n }\n }, {\n key: \"lightBar\",\n value: function lightBar(stringFrom, stringTo, theFretNum) {\n var fretNum = theFretNum;\n\n if (this.position === 1 && this.positionText === 1) {\n fretNum -= this.positionText;\n }\n\n var stringFromNum = this.numStrings - stringFrom;\n var stringToNum = this.numStrings - stringTo;\n var x = this.x + this.spacing * stringFromNum - this.metrics.barShiftX;\n var xTo = this.x + this.spacing * stringToNum + this.metrics.barShiftX;\n var y = this.y + this.fretSpacing * (fretNum - 1) + this.fretSpacing / 4;\n var yTo = this.y + this.fretSpacing * (fretNum - 1) + this.fretSpacing / 4 * 3;\n this.canvas.rect(xTo - x, yTo - y).move(x, y).radius(this.metrics.barreRadius).fill(this.params.strokeColor);\n return this;\n }\n }]);\n\n return ChordBox;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ChordBox);\n\n//# sourceURL=webpack://%5Bname%5D/./chordbox.js?"); /***/ }), /***/ "./index.js": /*!******************!*\ !*** ./index.js ***! \******************/ /*! exports provided: POSITIONS, SHAPES, ChordBox, build, draw */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"draw\", function() { return draw; });\n/* harmony import */ var _chordbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chordbox */ \"./chordbox.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ChordBox\", function() { return _chordbox__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _builder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./builder */ \"./builder.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"POSITIONS\", function() { return _builder__WEBPACK_IMPORTED_MODULE_1__[\"POSITIONS\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SHAPES\", function() { return _builder__WEBPACK_IMPORTED_MODULE_1__[\"SHAPES\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"build\", function() { return _builder__WEBPACK_IMPORTED_MODULE_1__[\"build\"]; });\n\n/*\n * Vex Chords v2\n * Mohit Muthanna Cheppudira -- http://0xfe.blogspot.com\n */\n\n\n\nfunction draw(sel, chord, opts) {\n return new _chordbox__WEBPACK_IMPORTED_MODULE_0__[\"default\"](sel, opts).draw(chord);\n}\n\n\n\n//# sourceURL=webpack://%5Bname%5D/./index.js?"); /***/ }), /***/ "./node_modules/@svgdotjs/svg.js/src/animation/Animator.js": /*!*****************************************************************!*\ !*** ./node_modules/@svgdotjs/svg.js/src/animation/Animator.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_window_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/window.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/window.js\");\n/* harmony import */ var _Queue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Queue.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Queue.js\");\n\r\n\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new _Queue_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\r\n timeouts: new _Queue_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\r\n immediates: new _Queue_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\r\n timer: () => _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.performance || _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer().now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n immediate (fn) {\r\n // Add the immediate fn to the end of the queue\r\n var node = Animator.immediates.push(fn)\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n cancelImmediate (node) {\r\n node != null && Animator.immediates.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run(now)\r\n }\r\n\r\n var nextImmediate = null\r\n while ((nextImmediate = Animator.immediates.shift())) {\r\n nextImmediate()\r\n }\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? _utils_window_js__WEBPACK_IMPORTED_MODULE_0__[\"globals\"].window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Animator);\r\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@svgdotjs/svg.js/src/animation/Animator.js?"); /***/ }), /***/ "./node_modules/@svgdotjs/svg.js/src/animation/Controller.js": /*!*******************************************************************!*\ !*** ./node_modules/@svgdotjs/svg.js/src/animation/Controller.js ***! \*******************************************************************/ /*! exports provided: easing, Stepper, Ease, Controller, Spring, PID */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"easing\", function() { return easing; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Stepper\", function() { return Stepper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ease\", function() { return Ease; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Controller\", function() { return Controller; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Spring\", function() { return Spring; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PID\", function() { return PID; });\n/* harmony import */ var _modules_core_defaults_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modules/core/defaults.js */ \"./node_modules/@svgdotjs/svg.js/src/modules/core/defaults.js\");\n/* harmony import */ var _utils_adopter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/adopter.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/adopter.js\");\n\r\n\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nlet easing = {\r\n '-': function (pos) {\r\n return pos\r\n },\r\n '<>': function (pos) {\r\n return -Math.cos(pos * Math.PI) / 2 + 0.5\r\n },\r\n '>': function (pos) {\r\n return Math.sin(pos * Math.PI / 2)\r\n },\r\n '<': function (pos) {\r\n return -Math.cos(pos * Math.PI / 2) + 1\r\n },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nclass Stepper {\r\n done () {\r\n return false\r\n }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nclass Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || _modules_core_defaults_js__WEBPACK_IMPORTED_MODULE_0__[\"timeline\"].ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nclass Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nclass Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current\r\n + velocity * dt\r\n + acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nObject(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_1__[\"extend\"])(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nclass PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nObject(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_1__[\"extend\"])(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@svgdotjs/svg.js/src/animation/Controller.js?"); /***/ }), /***/ "./node_modules/@svgdotjs/svg.js/src/animation/Morphable.js": /*!******************************************************************!*\ !*** ./node_modules/@svgdotjs/svg.js/src/animation/Morphable.js ***! \******************************************************************/ /*! exports provided: default, NonMorphable, TransformBag, ObjectBag, registerMorphableType, makeMorphable */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Morphable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NonMorphable\", function() { return NonMorphable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TransformBag\", function() { return TransformBag; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObjectBag\", function() { return ObjectBag; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerMorphableType\", function() { return registerMorphableType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeMorphable\", function() { return makeMorphable; });\n/* harmony import */ var _Controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Controller.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Controller.js\");\n/* harmony import */ var _modules_core_regex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modules/core/regex.js */ \"./node_modules/@svgdotjs/svg.js/src/modules/core/regex.js\");\n/* harmony import */ var _utils_adopter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/adopter.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/adopter.js\");\n/* harmony import */ var _types_Color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types/Color.js */ \"./node_modules/@svgdotjs/svg.js/src/types/Color.js\");\n/* harmony import */ var _types_PathArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../types/PathArray.js */ \"./node_modules/@svgdotjs/svg.js/src/types/PathArray.js\");\n/* harmony import */ var _types_SVGArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../types/SVGArray.js */ \"./node_modules/@svgdotjs/svg.js/src/types/SVGArray.js\");\n/* harmony import */ var _types_SVGNumber_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../types/SVGNumber.js */ \"./node_modules/@svgdotjs/svg.js/src/types/SVGNumber.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nclass Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new _Controller_js__WEBPACK_IMPORTED_MODULE_0__[\"Ease\"]('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(_types_SVGNumber_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])\r\n } else if (type === 'string') {\r\n if (_types_Color_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isColor(value)) {\r\n this.type(_types_Color_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])\r\n } else if (_modules_core_regex_js__WEBPACK_IMPORTED_MODULE_1__[\"delimiter\"].test(value)) {\r\n this.type(_modules_core_regex_js__WEBPACK_IMPORTED_MODULE_1__[\"pathLetters\"].test(value)\r\n ? _types_PathArray_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\r\n : _types_SVGArray_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\r\n )\r\n } else if (_modules_core_regex_js__WEBPACK_IMPORTED_MODULE_1__[\"numberAndUnit\"].test(value)) {\r\n this.type(_types_SVGNumber_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(_types_SVGArray_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"])\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value))\r\n if (this._type === _types_Color_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\r\n result = this._to ? result[this._to[4]]()\r\n : this._from ? result[this._from[4]]()\r\n : result\r\n }\r\n result = result.toArray()\r\n\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context\r\n || Array.apply(null, Array(result.length))\r\n .map(Object)\r\n .map(function (o) {\r\n o.done = true\r\n return o\r\n })\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nclass NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [ this.value ]\r\n }\r\n}\r\n\r\nclass TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nclass ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nfunction registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nfunction makeMorphable () {\r\n Object(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_2__[\"extend\"])(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@svgdotjs/svg.js/src/animation/Morphable.js?"); /***/ }), /***/ "./node_modules/@svgdotjs/svg.js/src/animation/Queue.js": /*!**************************************************************!*\ !*** ./node_modules/@svgdotjs/svg.js/src/animation/Queue.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Queue; });\nclass Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n\n\n//# sourceURL=webpack://%5Bname%5D/./node_modules/@svgdotjs/svg.js/src/animation/Queue.js?"); /***/ }), /***/ "./node_modules/@svgdotjs/svg.js/src/animation/Runner.js": /*!***************************************************************!*\ !*** ./node_modules/@svgdotjs/svg.js/src/animation/Runner.js ***! \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Runner; });\n/* harmony import */ var _Controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Controller.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Controller.js\");\n/* harmony import */ var _utils_adopter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/adopter.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/adopter.js\");\n/* harmony import */ var _modules_core_gradiented_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modules/core/gradiented.js */ \"./node_modules/@svgdotjs/svg.js/src/modules/core/gradiented.js\");\n/* harmony import */ var _utils_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/utils.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/utils.js\");\n/* harmony import */ var _modules_core_defaults_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modules/core/defaults.js */ \"./node_modules/@svgdotjs/svg.js/src/modules/core/defaults.js\");\n/* harmony import */ var _utils_methods_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/methods.js */ \"./node_modules/@svgdotjs/svg.js/src/utils/methods.js\");\n/* harmony import */ var _modules_core_circled_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modules/core/circled.js */ \"./node_modules/@svgdotjs/svg.js/src/modules/core/circled.js\");\n/* harmony import */ var _Animator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Animator.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Animator.js\");\n/* harmony import */ var _types_Box_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../types/Box.js */ \"./node_modules/@svgdotjs/svg.js/src/types/Box.js\");\n/* harmony import */ var _types_EventTarget_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../types/EventTarget.js */ \"./node_modules/@svgdotjs/svg.js/src/types/EventTarget.js\");\n/* harmony import */ var _types_Matrix_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../types/Matrix.js */ \"./node_modules/@svgdotjs/svg.js/src/types/Matrix.js\");\n/* harmony import */ var _Morphable_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Morphable.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Morphable.js\");\n/* harmony import */ var _types_Point_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../types/Point.js */ \"./node_modules/@svgdotjs/svg.js/src/types/Point.js\");\n/* harmony import */ var _types_SVGNumber_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../types/SVGNumber.js */ \"./node_modules/@svgdotjs/svg.js/src/types/SVGNumber.js\");\n/* harmony import */ var _Timeline_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Timeline.js */ \"./node_modules/@svgdotjs/svg.js/src/animation/Timeline.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nclass Runner extends _types_EventTarget_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"] {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? _modules_core_defaults_js__WEBPACK_IMPORTED_MODULE_4__[\"timeline\"].duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new _Controller_js__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"](options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof _Controller_js__WEBPACK_IMPORTED_MODULE_0__[\"Controller\"]\r\n this._stepper = this._isDeclarative ? options : new _Controller_js__WEBPACK_IMPORTED_MODULE_0__[\"Ease\"]()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new _types_Matrix_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n\r\n this._frameId = null\r\n\r\n // Stores how long a runner is stored after beeing done\r\n this._persist = this._isDeclarative ? true : null\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline