diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-04 17:04:11 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-04 17:04:11 +0100 |
commit | d22dce113a4a61d76b3c0e7c7fb77231f575c6fd (patch) | |
tree | 7fd98163a8cb2564009a2ed53e7b419ff64cf76f /dist | |
parent | 426256d2fcecdca34acf7e15c9b8e79c183f0b5a (diff) | |
download | svg.js-d22dce113a4a61d76b3c0e7c7fb77231f575c6fd.tar.gz svg.js-d22dce113a4a61d76b3c0e7c7fb77231f575c6fd.zip |
fix even more tests
Diffstat (limited to 'dist')
-rw-r--r-- | dist/svg.js | 266 | ||||
-rw-r--r-- | dist/svg.min.js | 2 |
2 files changed, 149 insertions, 119 deletions
diff --git a/dist/svg.js b/dist/svg.js index d8edd95..82efb01 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -301,6 +301,10 @@ var SVG = (function () { return c + d.replace(dots, ' .'); } // creates deep clone of array + function matcher(el, selector) { + return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); + } // Convert dash-separated-string to camelCase + function camelCase(s) { return s.toLowerCase().replace(/-(.)/g, function (m, g) { return g.toUpperCase(); @@ -320,7 +324,7 @@ var SVG = (function () { return hex$$1.length === 1 ? '0' + hex$$1 : hex$$1; } // Calculate proportional width and height values when necessary - function proportionalSize$1(element, width, height) { + function proportionalSize(element, width, height) { if (width == null || height == null) { var box = element.bbox(); @@ -446,25 +450,25 @@ var SVG = (function () { } // Default namespaces - var ns$1 = 'http://www.w3.org/2000/svg'; + var ns = 'http://www.w3.org/2000/svg'; var xmlns = 'http://www.w3.org/2000/xmlns/'; var xlink = 'http://www.w3.org/1999/xlink'; var svgjs = 'http://svgjs.com/svgjs'; - var ns$2 = /*#__PURE__*/Object.freeze({ - ns: ns$1, + var ns$1 = /*#__PURE__*/Object.freeze({ + ns: ns, xmlns: xmlns, xlink: xlink, svgjs: svgjs }); - function nodeOrNew$1(name, node) { + function nodeOrNew(name, node) { return node || makeNode(name); } // Method for element creation function makeNode(name) { // create element - return document.createElementNS(ns$1, name); + return document.createElementNS(ns, name); } // Method for extending objects function extend(modules, methods) { @@ -522,7 +526,7 @@ var SVG = (function () { } var tools = /*#__PURE__*/Object.freeze({ - nodeOrNew: nodeOrNew$1, + nodeOrNew: nodeOrNew, makeNode: makeNode, extend: extend, extend2: extend2, @@ -536,7 +540,7 @@ var SVG = (function () { if (element instanceof Base) return element; if (_typeof(element) === 'object') { - return adopt$1(element); + return adopt(element); } if (element == null) { @@ -544,18 +548,18 @@ var SVG = (function () { } if (typeof element === 'string' && element.charAt(0) !== '<') { - return adopt$1(document.querySelector(element)); + return adopt(document.querySelector(element)); } var node = makeNode('svg'); node.innerHTML = element; // We can use firstChild here because we know, // that the first char is < and thus an element - element = adopt$1(node.firstChild); + element = adopt(node.firstChild); return element; } // Adopt existing svg elements - function adopt$1(node) { + function adopt(node) { // check for presence of node if (!node) return null; // make sure a node isn't already adopted @@ -604,16 +608,16 @@ var SVG = (function () { } if (node.id) { - return adopt$1(node).id(eid(node.nodeName)); + return adopt(node).id(eid(node.nodeName)); } - return adopt$1(node); + return adopt(node); } var adopter = /*#__PURE__*/Object.freeze({ root: root, makeInstance: makeInstance, - adopt: adopt$1, + adopt: adopt, register: register, getClass: getClass, eid: eid, @@ -671,7 +675,7 @@ var SVG = (function () { function Defs(node) { _classCallCheck(this, Defs); - return _possibleConstructorReturn(this, _getPrototypeOf(Defs).call(this, nodeOrNew$1('defs', node), Defs)); + return _possibleConstructorReturn(this, _getPrototypeOf(Defs).call(this, nodeOrNew('defs', node), Defs)); } _createClass(Defs, [{ @@ -849,6 +853,7 @@ var SVG = (function () { }(); var Doc = getClass(root); + var HtmlNode$1 = getClass('HtmlNode'); function setup(node) { // initialize data object this.dom = {}; // create circular reference @@ -896,7 +901,7 @@ var SVG = (function () { } // Set element size to given width and height function size(width, height) { - var p = proportionalSize$1(this, width, height); + var p = proportionalSize(this, width, height); return this.width(new SVGNumber(p.width)).height(new SVGNumber(p.height)); } // Clone element @@ -993,12 +998,12 @@ var SVG = (function () { if (!parent.node.parentNode) return null; // get parent element - parent = adopt$1(parent.node.parentNode); + parent = adopt(parent.node.parentNode); if (!type) return parent; // loop trough ancestors if type is given while (parent && parent.node instanceof window.SVGElement) { if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent; - parent = adopt$1(parent.node.parentNode); + parent = adopt(parent.node.parentNode); } } // Get parent document @@ -1017,7 +1022,7 @@ var SVG = (function () { do { parent = parent.parent(type); - if (!parent || !parent.node) break; + if (!parent || parent instanceof HtmlNode$1) break; parents.push(parent); } while (parent.parent); @@ -1025,7 +1030,7 @@ var SVG = (function () { } // matches the element vs a css selector function matches(selector) { - return matches(this.node, selector); + return matcher(this.node, selector); } // Returns the svg node to call native svg methods on it function native() { @@ -1103,7 +1108,7 @@ var SVG = (function () { _classCallCheck(this, Doc); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Doc).call(this, nodeOrNew$1('svg', node), Doc)); + _this = _possibleConstructorReturn(this, _getPrototypeOf(Doc).call(this, nodeOrNew('svg', node), Doc)); _this.namespace(); @@ -1129,7 +1134,7 @@ var SVG = (function () { value: function namespace() { if (!this.isRoot()) return this.doc().namespace(); return this.attr({ - xmlns: ns$1, + xmlns: ns, version: '1.1' }).attr('xmlns:xlink', xlink, xmlns).attr('xmlns:svgjs', svgjs, xmlns); } // Creates and returns defs element @@ -1138,14 +1143,14 @@ var SVG = (function () { key: "defs", value: function defs$$1() { if (!this.isRoot()) return this.doc().defs(); - return adopt$1(this.node.getElementsByTagName('defs')[0]) || this.put(new Defs()); + return adopt(this.node.getElementsByTagName('defs')[0]) || this.put(new Defs()); } // custom parent method }, { key: "parent", value: function parent$$1(type) { if (this.isRoot()) { - return this.node.parentNode.nodeName === '#document' ? null : adopt$1(this.node.parentNode); + return this.node.parentNode.nodeName === '#document' ? null : adopt(this.node.parentNode); } return parent.call(this, type); @@ -1196,7 +1201,7 @@ var SVG = (function () { function G(node) { _classCallCheck(this, G); - return _possibleConstructorReturn(this, _getPrototypeOf(G).call(this, nodeOrNew$1('g', node), G)); + return _possibleConstructorReturn(this, _getPrototypeOf(G).call(this, nodeOrNew('g', node), G)); } return G; @@ -1373,7 +1378,7 @@ var SVG = (function () { _classCallCheck(this, Bare); - return _possibleConstructorReturn(this, _getPrototypeOf(Bare).call(this, nodeOrNew$1(node, typeof node === 'string' ? null : node), Bare)); //extend(this, inherit) + return _possibleConstructorReturn(this, _getPrototypeOf(Bare).call(this, nodeOrNew(node, typeof node === 'string' ? null : node), Bare)); //extend(this, inherit) } _createClass(Bare, [{ @@ -1435,7 +1440,7 @@ var SVG = (function () { } // Custom size function function size$1(width, height) { - var p = proportionalSize$1(this, width, height); + var p = proportionalSize(this, width, height); return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2)); } @@ -1459,7 +1464,7 @@ var SVG = (function () { function Circle(node) { _classCallCheck(this, Circle); - return _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, nodeOrNew$1('circle', node), Circle)); + return _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, nodeOrNew('circle', node), Circle)); } _createClass(Circle, [{ @@ -1574,7 +1579,7 @@ var SVG = (function () { function baseFind(query, parent) { return map((parent || document).querySelectorAll(query), function (node) { - return adopt$1(node); + return adopt(node); }); } // Scoped find method @@ -1593,7 +1598,7 @@ var SVG = (function () { function ClipPath(node) { _classCallCheck(this, ClipPath); - return _possibleConstructorReturn(this, _getPrototypeOf(ClipPath).call(this, nodeOrNew$1('clipPath', node), ClipPath)); + return _possibleConstructorReturn(this, _getPrototypeOf(ClipPath).call(this, nodeOrNew('clipPath', node), ClipPath)); } // Unclip all clipped elements and remove itself @@ -1650,7 +1655,7 @@ var SVG = (function () { function A(node) { _classCallCheck(this, A); - return _possibleConstructorReturn(this, _getPrototypeOf(A).call(this, nodeOrNew$1('a', node), A)); + return _possibleConstructorReturn(this, _getPrototypeOf(A).call(this, nodeOrNew('a', node), A)); } // Link url @@ -1701,7 +1706,7 @@ var SVG = (function () { function Ellipse(node) { _classCallCheck(this, Ellipse); - return _possibleConstructorReturn(this, _getPrototypeOf(Ellipse).call(this, nodeOrNew$1('ellipse', node), Ellipse)); + return _possibleConstructorReturn(this, _getPrototypeOf(Ellipse).call(this, nodeOrNew('ellipse', node), Ellipse)); } return Ellipse; @@ -1723,7 +1728,7 @@ var SVG = (function () { function Stop(node) { _classCallCheck(this, Stop); - return _possibleConstructorReturn(this, _getPrototypeOf(Stop).call(this, nodeOrNew$1('stop', node), Stop)); + return _possibleConstructorReturn(this, _getPrototypeOf(Stop).call(this, nodeOrNew('stop', node), Stop)); } // add color stops @@ -2033,7 +2038,7 @@ var SVG = (function () { try { for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var node = _step.value; - attr[node.nodeName] = isNumer.test(node.nodeValue) ? parseFloat(node.nodeValue) : node.nodeValue; + attr[node.nodeName] = isNumber.test(node.nodeValue) ? parseFloat(node.nodeValue) : node.nodeValue; } } catch (err) { _didIteratorError = true; @@ -2120,7 +2125,7 @@ var SVG = (function () { function Gradient(type) { _classCallCheck(this, Gradient); - return _possibleConstructorReturn(this, _getPrototypeOf(Gradient).call(this, nodeOrNew$1(type + 'Gradient', typeof type === 'string' ? null : type), Gradient)); + return _possibleConstructorReturn(this, _getPrototypeOf(Gradient).call(this, nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type), Gradient)); } // Add a color stop @@ -2196,7 +2201,7 @@ var SVG = (function () { function Pattern(node) { _classCallCheck(this, Pattern); - return _possibleConstructorReturn(this, _getPrototypeOf(Pattern).call(this, nodeOrNew$1('pattern', node), Pattern)); + return _possibleConstructorReturn(this, _getPrototypeOf(Pattern).call(this, nodeOrNew('pattern', node), Pattern)); } // Return the fill id @@ -2261,31 +2266,22 @@ var SVG = (function () { }); register(Pattern); - // ;[ 'click', - // 'dblclick', - // 'mousedown', - // 'mouseup', - // 'mouseover', - // 'mouseout', - // 'mousemove', - // 'mouseenter', - // 'mouseleave', - // 'touchstart', - // 'touchmove', - // 'touchleave', - // 'touchend', - // 'touchcancel' ].forEach(function (event) { - // // add event to Element - // Element.prototype[event] = function (f) { - // if (f === null) { - // off(this, event) - // } else { - // on(this, event, f) - // } - // return this - // } - // }) + var methods$1 = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove', 'mouseenter', 'mouseleave', 'touchstart', 'touchmove', 'touchleave', 'touchend', 'touchcancel'].reduce(function (last, event) { + // add event to Element + var fn = function fn(f) { + if (f === null) { + off(this, event); + } else { + on(this, event, f); + } + + return this; + }; + last[event] = fn; + return last; + }, {}); + registerMethods('Element', methods$1); var listenerId = 0; function getEventTarget$1(node) { @@ -2401,6 +2397,12 @@ var SVG = (function () { return event; } + var events = /*#__PURE__*/Object.freeze({ + on: on, + off: off, + dispatch: dispatch + }); + var Image = /*#__PURE__*/ function (_Base) { @@ -2409,7 +2411,7 @@ var SVG = (function () { function Image(node) { _classCallCheck(this, Image); - return _possibleConstructorReturn(this, _getPrototypeOf(Image).call(this, nodeOrNew$1('image', node), Image)); + return _possibleConstructorReturn(this, _getPrototypeOf(Image).call(this, nodeOrNew('image', node), Image)); } // (re)load image @@ -2706,7 +2708,7 @@ var SVG = (function () { function Line(node) { _classCallCheck(this, Line); - return _possibleConstructorReturn(this, _getPrototypeOf(Line).call(this, nodeOrNew$1('line', node), Line)); + return _possibleConstructorReturn(this, _getPrototypeOf(Line).call(this, nodeOrNew('line', node), Line)); } // Get array @@ -2744,7 +2746,7 @@ var SVG = (function () { }, { key: "size", value: function size(width, height) { - var p = proportionalSize$1(this, width, height); + var p = proportionalSize(this, width, height); return this.attr(this.array().size(p.width, p.height).toLine()); } }]); @@ -2858,7 +2860,7 @@ var SVG = (function () { function Mask(node) { _classCallCheck(this, Mask); - return _possibleConstructorReturn(this, _getPrototypeOf(Mask).call(this, nodeOrNew$1('mask', node), Mask)); + return _possibleConstructorReturn(this, _getPrototypeOf(Mask).call(this, nodeOrNew('mask', node), Mask)); } // Unmask all masked elements and remove itself @@ -2931,7 +2933,7 @@ var SVG = (function () { return parser.nodes; } - var Point$1 = + var Point = /*#__PURE__*/ function () { // Initialize @@ -2970,7 +2972,7 @@ var SVG = (function () { key: "native", value: function native() { // create new point - var point = parser().svg.createSVGPoint(); // update with current values + var point = parser().svg.node.createSVGPoint(); // update with current values point.x = this.x; point.y = this.y; @@ -2994,7 +2996,7 @@ var SVG = (function () { Element: { // Get point point: function point(x, y) { - return new Point$1(x, y).transform(this.screenCTM().inverse()); + return new Point(x, y).transform(this.screenCTM().inverse()); } } }); @@ -3241,8 +3243,8 @@ var SVG = (function () { var result = []; - var p = new Point$1(); - var p0 = new Point$1(); + var p = new Point(); + var p0 = new Point(); var index = 0; var len = array.length; @@ -3493,7 +3495,7 @@ var SVG = (function () { function Path(node) { _classCallCheck(this, Path); - return _possibleConstructorReturn(this, _getPrototypeOf(Path).call(this, nodeOrNew$1('path', node), Path)); + return _possibleConstructorReturn(this, _getPrototypeOf(Path).call(this, nodeOrNew('path', node), Path)); } // Get array @@ -3537,7 +3539,7 @@ var SVG = (function () { }, { key: "size", value: function size(width, height) { - var p = proportionalSize$1(this, width, height); + var p = proportionalSize(this, width, height); return this.attr('d', this.array().size(p.width, p.height)); } // Set width of element @@ -3643,7 +3645,7 @@ var SVG = (function () { function Polygon(node) { _classCallCheck(this, Polygon); - return _possibleConstructorReturn(this, _getPrototypeOf(Polygon).call(this, nodeOrNew$1('polygon', node), Polygon)); + return _possibleConstructorReturn(this, _getPrototypeOf(Polygon).call(this, nodeOrNew('polygon', node), Polygon)); } return Polygon; @@ -3670,7 +3672,7 @@ var SVG = (function () { function Polyline(node) { _classCallCheck(this, Polyline); - return _possibleConstructorReturn(this, _getPrototypeOf(Polyline).call(this, nodeOrNew$1('polyline', node), Polyline)); + return _possibleConstructorReturn(this, _getPrototypeOf(Polyline).call(this, nodeOrNew('polyline', node), Polyline)); } return Polyline; @@ -3697,7 +3699,7 @@ var SVG = (function () { function Rect(node) { _classCallCheck(this, Rect); - return _possibleConstructorReturn(this, _getPrototypeOf(Rect).call(this, nodeOrNew$1('rect', node), Rect)); + return _possibleConstructorReturn(this, _getPrototypeOf(Rect).call(this, nodeOrNew('rect', node), Rect)); } return Rect; @@ -3721,7 +3723,7 @@ var SVG = (function () { function _Symbol(node) { _classCallCheck(this, _Symbol); - return _possibleConstructorReturn(this, _getPrototypeOf(_Symbol).call(this, nodeOrNew$1('symbol', node), _Symbol)); + return _possibleConstructorReturn(this, _getPrototypeOf(_Symbol).call(this, nodeOrNew('symbol', node), _Symbol)); } return _Symbol; @@ -3768,7 +3770,7 @@ var SVG = (function () { _classCallCheck(this, Text); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Text).call(this, nodeOrNew$1('text', node), Text)); + _this = _possibleConstructorReturn(this, _getPrototypeOf(Text).call(this, nodeOrNew('text', node), Text)); _this.dom.leading = new SVGNumber(1.3); // store leading value for rebuilding _this._rebuild = true; // enable automatic updating of dy values @@ -3823,6 +3825,7 @@ var SVG = (function () { value: function text(_text) { // act as getter if (_text === undefined) { + // FIXME use children() or each() var children = this.node.childNodes; var firstLine = 0; _text = ''; @@ -3951,7 +3954,7 @@ var SVG = (function () { function TextPath(node) { _classCallCheck(this, TextPath); - return _possibleConstructorReturn(this, _getPrototypeOf(TextPath).call(this, nodeOrNew$1('textPath', node), TextPath)); + return _possibleConstructorReturn(this, _getPrototypeOf(TextPath).call(this, nodeOrNew('textPath', node), TextPath)); } // return the array of the path track element @@ -4008,7 +4011,7 @@ var SVG = (function () { // FIXME: make this plural? // Get the textPath children textPath: function textPath() { - return this.select('textPath'); + return this.find('textPath'); } }, Path: { @@ -4037,7 +4040,7 @@ var SVG = (function () { function Tspan(node) { _classCallCheck(this, Tspan); - return _possibleConstructorReturn(this, _getPrototypeOf(Tspan).call(this, nodeOrNew$1('tspan', node), Tspan)); + return _possibleConstructorReturn(this, _getPrototypeOf(Tspan).call(this, nodeOrNew('tspan', node), Tspan)); } // Set text content @@ -4101,7 +4104,7 @@ var SVG = (function () { function Use(node) { _classCallCheck(this, Use); - return _possibleConstructorReturn(this, _getPrototypeOf(Use).call(this, nodeOrNew$1('use', node), Use)); + return _possibleConstructorReturn(this, _getPrototypeOf(Use).call(this, nodeOrNew('use', node), Use)); } // Use element as a reference @@ -4125,7 +4128,7 @@ var SVG = (function () { }); register(Use); - var Matrix$1 = + var Matrix = /*#__PURE__*/ function () { function Matrix() { @@ -4169,7 +4172,7 @@ var SVG = (function () { var t = Matrix.formatTransforms(o); var current = this; - var _transform = new Point$1(t.ox, t.oy).transform(current), + var _transform = new Point(t.ox, t.oy).transform(current), ox = _transform.x, oy = _transform.y; // Construct the resulting matrix @@ -4177,7 +4180,7 @@ var SVG = (function () { var transformer = new Matrix().translateO(t.rx, t.ry).lmultiplyO(current).translateO(-ox, -oy).scaleO(t.scaleX, t.scaleY).skewO(t.skewX, t.skewY).shearO(t.shear).rotateO(t.theta).translateO(ox, oy); // If we want the origin at a particular place, we force it there if (isFinite(t.px) || isFinite(t.py)) { - var origin = new Point$1(ox, oy).transform(transformer); // TODO: Replace t.px with isFinite(t.px) + var origin = new Point(ox, oy).transform(transformer); // TODO: Replace t.px with isFinite(t.px) var dx = t.px ? t.px - origin.x : 0; var dy = t.py ? t.py - origin.y : 0; @@ -4513,7 +4516,7 @@ var SVG = (function () { key: "native", value: function native() { // create new matrix - var matrix = parser().node.createSVGMatrix(); // update with current values + var matrix = parser().svg.node.createSVGMatrix(); // update with current values for (var i = abcdef.length - 1; i >= 0; i--) { matrix[abcdef[i]] = this[abcdef[i]]; @@ -4565,16 +4568,16 @@ var SVG = (function () { var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY : isFinite(o.scale) ? o.scale * flipY : isFinite(o.scaleY) ? o.scaleY * flipY : flipY; var shear = o.shear || 0; var theta = o.rotate || o.theta || 0; - var origin = new Point$1(o.origin || o.around || o.ox || o.originX, o.oy || o.originY); + var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY); var ox = origin.x; var oy = origin.y; - var position = new Point$1(o.position || o.px || o.positionX, o.py || o.positionY); + var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY); var px = position.x; var py = position.y; - var translate = new Point$1(o.translate || o.tx || o.translateX, o.ty || o.translateY); + var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY); var tx = translate.x; var ty = translate.y; - var relative = new Point$1(o.relative || o.rx || o.relativeX, o.ry || o.relativeY); + var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY); var rx = relative.x; var ry = relative.y; // Populate all of the values @@ -4623,7 +4626,7 @@ var SVG = (function () { Element: { // Get current matrix ctm: function ctm() { - return new Matrix$1(this.node.getCTM()); + return new Matrix(this.node.getCTM()); }, // Get current screen matrix screenCTM: function screenCTM() { @@ -4635,10 +4638,10 @@ var SVG = (function () { var rect = this.rect(1, 1); var m = rect.node.getScreenCTM(); rect.remove(); - return new Matrix$1(m); + return new Matrix(m); } - return new Matrix$1(this.node.getScreenCTM()); + return new Matrix(this.node.getScreenCTM()); } } }); @@ -4681,7 +4684,7 @@ var SVG = (function () { var xMax = -Infinity; var yMin = Infinity; var yMax = -Infinity; - var pts = [new Point$1(this.x, this.y), new Point$1(this.x2, this.y), new Point$1(this.x, this.y2), new Point$1(this.x2, this.y2)]; + var pts = [new Point(this.x, this.y), new Point(this.x2, this.y), new Point(this.x, this.y2), new Point(this.x2, this.y2)]; pts.forEach(function (p) { p = p.transform(m); xMin = Math.min(xMin, p.x); @@ -5572,7 +5575,7 @@ var SVG = (function () { this._time = 0; this._last = 0; // Save transforms applied to this runner - this.transforms = new Matrix$1(); + this.transforms = new Matrix(); this.transformId = 1; // Looping variables this._haveReversed = false; @@ -5813,7 +5816,7 @@ var SVG = (function () { this._initialise(running); // clear the transforms on this runner so they dont get added again and again - this.transforms = new Matrix$1(); + this.transforms = new Matrix(); var converged = this._run(declarative ? dt : position); // this.fire('step', this) @@ -5947,7 +5950,7 @@ var SVG = (function () { }, { key: "clearTransform", value: function clearTransform() { - this.transforms = new Matrix$1(); + this.transforms = new Matrix(); return this; } }], [{ @@ -5986,7 +5989,7 @@ var SVG = (function () { Runner.id = 0; var FakeRunner = function FakeRunner() { - var transforms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Matrix$1(); + var transforms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Matrix(); var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; var done = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; @@ -6014,7 +6017,7 @@ var SVG = (function () { function mergeTransforms() { // Find the matrix to apply to the element and apply it var runners = this._transformationRunners.runners; - var netTransform = runners.map(getRunnerTransform).reduce(lmultiply, new Matrix$1()); + var netTransform = runners.map(getRunnerTransform).reduce(lmultiply, new Matrix()); this.transform(netTransform); this._transformationRunners.merge(); @@ -6128,7 +6131,7 @@ var SVG = (function () { // taken into account .filter(function (runner) { return runner.id <= current.id; - }).map(getRunnerTransform).reduce(lmultiply, new Matrix$1()); + }).map(getRunnerTransform).reduce(lmultiply, new Matrix()); }, addRunner: function addRunner(runner) { this._transformationRunners.add(runner); @@ -6137,7 +6140,7 @@ var SVG = (function () { }, _prepareRunner: function _prepareRunner() { if (this._frameId == null) { - this._transformationRunners = new RunnerArray().add(new FakeRunner(new Matrix$1(this))); + this._transformationRunners = new RunnerArray().add(new FakeRunner(new Matrix(this))); this._frameId = frameId++; } } @@ -6206,7 +6209,7 @@ var SVG = (function () { var isMatrix = isMatrixLike(transforms); affine = transforms.affine != null ? transforms.affine : affine != null ? affine : !isMatrix; // Create a morepher and set its type - var morpher = new Morphable().type(affine ? TransformBag : Matrix$1).stepper(this._stepper); + var morpher = new Morphable().type(affine ? TransformBag : Matrix).stepper(this._stepper); var origin; var element; var current; @@ -6217,7 +6220,7 @@ var SVG = (function () { // make sure element and origin is defined element = element || this.element(); origin = origin || getOrigin(transforms, element); - startTransform = new Matrix$1(relative ? undefined : element); // add the runner to the element so it can merge transformations + startTransform = new Matrix(relative ? undefined : element); // add the runner to the element so it can merge transformations element.addRunner(this); // Deactivate all transforms that have run so far if we are absolute @@ -6231,11 +6234,11 @@ var SVG = (function () { // on this runner. We are absolute. We dont need these! if (!relative) this.clearTransform(); - var _transform = new Point$1(origin).transform(element._currentTransform(this)), + var _transform = new Point(origin).transform(element._currentTransform(this)), x = _transform.x, y = _transform.y; - var target = new Matrix$1(_objectSpread({}, transforms, { + var target = new Matrix(_objectSpread({}, transforms, { origin: [x, y] })); var start = this._isDeclarative && current ? current : startTransform; @@ -6272,7 +6275,7 @@ var SVG = (function () { morpher.to(target); var affineParameters = morpher.at(pos); currentAngle = affineParameters.rotate; - current = new Matrix$1(affineParameters); + current = new Matrix(affineParameters); this.addTransform(current); return morpher.done(); } @@ -6506,8 +6509,8 @@ var SVG = (function () { SVGArray: SVGArray, PathArray: PathArray, PointArray: PointArray, - Matrix: Matrix$1, - Point: Point$1, + Matrix: Matrix, + Point: Point, Box: Box$1, Color: Color, Morphable: Morphable, @@ -6656,6 +6659,27 @@ var SVG = (function () { after: after }); + function data(a, v, r) { + if (_typeof(a) === 'object') { + for (v in a) { + this.data(v, a[v]); + } + } else if (arguments.length < 2) { + try { + return JSON.parse(this.attr('data-' + a)); + } catch (e) { + return this.attr('data-' + a); + } + } else { + this.attr('data-' + a, v === null ? null : r === true || typeof v === 'string' || typeof v === 'number' ? v : JSON.stringify(v)); + } + + return this; + } + registerMethods('Element', { + data: data + }); + // Dynamic style generator function css(style, val) { @@ -6683,7 +6707,7 @@ var SVG = (function () { for (var _iterator = style[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _name = _step.value; var cased = camelCase(_name); - ret[cased] = this.node.style(cased); + ret[cased] = this.node.style[cased]; } } catch (err) { _didIteratorError = true; @@ -6762,7 +6786,7 @@ var SVG = (function () { } return matrix[transform[0]].apply(matrix, transform[1]); - }, new Matrix$1()); + }, new Matrix()); return matrix; } // add an element to another parent without changing the visual representation on the screen @@ -6781,7 +6805,7 @@ var SVG = (function () { function transform(o, relative) { // Act as a getter if no object was passed if (o == null || typeof o === 'string') { - var decomposed = new Matrix$1(this).decompose(); + var decomposed = new Matrix(this).decompose(); return decomposed[o] || decomposed; } @@ -6794,7 +6818,7 @@ var SVG = (function () { var cleanRelative = relative === true ? this : relative || false; - var result = new Matrix$1(cleanRelative).transform(o); + var result = new Matrix(cleanRelative).transform(o); return this.attr('transform', result); } registerMethods('Element', { @@ -6986,7 +7010,7 @@ var SVG = (function () { return new Point(this.node.getPointAtLength(length)); } }); - registerMethods(['Parent', 'Runner'], { + registerMethods(['Container', 'Runner'], { // Set font font: function font(a, v) { if (_typeof(a) === 'object') { @@ -7033,7 +7057,7 @@ var SVG = (function () { function children() { return map(this.node.children, function (node) { - return adopt$1(node); + return adopt(node); }); } // Add given element at a position @@ -7063,15 +7087,15 @@ var SVG = (function () { } // Get a element at the given index function get(i) { - return adopt$1(this.node.childNodes[i]); + return adopt(this.node.childNodes[i]); } // Get first child function first() { - return adopt$1(this.node.firstChild); + return adopt(this.node.firstChild); } // Get the last child function last() { - return adopt$1(this.node.lastChild); + return adopt(this.node.lastChild); } // Iterates over all children and invokes a given block function each(block, deep) { @@ -7204,7 +7228,7 @@ var SVG = (function () { extend$1(elements$1[_i], getConstructor('Memory')); } - registerMorphableType([SVGNumber, Color, Box$1, Matrix$1, SVGArray, PointArray, PathArray]); + registerMorphableType([SVGNumber, Color, Box$1, Matrix, SVGArray, PointArray, PathArray]); makeMorphable(); // The main wrapping element function SVG(element) { @@ -7216,9 +7240,15 @@ var SVG = (function () { SVG.utils = utils; SVG.regex = regex$1; // satisfy tests, fix later SVG.get = SVG; - SVG.select = baseFind; - Object.assign(SVG, ns$2); + SVG.find = baseFind; + Object.assign(SVG, ns$1); SVG.Element = SVG.Parent = SVG.Shape = SVG.Container = Base; + SVG.easing = easing; + Object.assign(SVG, events); + SVG.TransformBag = TransformBag; + SVG.ObjectBag = ObjectBag; + SVG.NonMorphable = NonMorphable; + SVG.parser = parser; return SVG; diff --git a/dist/svg.min.js b/dist/svg.min.js index c2bd909..81337c2 100644 --- a/dist/svg.min.js +++ b/dist/svg.min.js @@ -1 +1 @@ -var SVG=function(){"use strict";function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function k(r){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{},e=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(s).filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable}))),e.forEach(function(t){var e,n,i;e=r,i=s[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return r}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var u,o=t[Symbol.iterator]();!(i=(u=o.next()).done)&&(n.push(u.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s=function(){function l(t,e){var n=e.extensions,i=void 0===n?[]:n;c(this,l);var r=!0,s=!(this.tags=[]),u=void 0;try{for(var o,a=i[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var h=o.value;h.setup.call(this,t),this.tags.push(h.name)}}catch(t){s=!0,u=t}finally{try{r||null==a.return||a.return()}finally{if(s)throw u}}}return o(l,[{key:"is",value:function(t){return this.tags.includes(t)}}]),l}(),h=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,v=/rgb\((\d+),(\d+),(\d+)\)/,y=/(#[a-z0-9\-_]+)/i,t=/\)\s*,?\s*/,p=/\s/g,m=/^#[a-f0-9]{3,6}$/i,g=/^rgb\(/,w=/^(\s+)?$/,x=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,_=/[\s,]+/,A=/([^e])-/gi,C=/[MLHVCSQTAZ]/gi,M=/[MLHVCSQTAZ]/i,j=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,T=/\./g,e=Object.freeze({numberAndUnit:h,hex:d,rgb:v,reference:y,transforms:t,whitespace:p,isHex:m,isRgb:g,isCss:/[^:]+:[^;]+;?/,isBlank:w,isNumber:x,isPercent:/^-?[\d.]+%$/,isImage:b,delimiter:_,hyphen:A,pathLetters:C,isPathLetter:M,numbersWithDots:j,dots:T});function S(t,e,n,i){return n+i.replace(T," .")}function E(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function N(t){return t.charAt(0).toUpperCase()+t.slice(1)}function P(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function D(t,e,n){if(null==e||null==n){var i=t.bbox();null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)}return{width:e,height:n}}function z(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}var R="abcdef".split("");function q(t,e,n){return Math.abs(e-t)<(n||1e-6)}function L(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}function I(t,e){var n,i,r=t.origin;if("string"==typeof r||null==r){var s=(r||"center").toLowerCase().trim(),u=e.bbox(),o=u.height,a=u.width,h=u.x,l=u.y,c=s.includes("left")?h:s.includes("right")?h+a:h+a/2,f=s.includes("top")?l:s.includes("bottom")?l+o:l+o/2;n=null!=t.ox?t.ox:c,i=null!=t.oy?t.oy:f}else n=r[0],i=r[1];return[n,i]}var F="http://www.w3.org/2000/svg",X="http://www.w3.org/2000/xmlns/",Y="http://www.w3.org/1999/xlink",G="http://svgjs.com/svgjs",H=Object.freeze({ns:F,xmlns:X,xlink:Y,svgjs:G});function B(t,e){return e||V(t)}function V(t){return document.createElementNS(F,t)}function U(t,e){var n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;0<=i;i--)for(n in e.name&&(t[i].extensions=(t[i].extensions||[]).concat(e)),e)t[i].prototype[n]||"name"==n||"setup"==n||(t[i].prototype[n]=e[n])}function Q(t,e){var n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;0<=i;i--)for(n in e)t[i].prototype[n]=e[n]}var $=Object.freeze({nodeOrNew:B,makeNode:V,extend:U,extend2:Q,addFactory:function(t,e){U(t,e)},invent:function(e){var t="function"==typeof e.create?e.create:function(t){e.inherit.call(this,t||V(e.create))};return e.inherit&&(t.prototype=new e.inherit,t.prototype.constructor=t),e.extend&&U(t,e.extend),e.construct&&U(e.parent||Container,e.construct),t}}),W={},Z=Symbol("root");function J(t){if(t instanceof s)return t;if("object"===l(t))return K(t);if(null==t)return new W[Z];if("string"==typeof t&&"<"!==t.charAt(0))return K(document.querySelector(t));var e=V("svg");return e.innerHTML=t,t=K(e.firstChild)}function K(t){return t?t.instance instanceof s?t.instance:t instanceof window.SVGElement?"svg"===t.nodeName?new W[Z](t):"linearGradient"===t.nodeName||"radialGradient"===t.nodeName?new W.Gradient(t):W[N(t.nodeName)]?new(W[N(t.nodeName)])(t):new W.Bare(t):new W.HtmlNode(t):null}function tt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t.name,n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return W[e]=t,n&&(W[Z]=t),t}function et(t){return W[t]}var nt=1e3;function it(t){return"Svgjs"+N(t)+nt++}function rt(t){for(var e=t.children.length-1;0<=e;e--)rt(t.children[e]);return t.id?K(t).id(it(t.nodeName)):K(t)}var st=Object.freeze({root:Z,makeInstance:J,adopt:K,register:tt,getClass:et,eid:it,assignNewId:rt}),ut=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,t,n))).node=t,e}return r(n,s),o(n,[{key:"add",value:function(t,e){return(t=J(t)).node!==this.node.children[e]&&this.node.insertBefore(t.node,this.node.children[e]||null),this}},{key:"put",value:function(t,e){return this.add(t,e),t}},{key:"getEventTarget",value:function(){return this.node}}]),n}();tt(ut);var ot=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("defs",t),e))}return r(e,s),o(e,[{key:"flatten",value:function(){return this}},{key:"ungroup",value:function(){return this}}]),e}();tt(ot);var at={},ht={};function lt(t,e){if(Array.isArray(t)){var n=!0,i=!1,r=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){lt(s.value,e)}}catch(t){i=!0,r=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw r}}}else if("object"!=l(t))at[t]=Object.assign(at[t]||{},e);else for(var o=Object.entries(t),a=0;a<o.length;a++){var h=f(o[a],2);lt(h[0],h[1])}}function ct(t){return at[t]||{}}function ft(t,e){ht[t]=e}function dt(t){return ht[t]?{setup:ht[t],name:t}:{}}var vt=function(){function n(){c(this,n),this.init.apply(this,arguments)}return o(n,[{key:"init",value:function(t,e){e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(h))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof n&&(this.value=t.valueOf(),this.unit=t.unit)}},{key:"toString",value:function(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"toArray",value:function(){return[this.value,this.unit]}},{key:"valueOf",value:function(){return this.value}},{key:"plus",value:function(t){return new n(this+(t=new n(t)),this.unit||t.unit)}},{key:"minus",value:function(t){return new n(this-(t=new n(t)),this.unit||t.unit)}},{key:"times",value:function(t){return new n(this*(t=new n(t)),this.unit||t.unit)}},{key:"divide",value:function(t){return new n(this/(t=new n(t)),this.unit||t.unit)}}]),n}(),yt=et(Z);function pt(){return this.parent()&&this.parent().removeElement(this),this}function mt(t){var e=this;if(!e.node.parentNode)return null;if(e=K(e.node.parentNode),!t)return e;for(;e&&e.node instanceof window.SVGElement;){if("string"==typeof t?e.matches(t):e instanceof t)return e;e=K(e.node.parentNode)}}function gt(){var t=this.parent(yt);return t&&t.doc()}lt("Element",{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var n=D(this,t,e);return this.width(new vt(n.width)).height(new vt(n.height))},clone:function(t){this.writeDataToDom();var e=rt(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:pt,replace:function(t){return this.after(t).remove(),t},addTo:function(t){return J(t).put(this)},putIn:function(t){return J(t).add(this)},id:function(t){return void 0!==t||this.node.id||(this.node.id=it(this.type)),this.attr("id",t)},inside:function(t,e){var n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},toString:function(){return this.id()},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(_)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!==e}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){var e=function(t){var e=(t||"").toString().match(y);if(e)return e[1]}(this.attr(t));return e?J(e):null},doc:gt,defs:function(){return this.doc().defs()},parent:mt,parents:function(t){var e=[],n=this;do{if(!(n=n.parent(t))||!n.node)break;e.push(n)}while(n.parent);return e},matches:function t(e){return t(this.node)},native:function(){return this.node},svg:function(){return this.writeDataToDom(),this.node.outerHTML},writeDataToDom:function(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},getEventTarget:function(){return this.node}}),ft("Element",function(t){this.dom={},this.node=t,this.type=t.nodeName,this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})});var wt=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,B("svg",t),n))).namespace(),e}return r(n,s),o(n,[{key:"isRoot",value:function(){return!(this.node.parentNode&&this.node.parentNode instanceof window.SVGElement&&"#document"!==this.node.parentNode.nodeName)}},{key:"doc",value:function(){return this.isRoot()?this:gt.call(this)}},{key:"namespace",value:function(){return this.isRoot()?this.attr({xmlns:F,version:"1.1"}).attr("xmlns:xlink",Y,X).attr("xmlns:svgjs",G,X):this.doc().namespace()}},{key:"defs",value:function(){return this.isRoot()?K(this.node.getElementsByTagName("defs")[0])||this.put(new ot):this.doc().defs()}},{key:"parent",value:function(t){return this.isRoot()?"#document"===this.node.parentNode.nodeName?null:K(this.node.parentNode):mt.call(this,t)}},{key:"remove",value:function(){return this.isRoot()?(this.parent()&&this.parent().removeChild(this.node),this):pt.call(this)}},{key:"clear",value:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}}]),n}();lt({Container:{nested:function(){return this.put(new wt)}}}),tt(wt,"Doc",!0);var xt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("g",t),e))}return r(e,s),e}();lt({Element:{group:function(){return this.put(new xt)}}}),tt(xt);var bt=function(){function t(){c(this,t),this._first=null,this._last=null}return o(t,[{key:"push",value:function(t){var e=t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}},{key:"shift",value:function(){var t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}},{key:"first",value:function(){return this._first&&this._first.value}},{key:"last",value:function(){return this._last&&this._last.value}},{key:"remove",value:function(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}}]),t}(),_t={nextDraw:null,frames:new bt,timeouts:new bt,timer:window.performance||window.Date,transforms:[],frame:function(t){var e=_t.frames.push({run:t});return null===_t.nextDraw&&(_t.nextDraw=window.requestAnimationFrame(_t._draw)),e},transform_frame:function(t,e){_t.transforms[e]=t},timeout:function(t,e){e=e||0;var n=_t.timer.now()+e,i=_t.timeouts.push({run:t,time:n});return null===_t.nextDraw&&(_t.nextDraw=window.requestAnimationFrame(_t._draw)),i},cancelFrame:function(t){_t.frames.remove(t)},clearTimeout:function(t){_t.timeouts.remove(t)},_draw:function(t){for(var e=null,n=_t.timeouts.last();(e=_t.timeouts.shift())&&(t>=e.time?e.run():_t.timeouts.push(e),e!==n););for(var i=null,r=_t.frames.last();i!==r&&(i=_t.frames.shift());)i.run();_t.transforms.forEach(function(t){t()}),_t.nextDraw=_t.timeouts.first()||_t.frames.first()?window.requestAnimationFrame(_t._draw):null}},kt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B(t,"string"==typeof t?null:t),e))}return r(e,s),o(e,[{key:"words",value:function(t){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(document.createTextNode(t)),this}}]),e}();function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function At(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ct(t){return null==t?this.attr("cx"):this.attr("cx",t)}function Mt(t){return null==t?this.attr("cy"):this.attr("cy",t)}function jt(t){return null==t?2*this.rx():this.rx(new vt(t).divide(2))}function Tt(t){return null==t?2*this.ry():this.ry(new vt(t).divide(2))}function St(t,e){var n=D(this,t,e);return this.rx(new vt(n.width).divide(2)).ry(new vt(n.height).divide(2))}tt(kt),lt("Container",{element:function(t,e){return this.put(new kt(t,e))}});var Et=Object.freeze({rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)},x:Ot,y:At,cx:Ct,cy:Mt,width:jt,height:Tt,size:St}),Nt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("circle",t),e))}return r(e,s),o(e,[{key:"radius",value:function(t){return this.attr("r",t)}},{key:"rx",value:function(t){return this.attr("r",t)}},{key:"ry",value:function(t){return this.rx(t)}}]),e}();function Pt(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function Dt(t){return t%360*Math.PI/180}U(Nt,{x:Ot,y:At,cx:Ct,cy:Mt,width:jt,height:Tt,size:St}),lt({Element:{circle:function(t){return this.put(new Nt).radius(new vt(t).divide(2)).move(0,0)}}}),tt(Nt);var zt=Object.freeze({map:Pt,filter:function(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r},radians:Dt,degrees:function(t){return 180*t/Math.PI%360},filterSVGElements:function(t){return this.filter(t,function(t){return t instanceof window.SVGElement})}});function Rt(t,e){return Pt((e||document).querySelectorAll(t),function(t){return K(t)})}lt("Container",{find:function(t){return Rt(t,this.node)}});var qt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("clipPath",t),e))}return r(e,s),o(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unclip()}),pt.call(this)}},{key:"targets",value:function(){return Rt('svg [clip-path*="'+this.id()+'"]')}}]),e}();lt({Container:{clip:function(){return this.defs().put(new qt)}},Element:{clipWith:function(t){var e=t instanceof qt?t:this.parent().clip().add(t);return this.attr("clip-path",'url("#'+e.id()+'")')},unclip:function(){return this.attr("clip-path",null)},clipper:function(){return this.reference("clip-path")}}}),tt(qt);var Lt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("a",t),e))}return r(e,s),o(e,[{key:"to",value:function(t){return this.attr("href",t,Y)}},{key:"target",value:function(t){return this.attr("target",t)}}]),e}();lt({Container:{link:function(t){return this.put(new Lt).to(t)}},Element:{linkTo:function(t){var e=new Lt;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}}),tt(Lt);var It=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("ellipse",t),e))}return r(e,s),e}();U(It,Et),lt("Container",{ellipse:function(t,e){return this.put(new It).size(t,e).move(0,0)}}),tt(It);var Ft=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("stop",t),e))}return r(e,s),o(e,[{key:"update",value:function(t){return("number"==typeof t||t instanceof vt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new vt(t.offset)),this}}]),e}();tt(Ft);var Xt=Object.freeze({from:function(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new vt(t),fy:new vt(e)}):this.attr({x1:new vt(t),y1:new vt(e)})},to:function(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new vt(t),cy:new vt(e)}):this.attr({x2:new vt(t),y2:new vt(e)})}});function Yt(){}var Gt=400,Ht=">",Bt=0,Vt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"},Ut=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t,e,n){var i,r;(this.r=0,this.g=0,this.b=0,t)&&("string"==typeof t?g.test(t)?(i=v.exec(t.replace(p,"")),this.r=parseInt(i[1]),this.g=parseInt(i[2]),this.b=parseInt(i[3])):m.test(t)&&(i=d.exec(4===(r=t).length?["#",r.substring(1,2),r.substring(1,2),r.substring(2,3),r.substring(2,3),r.substring(3,4),r.substring(3,4)].join(""):r),this.r=parseInt(i[1],16),this.g=parseInt(i[2],16),this.b=parseInt(i[3],16)):Array.isArray(t)?(this.r=t[0],this.g=t[1],this.b=t[2]):"object"===l(t)?(this.r=t.r,this.g=t.g,this.b=t.b):3===arguments.length&&(this.r=t,this.g=e,this.b=n))}},{key:"toString",value:function(){return this.toHex()}},{key:"toArray",value:function(){return[this.r,this.g,this.b]}},{key:"toHex",value:function(){return"#"+P(Math.round(this.r))+P(Math.round(this.g))+P(Math.round(this.b))}},{key:"toRgb",value:function(){return"rgb("+[this.r,this.g,this.b].join()+")"}},{key:"brightness",value:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11}}],[{key:"test",value:function(t){return t+="",m.test(t)||g.test(t)}},{key:"isRgb",value:function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}},{key:"isColor",value:function(t){return this.isRgb(t)||this.test(t)}}]),t}(),Qt=function(){try{return Function("name","baseClass","_constructor",["baseClass = baseClass || Array","return {","[name]: class extends baseClass {","constructor (...args) {","super(...args)","_constructor && _constructor.apply(this, args)","}","}","}[name]"].join("\n"))}catch(t){return function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Array,n=2<arguments.length?arguments[2]:void 0,i=function(){e.apply(this,arguments),n&&n.apply(this,arguments)};return(i.prototype=Object.create(e.prototype)).constructor=i}}}(),$t=Qt("SVGArray",Array,function(){this.init.apply(this,arguments)});function Wt(t,e,n){if(null==t){t={},e=this.node.attributes;var i=!0,r=!1,s=void 0;try{for(var u,o=e[Symbol.iterator]();!(i=(u=o.next()).done);i=!0){var a=u.value;t[a.nodeName]=isNumer.test(a.nodeValue)?parseFloat(a.nodeValue):a.nodeValue}}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return t}if(Array.isArray(t));else if("object"===l(t))for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Vt[t]:x.test(e)?parseFloat(e):e;for("fill"!==t&&"stroke"!==t||b.test(e)&&(e=this.doc().defs().image(e));"function"==typeof e.attrHook;)e=e.attrHook(this,t);"number"==typeof e?e=new vt(e):Ut.isColor(e)?e=new Ut(e):e.constructor===Array&&(e=new $t(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this}Q($t,{init:function(){this.length=0,this.push.apply(this,O(this.parse.apply(this,arguments)))},toArray:function(){var t=[];return t.push.apply(t,O(this)),t},toString:function(){return this.join(" ")},valueOf:function(){return this.toArray()},parse:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return t instanceof Array?t:t.trim().split(_).map(parseFloat)},clone:function(){return new this.constructor(this)},toSet:function(){return new Set(this)}}),lt("Element",{attr:Wt});var Zt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B(t+"Gradient","string"==typeof t?null:t),e))}return r(e,s),o(e,[{key:"stop",value:function(t,e,n){return this.put(new Ft).update(t,e,n)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="gradientTransform"),Wt.call(this,t,e,n)}},{key:"targets",value:function(){return find('svg [fill*="'+this.id()+'"]')}}]),e}();U(Zt,Xt),lt({Container:{gradient:function(t,e){return this.defs().gradient(t,e)}},Defs:{gradient:function(t,e){return this.put(new Zt(t)).update(e)}}}),tt(Zt);var Jt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("pattern",t),e))}return r(e,s),o(e,[{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="patternTransform"),Wt.call(this,t,e,n)}},{key:"targets",value:function(){return find('svg [fill*="'+this.id()+'"]')}}]),e}();lt({Container:{pattern:function(t,e,n){return this.defs().pattern(t,e,n)}},Defs:{pattern:function(t,e,n){return this.put(new Jt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}}),tt(Jt);var Kt=0;function te(t){return t instanceof s&&t.is("EventTarget")?t.getEventTarget():t}function ee(t,e,i,n,r){var s=i.bind(n||t),u=te(t);e=Array.isArray(e)?e:e.split(_),u.instance=u.instance||{events:{}};var o=u.instance.events;i._svgjsListenerId||(i._svgjsListenerId=++Kt),e.forEach(function(t){var e=t.split(".")[0],n=t.split(".")[1]||"*";o[e]=o[e]||{},o[e][n]=o[e][n]||{},o[e][n][i._svgjsListenerId]=s,u.addEventListener(e,s,r||!1)})}function ne(t,e,s,u){var o=te(t);if(o.instance&&("function"!=typeof s||(s=s._svgjsListenerId))){var a=o.instance.events;(e=Array.isArray(e)?e:(e||"").split(_)).forEach(function(t){var e,n,i=t&&t.split(".")[0],r=t&&t.split(".")[1];if(s)a[i]&&a[i][r||"*"]&&(o.removeEventListener(i,a[i][r||"*"][s],u||!1),delete a[i][r||"*"][s]);else if(i&&r){if(a[i]&&a[i][r]){for(n in a[i][r])ne(o,[i,r].join("."),n);delete a[i][r]}}else if(r)for(t in a)for(e in a[t])r===e&&ne(o,[t,r].join("."));else if(i){if(a[i]){for(e in a[i])ne(o,[i,e].join("."));delete a[i]}}else{for(t in a)ne(o,t);o.instance.events={}}})}}var ie=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("image",t),e))}return r(e,s),o(e,[{key:"load",value:function(n,i){if(!n)return this;var r=new window.Image;return ee(r,"load",function(t){var e=this.parent(Jt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),e instanceof Jt&&0===e.width()&&0===e.height()&&e.size(this.width(),this.height()),"function"==typeof i&&i.call(this,{width:r.width,height:r.height,ratio:r.width/r.height,url:n})},this),ee(r,"load error",function(){ne(r)}),this.attr("href",r.src=n,Y)}},{key:"attrHook",value:function(t){var e=this;return t.doc().defs().pattern(0,0,function(t){t.add(e)})}}]),e}();lt({Container:{image:function(t,e){return this.put(new ie).size(0,0).load(t,e)}}}),tt(ie);var re=Qt("PointArray",$t);Q(re,{toString:function(){for(var t=0,e=this.length,n=[];t<e;t++)n.push(this[t].join(","));return n.join(" ")},toLine:function(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}},at:function(t){if(!this.destination)return this;for(var e=0,n=this.length,i=[];e<n;e++)i.push([this[e][0]+(this.destination[e][0]-this[e][0])*t,this[e][1]+(this.destination[e][1]-this[e][1])*t]);return new re(i)},parse:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[[0,0]],e=[];if(t instanceof Array){if(t[0]instanceof Array)return t}else t=t.trim().split(_).map(parseFloat);t.length%2!=0&&t.pop();for(var n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i=this.length-1;0<=i;i--)this[i]=[this[i][0]+t,this[i][1]+e];return this},size:function(t,e){var n,i=this.bbox();for(n=this.length-1;0<=n;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this},bbox:function(){var e=-1/0,n=-1/0,i=1/0,r=1/0;return this.forEach(function(t){e=Math.max(t[0],e),n=Math.max(t[1],n),i=Math.min(t[0],i),r=Math.min(t[1],r)}),{x:i,y:r,width:e-i,height:n-r}}});var se=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("line",t),e))}return r(e,s),o(e,[{key:"array",value:function(){return new re([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}},{key:"plot",value:function(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new re(t).toLine(),this.attr(t))}},{key:"move",value:function(t,e){return this.attr(this.array().move(t,e).toLine())}},{key:"size",value:function(t,e){var n=D(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}]),e}();lt({Container:{line:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return se.prototype.plot.apply(this.put(new se),null!=e[0]?e:[0,0,0,0])}}}),tt(se);var ue=function(t){function e(t){return c(this,e),a(this,u(e).call(this,nodeOrNew("marker",t),e))}return r(e,s),o(e,[{key:"width",value:function(t){return this.attr("markerWidth",t)}},{key:"height",value:function(t){return this.attr("markerHeight",t)}},{key:"ref",value:function(t,e){return this.attr("refX",t).attr("refY",e)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return"url(#"+this.id()+")"}}]),e}();lt({Container:{marker:function(t,e,n){return this.defs().marker(t,e,n)}},Defs:{marker:function(t,e,n){return this.put(new ue).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}},marker:{marker:function(t,e,n,i){var r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=e instanceof ue?e:this.defs().marker(e,n,i),this.attr(r,t)}}}),tt(ue);var oe=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("mask",t),e))}return r(e,s),o(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unmask()}),pt.call(this)}},{key:"targets",value:function(){return Rt('svg [mask*="'+this.id()+'"]')}}]),e}();function ae(){if(!ae.nodes){var t=(new wt).size(2,0).css({opacity:0,position:"absolute",left:"-100%",top:"-100%",overflow:"hidden"}),e=t.path().node;ae.nodes={svg:t,path:e}}if(!ae.nodes.svg.node.parentNode){var n=document.body||document.documentElement;ae.nodes.svg.addTo(n)}return ae.nodes}lt({Container:{mask:function(){return this.defs().put(new oe)}},Element:{maskWith:function(t){var e=t instanceof oe?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask:function(){return this.attr("mask",null)},masker:function(){return this.reference("mask")}}}),tt(oe);var he=function(){function r(t,e,n){var i;c(this,r),n=n||{x:0,y:0},i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"===l(t)?{x:t.x,y:t.y}:{x:t,y:e},this.x=null==i.x?n.x:i.x,this.y=null==i.y?n.y:i.y}return o(r,[{key:"clone",value:function(){return new r(this)}},{key:"native",value:function(){var t=ae().svg.createSVGPoint();return t.x=this.x,t.y=this.y,t}},{key:"transform",value:function(t){return new r(t.a*this.x+t.c*this.y+t.e,t.b*this.x+t.d*this.y+t.f)}}]),r}();lt({Element:{point:function(t,e){return new he(t,e).transform(this.screenCTM().inverse())}}});for(var le=Qt("PathArray",$t),ce={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},fe="mlhvqtcsaz".split(""),de=0,ve=fe.length;de<ve;++de)ce[fe[de]]=function(s){return function(t,e,n){if("H"===s)t[0]=t[0]+e.x;else if("V"===s)t[0]=t[0]+e.y;else if("A"===s)t[5]=t[5]+e.x,t[6]=t[6]+e.y;else for(var i=0,r=t.length;i<r;++i)t[i]=t[i]+(i%2?e.y:e.x);return ce[s](t,e,n)}}(fe[de].toUpperCase());Q(le,{toString:function(){return function(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e][0],null!=t[e][1]&&(i+=t[e][1],null!=t[e][2]&&(i+=" ",i+=t[e][2],null!=t[e][3]&&(i+=" ",i+=t[e][3],i+=" ",i+=t[e][4],null!=t[e][5]&&(i+=" ",i+=t[e][5],i+=" ",i+=t[e][6],null!=t[e][7]&&(i+=" ",i+=t[e][7])))));return i+" "}(this)},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i,r=this.length-1;0<=r;r--)"M"===(i=this[r][0])||"L"===i||"T"===i?(this[r][1]+=t,this[r][2]+=e):"H"===i?this[r][1]+=t:"V"===i?this[r][1]+=e:"C"===i||"S"===i||"Q"===i?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===i&&(this[r][5]+=t,this[r][6]+=e)):"A"===i&&(this[r][6]+=t,this[r][7]+=e);return this},size:function(t,e){var n,i,r=this.bbox();for(n=this.length-1;0<=n;n--)"M"===(i=this[n][0])||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this},equalCommands:function(t){var e,n,i;for(t=new le(t),i=this.length===t.length,e=0,n=this.length;i&&e<n;e++)i=this[e][0]===t[e][0];return i},morph:function(t){return t=new le(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at:function(t){if(!this.destination)return this;var e,n,i,r,s=this,u=this.destination.value,o=[],a=new le;for(e=0,n=s.length;e<n;e++){for(o[e]=[s[e][0]],i=1,r=s[e].length;i<r;i++)o[e][i]=s[e][i]+(u[e][i]-s[e][i])*t;"A"===o[e][0]&&(o[e][4]=+(0!==o[e][4]),o[e][5]=+(0!==o[e][5]))}return a.value=o,a},parse:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[["M",0,0]];if(e instanceof le)return e;var n={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};e="string"==typeof e?e.replace(j,S).replace(C," $& ").replace(A,"$1 -").trim().split(_):e.reduce(function(t,e){return[].concat.call(t,e)},[]);for(var i=[],r=new he,s=new he,u=0,o=e.length;M.test(e[u])?(t=e[u],++u):"M"===t?t="L":"m"===t&&(t="l"),i.push(ce[t].call(null,e.slice(u,u+=n[t.toUpperCase()]).map(parseFloat),r,s)),u<o;);return i},bbox:function(){return ae().path.setAttribute("d",this.toString()),ae.nodes.path.getBBox()}});var ye=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("path",t),e))}return r(e,s),o(e,[{key:"array",value:function(){return this._array||(this._array=new le(this.attr("d")))}},{key:"plot",value:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new le(t))}},{key:"clear",value:function(){return delete this._array,this}},{key:"move",value:function(t,e){return this.attr("d",this.array().move(t,e))}},{key:"x",value:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}},{key:"y",value:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},{key:"size",value:function(t,e){var n=D(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}},{key:"width",value:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}},{key:"height",value:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},{key:"targets",value:function(){return Rt('svg textpath [href*="'+this.id()+'"]')}}]),e}();ye.prototype.MorphArray=le,lt({Container:{path:function(t){return this.put(new ye).plot(t||new le)}}}),tt(ye);var pe=re;var me=Object.freeze({MorphArray:pe,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}});var ge=Object.freeze({array:function(){return this._array||(this._array=new re(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new re(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var n=proportionalSize(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}}),we=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("polygon",t),e))}return r(e,s),e}();lt({Container:{polygon:function(t){return this.put(new we).plot(t||new re)}}}),U(we,me),U(we,ge),tt(we);var xe=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("polyline",t),e))}return r(e,s),e}();lt({Container:{polyline:function(t){return this.put(new xe).plot(t||new re)}}}),U(xe,me),U(xe,ge),tt(xe);var be=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("rect",t),e))}return r(e,s),e}();lt({Container:{rect:function(t,e){return this.put(new be).size(t,e)}}}),tt(be);var _e=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("symbol",t),e))}return r(e,s),e}();lt({Container:{symbol:function(){return this.put(new _e)}}}),tt(_e);var ke=Object.freeze({plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()}}),Oe=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,B("text",t),n))).dom.leading=new vt(1.3),e._rebuild=!0,e._build=!1,e.attr("font-family",Vt["font-family"]),e}return r(n,s),o(n,[{key:"x",value:function(t){return null==t?this.attr("x"):this.attr("x",t)}},{key:"y",value:function(t){var e=this.attr("y"),n="number"==typeof e?e-this.bbox().y:0;return null==t?"number"==typeof e?e-n:e:this.attr("y","number"==typeof t?t+n:t)}},{key:"cx",value:function(t){return null==t?this.bbox().cx:this.x(t-this.bbox().width/2)}},{key:"cy",value:function(t){return null==t?this.bbox().cy:this.y(t-this.bbox().height/2)}},{key:"text",value:function(t){if(void 0===t){var e=this.node.childNodes,n=0;t="";for(var i=0,r=e.length;i<r;++i)"textPath"!==e[i].nodeName?(i!==n&&3!==e[i].nodeType&&!0===adopt(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(var s=0,u=(t=t.split("\n")).length;s<u;s++)this.tspan(t[s]).newLine();return this.build(!1).rebuild()}},{key:"leading",value:function(t){return null==t?this.dom.leading:(this.dom.leading=new vt(t),this.rebuild())}},{key:"rebuild",value:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,n=0,i=this.dom.leading*new vt(this.attr("font-size"));this.each(function(){this.dom.newLined&&(this.attr("x",e.attr("x")),"\n"===this.text()?n+=i:(this.attr("dy",i+n),n=0))}),this.fire("rebuild")}return this}},{key:"build",value:function(t){return this._build=!!t,this}},{key:"setData",value:function(t){return this.dom=t,this.dom.leading=new vt(t.leading||1.3),this}}]),n}();U(Oe,ke),lt({Container:{text:function(t){return this.put(new Oe).text(t)},plain:function(t){return this.put(new Oe).plain(t)}}}),tt(Oe);var Ae=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("textPath",t),e))}return r(e,Oe),o(e,[{key:"array",value:function(){var t=this.track();return t?t.array():null}},{key:"plot",value:function(t){var e=this.track(),n=null;return e&&(n=e.plot(t)),null==t?n:this}},{key:"track",value:function(){return this.reference("href")}}]),e}();lt({Container:{textPath:function(t,e){return this.defs().path(e).text(t).addTo(this)}},Text:{path:function(t){var e=new Ae;return t instanceof ye||(t=this.doc().defs().path(t)),e.attr("href","#"+t,Y),this.put(e)},textPath:function(){return this.select("textPath")}},Path:{text:function(t){if(t instanceof Oe){var e=t.text();return t.clear().path(this).text(e)}return this.parent().put(new Oe).path(this).text(t)}}}),Ae.prototype.MorphArray=le,tt(Ae);var Ce=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("tspan",t),e))}return r(e,s),o(e,[{key:"text",value:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)}},{key:"dx",value:function(t){return this.attr("dx",t)}},{key:"dy",value:function(t){return this.attr("dy",t)}},{key:"newLine",value:function(){var t=this.parent(Oe);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}]),e}();U(Ce,ke),lt({Tspan:{tspan:function(t){var e=new Ce;return this._build||this.clear(),this.node.appendChild(e.node),e.text(t)}}}),tt(Ce);var Me=function(t){function e(t){return c(this,e),a(this,u(e).call(this,B("use",t),e))}return r(e,s),o(e,[{key:"element",value:function(t,e){return this.attr("href",(e||"")+"#"+t,Y)}}]),e}();lt({Container:{use:function(t,e){return this.put(new Me).element(t,e)}}}),tt(Me);var je=function(){function h(){c(this,h),this.init.apply(this,arguments)}return o(h,[{key:"init",value:function(t){var e=z([1,0,0,1,0,0]);t=t instanceof s&&t.is("Element")?t.matrixify():"string"==typeof t?z(t.split(_).map(parseFloat)):Array.isArray(t)?z(t):"object"===l(t)&&L(t)?t:"object"===l(t)?(new h).transform(t):6===arguments.length?z([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f}},{key:"clone",value:function(){return new h(this)}},{key:"transform",value:function(t){if(L(t))return new h(t).multiplyO(this);var e=h.formatTransforms(t),n=new he(e.ox,e.oy).transform(this),i=n.x,r=n.y,s=(new h).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-i,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(i,r);if(isFinite(e.px)||isFinite(e.py)){var u=new he(i,r).transform(s),o=e.px?e.px-u.x:0,a=e.py?e.py-u.y:0;s.translateO(o,a)}return s.translateO(e.tx,e.ty),s}},{key:"compose",value:function(t){t.origin&&(t.originX=t.origin[0],t.originY=t.origin[1]);var e=t.originX||0,n=t.originY||0,i=t.scaleX||1,r=t.scaleY||1,s=t.shear||0,u=t.rotate||0,o=t.translateX||0,a=t.translateY||0;return(new h).translateO(-e,-n).scaleO(i,r).shearO(s).rotateO(u).translateO(o,a).lmultiplyO(this).translateO(e,n)}},{key:"decompose",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=this.a,i=this.b,r=this.c,s=this.d,u=this.e,o=this.f,a=n*s-i*r,h=0<a?1:-1,l=h*Math.sqrt(n*n+i*i),c=Math.atan2(h*i,h*n),f=180/Math.PI*c,d=Math.cos(c),v=Math.sin(c),y=(n*r+i*s)/a,p=r*l/(y*n-i)||s*l/(y*i+n);return{scaleX:l,scaleY:p,shear:y,rotate:f,translateX:u-t+t*d*l+e*(y*d*l-v*p),translateY:o-e+t*v*l+e*(y*v*l+d*p),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}},{key:"multiply",value:function(t){return this.clone().multiplyO(t)}},{key:"multiplyO",value:function(t){var e=t instanceof h?t:new h(t);return h.matrixMultiply(this,e,this)}},{key:"lmultiply",value:function(t){return this.clone().lmultiplyO(t)}},{key:"lmultiplyO",value:function(t){var e=t instanceof h?t:new h(t);return h.matrixMultiply(e,this,this)}},{key:"inverseO",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,u=t*i-e*n;if(!u)throw new Error("Cannot invert "+this);var o=i/u,a=-e/u,h=-n/u,l=t/u,c=-(o*r+h*s),f=-(a*r+l*s);return this.a=o,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}},{key:"inverse",value:function(){return this.clone().inverseO()}},{key:"translate",value:function(t,e){return this.clone().translateO(t,e)}},{key:"translateO",value:function(t,e){return this.e+=t||0,this.f+=e||0,this}},{key:"scale",value:function(t,e,n,i){var r;return(r=this.clone()).scaleO.apply(r,arguments)}},{key:"scaleO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(i=n,n=e,e=t);var r=this.a,s=this.b,u=this.c,o=this.d,a=this.e,h=this.f;return this.a=r*t,this.b=s*e,this.c=u*t,this.d=o*e,this.e=a*t-n*t+n,this.f=h*e-i*e+i,this}},{key:"rotate",value:function(t,e,n){return this.clone().rotateO(t,e,n)}},{key:"rotateO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;t=Dt(t);var i=Math.cos(t),r=Math.sin(t),s=this.a,u=this.b,o=this.c,a=this.d,h=this.e,l=this.f;return this.a=s*i-u*r,this.b=u*i+s*r,this.c=o*i-a*r,this.d=a*i+o*r,this.e=h*i-l*r+n*r-e*i+e,this.f=l*i+h*r-e*r-n*i+n,this}},{key:"flip",value:function(t,e){return this.clone().flipO(t,e)}},{key:"flipO",value:function(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}},{key:"shear",value:function(t,e,n){return this.clone().shearO(t,e,n)}},{key:"shearO",value:function(t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=this.a,i=this.b,r=this.c,s=this.d,u=this.e,o=this.f;return this.a=n+i*t,this.c=r+s*t,this.e=u+o*t-e*t,this}},{key:"skew",value:function(t,e,n,i){var r;return(r=this.clone()).skewO.apply(r,arguments)}},{key:"skewO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(i=n,n=e,e=t),t=Dt(t),e=Dt(e);var r=Math.tan(t),s=Math.tan(e),u=this.a,o=this.b,a=this.c,h=this.d,l=this.e,c=this.f;return this.a=u+o*r,this.b=o+u*s,this.c=a+h*r,this.d=h+a*s,this.e=l+c*r-i*r,this.f=c+l*s-n*s,this}},{key:"skewX",value:function(t,e,n){return this.skew(t,0,e,n)}},{key:"skewXO",value:function(t,e,n){return this.skewO(t,0,e,n)}},{key:"skewY",value:function(t,e,n){return this.skew(0,t,e,n)}},{key:"skewYO",value:function(t,e,n){return this.skewO(0,t,e,n)}},{key:"aroundO",value:function(t,e,n){var i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}},{key:"around",value:function(t,e,n){return this.clone().aroundO(t,e,n)}},{key:"native",value:function(){for(var t=ae().node.createSVGMatrix(),e=R.length-1;0<=e;e--)t[R[e]]=this[R[e]];return t}},{key:"equals",value:function(t){var e=new h(t);return q(this.a,e.a)&&q(this.b,e.b)&&q(this.c,e.c)&&q(this.d,e.d)&&q(this.e,e.e)&&q(this.f,e.f)}},{key:"toString",value:function(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}},{key:"toArray",value:function(){return[this.a,this.b,this.c,this.d,this.e,this.f]}},{key:"valueOf",value:function(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}],[{key:"formatTransforms",value:function(t){var e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,u=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,o=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,a=t.shear||0,h=t.rotate||t.theta||0,l=new he(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new he(t.position||t.px||t.positionX,t.py||t.positionY),v=d.x,y=d.y,p=new he(t.translate||t.tx||t.translateX,t.ty||t.translateY),m=p.x,g=p.y,w=new he(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:u,scaleY:o,skewX:r,skewY:s,shear:a,theta:h,rx:w.x,ry:w.y,tx:m,ty:g,ox:c,oy:f,px:v,py:y}}},{key:"matrixMultiply",value:function(t,e,n){var i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,u=t.b*e.c+t.d*e.d,o=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=s,n.d=u,n.e=o,n.f=a,n}}]),h}();lt({Element:{ctm:function(){return new je(this.node.getCTM())},screenCTM:function(){if("function"!=typeof this.isRoot||this.isRoot())return new je(this.node.getScreenCTM());var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new je(e)}}});var Te=function(){function u(){c(this,u),this.init.apply(this,arguments)}return o(u,[{key:"init",value:function(t){var e;t="string"==typeof t?t.split(_).map(parseFloat):Array.isArray(t)?t:"object"===l(t)?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3],null==(e=this).x&&(e.x=0,e.y=0,e.width=0,e.height=0),e.w=e.width,e.h=e.height,e.x2=e.x+e.width,e.y2=e.y+e.height,e.cx=e.x+e.width/2,e.cy=e.y+e.height/2}},{key:"merge",value:function(t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y);return new u(e,n,Math.max(this.x+this.width,t.x+t.width)-e,Math.max(this.y+this.height,t.y+t.height)-n)}},{key:"transform",value:function(e){var n=1/0,i=-1/0,r=1/0,s=-1/0;return[new he(this.x,this.y),new he(this.x2,this.y),new he(this.x,this.y2),new he(this.x2,this.y2)].forEach(function(t){t=t.transform(e),n=Math.min(n,t.x),i=Math.max(i,t.x),r=Math.min(r,t.y),s=Math.max(s,t.y)}),new u(n,r,i-n,s-r)}},{key:"addOffset",value:function(){return this.x+=window.pageXOffset,this.y+=window.pageYOffset,this}},{key:"toString",value:function(){return this.x+" "+this.y+" "+this.width+" "+this.height}},{key:"toArray",value:function(){return[this.x,this.y,this.width,this.height]}}]),u}();function Se(e){var n,t,i;try{if(n=e(this.node),!((i=n).w||i.h||i.x||i.y||(t=this.node,(document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===document}).call(document.documentElement,t))))throw new Error("Element not in the dom")}catch(t){try{var r=this.clone(ae().svg).show();n=e(r.node),r.remove()}catch(t){throw t}}return n}function Ee(e,n){return function(t){return null==t?this[t]:(this[e]=t,n&&n.call(this),this)}}lt({Element:{bbox:function(){return new Te(Se.call(this,function(t){return t.getBBox()}))},rbox:function(t){var e=new Te(Se.call(this,function(t){return t.getBoundingClientRect()}));return t?e.transform(t.screenCTM().inverse()):e.addOffset()}},viewbox:{viewbox:function(t,e,n,i){return null==t?new Te(this.attr("viewBox")):this.attr("viewBox",new Te(t,e,n,i))}}});var Ne={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(t){}}},Pe=function(){function t(){c(this,t)}return o(t,[{key:"done",value:function(){return!1}}]),t}(),De=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this))).ease=Ne[t||Ht]||t,e}return r(n,Pe),o(n,[{key:"step",value:function(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}]),n}(),ze=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this))).stepper=t,e}return r(n,Pe),o(n,[{key:"step",value:function(t,e,n,i){return this.stepper(t,e,n,i)}},{key:"done",value:function(t){return t.done}}]),n}();function Re(){var t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}var qe=function(t){function i(t,e){var n;return c(this,i),(n=a(this,u(i).call(this))).duration(t||500).overshoot(e||0),n}return r(i,ze),o(i,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;100<n&&(n=16),n/=1e3;var r=i.velocity||0,s=-this.d*r-this.k*(t-e),u=t+r*n+s*n*n/2;return i.velocity=r+s*n,i.done=Math.abs(e-u)+Math.abs(r)<.002,i.done?e:u}}]),i}();U(qe,{duration:Ee("_duration",Re),overshoot:Ee("_overshoot",Re)});var Le=function(t){function s(t,e,n,i){var r;return c(this,s),t=null==t?.1:t,e=null==e?.01:e,n=null==n?0:n,i=null==i?1e3:i,(r=a(this,u(s).call(this))).p(t).i(e).d(n).windup(i),r}return r(s,ze),o(s,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;var r=e-t,s=(i.integral||0)+r*n,u=(r-(i.error||0))/n,o=this.windup;return!1!==o&&(s=Math.max(-o,Math.min(s,o))),i.error=r,i.integral=s,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*s+this.D*u)}}]),s}();U(Le,{windup:Ee("windup"),p:Ee("P"),i:Ee("I"),d:Ee("D")});var Ie=function(){function e(t){c(this,e),this._stepper=t||new De("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}return o(e,[{key:"from",value:function(t){return null==t?this._from:(this._from=this._set(t),this)}},{key:"to",value:function(t){return null==t?this._to:(this._to=this._set(t),this)}},{key:"type",value:function(t){return null==t?this._type:(this._type=t,this)}},{key:"_set",value:function(t){if(!this._type){var e=l(t);"number"===e?this.type(vt):"string"===e?Ut.isColor(t)?this.type(Ut):regex.delimiter.test(t)?this.type(regex.pathLetters.test(t)?le:$t):regex.numberAndUnit.test(t)?this.type(vt):this.type(Fe):-1<Ge.indexOf(t.constructor)?this.type(t.constructor):Array.isArray(t)?this.type($t):"object"===e?this.type(Ye):this.type(Fe)}var n=new this._type(t).toArray();return this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(n.length)).map(Object),n}},{key:"stepper",value:function(t){return null==t?this._stepper:(this._stepper=t,this)}},{key:"done",value:function(){return this._context.map(this._stepper.done).reduce(function(t,e){return t&&e},!0)}},{key:"at",value:function(n){var i=this;return this._morphObj.fromArray(this._from.map(function(t,e){return i._stepper.step(t,i._to[e],n,i._context[e],i._context)}))}}]),e}(),Fe=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t){t=Array.isArray(t)?t[0]:t,this.value=t}},{key:"valueOf",value:function(){return this.value}},{key:"toArray",value:function(){return[this.value]}}]),t}(),Xe=function(){function e(){c(this,e),this.init.apply(this,arguments)}return o(e,[{key:"init",value:function(t){Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,e.defaults,t)}},{key:"toArray",value:function(){var t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}]),e}();Xe.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};var Ye=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t){if(this.values=[],Array.isArray(t))this.values=t;else{var e=Object.entries(t||{}).sort(function(t,e){return t[0]-e[0]});this.values=e.reduce(function(t,e){return t.concat(e)},[])}}},{key:"valueOf",value:function(){for(var t={},e=this.values,n=0,i=e.length;n<i;n+=2)t[e[n]]=e[n+1];return t}},{key:"toArray",value:function(){return this.values}}]),t}(),Ge=[Fe,Xe,Ye];var He=window.performance||Date,Be=function(t){var e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ve=function(){function t(){c(this,t),this._timeSource=function(){return He.now()},this._dispatcher=document.createElement("div"),this._startTime=0,this._speed=1,this._reverse=!1,this._persist=0,this._nextFrame=null,this._paused=!1,this._runners=[],this._order=[],this._time=0,this._lastSourceTime=0,this._lastStepTime=0}return o(t,[{key:"getEventTarget",value:function(){return this._dispatcher}},{key:"schedule",value:function(t,e,n){if(null==t)return this._runners.map(Be).sort(function(t,e){return t.start-e.start||t.duration-e.duration});this.active()||(this._step(),null==n&&(n="now"));var i=0;if(e=e||0,null==n||"last"===n||"after"===n)i=this._startTime;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else{if("relative"!==n)throw new Error('Invalid value for the "when" parameter');var r=this._runners[t.id];r&&(i=r.start+e,e=0)}return t.unschedule(),t.timeline(this),t.time(-e),this._startTime=i+t.duration()+e,this._runners[t.id]={persist:this.persist(),runner:t,start:i},this._order.push(t.id),this._continue(),this}},{key:"unschedule",value:function(t){var e=this._order.indexOf(t.id);return e<0||(delete this._runners[t.id],this._order.splice(e,1),t.timeline(null)),this}},{key:"play",value:function(){return this._paused=!1,this._continue()}},{key:"pause",value:function(){return this._nextFrame=null,this._paused=!0,this}},{key:"stop",value:function(){return this.seek(-this._time),this.pause()}},{key:"finish",value:function(){return this.seek(1/0),this.pause()}},{key:"speed",value:function(t){return null==t?this._speed:(this._speed=t,this)}},{key:"reverse",value:function(t){var e=this.speed();if(null==t)return this.speed(-e);var n=Math.abs(e);return this.speed(t?n:-n)}},{key:"seek",value:function(t){return this._time+=t,this._continue()}},{key:"time",value:function(t){return null==t?this._time:(this._time=t,this)}},{key:"persist",value:function(t){return null==t?this._persist:(this._persist=t,this)}},{key:"source",value:function(t){return null==t?this._timeSource:(this._timeSource=t,this)}},{key:"_step",value:function(){if(!this._paused){var t=this._timeSource(),e=t-this._lastSourceTime,n=this._speed*e+(this._time-this._lastStepTime);this._lastSourceTime=t,this._time+=n,this._lastStepTime=this._time;for(var i=!1,r=0,s=this._order.length;r<s;r++){var u=this._runners[this._order[r]],o=u.runner,a=n,h=this._time-u.start;if(h<0)i=!0;else if(h<a&&(a=h),o.active())if(o.step(a).done){if(!0!==u.persist){o.duration()-o.time()+this._time+this._persist<this._time&&(delete this._runners[this._order[r]],this._order.splice(r--,1)&&--s,o.timeline(null))}}else i=!0}return this._nextFrame=i?_t.frame(this._step.bind(this)):null,this}}},{key:"_continue",value:function(){return this._paused||this._nextFrame||(this._nextFrame=_t.frame(this._step.bind(this))),this}},{key:"active",value:function(){return!!this._nextFrame}}]),t}();lt({Element:{timeline:function(){return this._timeline=this._timeline||new Ve,this._timeline}}});var Ue=function(){function s(t){c(this,s),this.id=s.id++,t="function"==typeof(t=null==t?Gt:t)?new ze(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ze,this._stepper=this._isDeclarative?t:new De,this._history={},this.enabled=!0,this._time=0,this._last=0,this.transforms=new je,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1}return o(s,[{key:"element",value:function(t){return null==t?this._element:((this._element=t)._prepareRunner(),this)}},{key:"timeline",value:function(t){return void 0===t?this._timeline:(this._timeline=t,this)}},{key:"animate",value:function(t,e,n){var i=s.sanitise(t,e,n),r=new s(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(e,n)}},{key:"schedule",value:function(t,e,n){if(t instanceof Ve||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}},{key:"unschedule",value:function(){var t=this.timeline();return t&&t.unschedule(this),this}},{key:"loop",value:function(t,e,n){return"object"===l(t)&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,this}},{key:"delay",value:function(t){return this.animate(0,t)}},{key:"queue",value:function(t,e,n){return this._queue.push({initialiser:t||Yt,runner:e||Yt,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}},{key:"during",value:function(t){return this.queue(null,t)}},{key:"after",value:function(t){return this.on("finish",t)}},{key:"time",value:function(t){if(null==t)return this._time;var e=t-this._time;return this.step(e),this}},{key:"duration",value:function(){return this._times*(this._wait+this._duration)-this._wait}},{key:"loops",value:function(t){var e=this._duration+this._wait;if(null==t){var n=Math.floor(this._time/e),i=(this._time-n*e)/this._duration;return Math.min(n+i,this._times)}var r=t%1,s=e*Math.floor(t)+this._duration*r;return this.time(s)}},{key:"position",value:function(t){var e,n=this._time,r=this._duration,s=this._wait,i=this._times,u=this._swing,o=this._reverse;if(null==t){var a=function(t){var e=u*Math.floor(t%(2*(s+r))/(s+r)),n=e&&!o||!e&&o,i=Math.pow(-1,n)*(t%(s+r))/r+n;return Math.max(Math.min(i,1),0)},h=i*(s+r)-s;return e=n<=0?Math.round(a(1e-5)):n<h?a(n):Math.round(a(h-1e-5)),e}var l=Math.floor(this.loops()),c=u&&l%2==0;return e=l+(c&&!o||o&&c?t:1-t),this.loops(e)}},{key:"progress",value:function(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}},{key:"step",value:function(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;var e=this.position(),n=this._lastPosition!==e&&0<=this._time;this._lastPosition=e;var i=this.duration(),r=(this._lastTime<0&&this._time,this._lastTime<this._time&&this.time>i);this._lastTime=this._time;var s=this._isDeclarative;if(this.done=!s&&!r&&this._time>=i,n||s){this._initialise(n),this.transforms=new je;var u=this._run(s?t:e)}return this.done=this.done||u&&s,this}},{key:"finish",value:function(){return this.step(1/0)}},{key:"reverse",value:function(t){return this._reverse=null==t?!this._reverse:t,this}},{key:"ease",value:function(t){return this._stepper=new De(t),this}},{key:"active",value:function(t){return null==t?this.enabled:(this.enabled=t,this)}},{key:"_rememberMorpher",value:function(t,e){this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]}}},{key:"_tryRetarget",value:function(t,e){if(this._history[t]){if(!this._history[t].caller.initialised){var n=this._queue.indexOf(this._history[t].caller);return this._queue.splice(n,1),!1}this._history[t].caller.isTransform?this._history[t].caller.isTransform(e):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var i=this.timeline();return i&&i._continue(),!0}return!1}},{key:"_initialise",value:function(t){if(t||this._isDeclarative)for(var e=0,n=this._queue.length;e<n;++e){var i=this._queue[e],r=this._isDeclarative||!i.initialised&&t;t=!i.finished,r&&t&&(i.initialiser.call(this),i.initialised=!0)}}},{key:"_run",value:function(t){for(var e=!0,n=0,i=this._queue.length;n<i;++n){var r=this._queue[n],s=r.runner.call(this,t);r.finished=r.finished||!0===s,e=e&&r.finished}return e}},{key:"addTransform",value:function(t,e){return this.transforms.lmultiplyO(t),this}},{key:"clearTransform",value:function(){return this.transforms=new je,this}}],[{key:"sanitise",value:function(t,e,n){var i=1,r=!1,s=0;return e=e||Bt,n=n||"last","object"!==l(t=t||Gt)||t instanceof Pe||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,s=t.wait||s,t=t.duration||Gt),{duration:t,delay:e,swing:r,times:i,wait:s,when:n}}}]),s}();Ue.id=0;var Qe=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new je,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];c(this,t),this.transforms=e,this.id=n,this.done=i};U([Ue,Qe],{mergeWith:function(t){return new Qe(t.transforms.lmultiply(this.transforms),t.id)}});var $e=function(t,e){return t.lmultiplyO(e)},We=function(t){return t.transforms};var Ze=function(){function t(){c(this,t),this.runners=[],this.ids=[]}return o(t,[{key:"add",value:function(t){if(!this.runners.includes(t)){var n=t.id+1,e=this.ids.reduce(function(t,e){return t<e&&e<n?e:t},0),i=this.ids.indexOf(e)+1;return this.ids.splice(i,0,n),this.runners.splice(i,0,t),this}}},{key:"getByID",value:function(t){return this.runners[this.ids.indexOf(t+1)]}},{key:"remove",value:function(t){var e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}},{key:"merge",value:function(){var n=this,i=null;return this.runners.forEach(function(t,e){i&&t.done&&i.done&&(n.remove(t.id),n.edit(i.id,t.mergeWith(i))),i=t}),this}},{key:"edit",value:function(t,e){var n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t),this.runners.splice(n,1,e),this}},{key:"length",value:function(){return this.ids.length}},{key:"clearBefore",value:function(t){var e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Qe),this}}]),t}(),Je=0;lt({Element:{animate:function(t,e,n){var i=Ue.sanitise(t,e,n),r=this.timeline();return new Ue(i.duration).loop(i).element(this).timeline(r).schedule(e,n)},delay:function(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore:function(t){this._transformationRunners.clearBefore(t.id)},_currentTransform:function(e){return this._transformationRunners.runners.filter(function(t){return t.id<=e.id}).map(We).reduce($e,new je)},addRunner:function(t){this._transformationRunners.add(t),_t.transform_frame(function(){var t=this._transformationRunners.runners.map(We).reduce($e,new je);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}.bind(this),this._frameId)},_prepareRunner:function(){null==this._frameId&&(this._transformationRunners=(new Ze).add(new Qe(new je(this))),this._frameId=Je++)}}}),U(Ue,{attr:function(t,e){return this.styleAttr("attr",t,e)},css:function(t,e){return this.styleAttr("css",t,e)},styleAttr:function(e,n,t){if("object"===l(n))for(var i in t)this.styleAttr(e,i,t[i]);var r=new Ie(this._stepper).to(t);return this.queue(function(){r=r.from(this.element()[e](n))},function(t){return this.element()[e](n,r.at(t)),r.done()}),this},zoom:function(t,e){var n=new Ie(this._stepper).to(new vt(t));return this.queue(function(){n=n.from(this.zoom())},function(t){return this.element().zoom(n.at(t),e),n.done()}),this},transform:function(d,v,y){if(v=d.relative||v,this._isDeclarative&&!v&&this._tryRetarget("transform",d))return this;var p=L(d);y=null!=d.affine?d.affine:null!=y?y:!p;var m,g,w,x,b,_=(new Ie).type(y?Xe:je).stepper(this._stepper);return this.queue(function(){g=g||this.element(),m=m||I(d,g),b=new je(v?void 0:g),g.addRunner(this),v||g._clearTransformRunnersBefore(this)},function(t){v||this.clearTransform();var e=new he(m).transform(g._currentTransform(this)),n=e.x,i=e.y,r=new je(k({},d,{origin:[n,i]})),s=this._isDeclarative&&w?w:b;if(y){r=r.decompose(n,i),s=s.decompose(n,i);var u=r.rotate,o=s.rotate,a=[u-360,u,u+360],h=a.map(function(t){return Math.abs(t-o)}),l=Math.min.apply(Math,O(h)),c=h.indexOf(l);r.rotate=a[c]}v&&(p||(r.rotate=d.rotate||0),this._isDeclarative&&x&&(s.rotate=x)),_.from(s),_.to(r);var f=_.at(t);return x=f.rotate,w=new je(f),this.addTransform(w),_.done()},function(t){(t.origin||"center").toString()!==(d.origin||"center").toString()&&(m=I(d,g)),d=k({},t,{origin:m})}),this._isDeclarative&&this._rememberMorpher("transform",_),this},x:function(t,e){return this._queueNumber("x",t)},y:function(t){return this._queueNumber("y",t)},dx:function(t){return this._queueNumberDelta("dx",t)},dy:function(t){return this._queueNumberDelta("dy",t)},_queueNumberDelta:function(e,n){if(n=new vt(n),this._tryRetargetDelta(e,n))return this;var i=new Ie(this._stepper).to(n);return this.queue(function(){var t=this.element()[e]();i.from(t),i.to(t+n)},function(t){return this.element()[e](i.at(t)),i.done()}),this._rememberMorpher(e,i),this},_queueObject:function(e,t){if(this._tryRetarget(e,t))return this;var n=new Ie(this._stepper).to(t);return this.queue(function(){n.from(this.element()[e]())},function(t){return this.element()[e](n.at(t)),n.done()}),this._rememberMorpher(e,n),this},_queueNumber:function(t,e){return this._queueObject(t,new vt(e))},cx:function(t){return this._queueNumber("cx",t)},cy:function(t){return this._queueNumber("cy",t)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},size:function(t,e){var n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width:function(t){return this._queueNumber("width",t)},height:function(t){return this._queueNumber("height",t)},plot:function(t,e,n,i){return 4===arguments.length?this.plot([t,e,n,i]):this._queueObject("plot",new this._element.MorphArray(t))},leading:function(t){return this._queueNumber("leading",t)},viewbox:function(t,e,n,i){return this._queueObject("viewbox",new Box(t,e,n,i))},update:function(t){return"object"!==l(t)?this.update({offset:t,color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}});var Ke=Object.freeze({HtmlNode:ut,Doc:wt,Defs:ot,G:xt,Animator:_t,Bare:kt,Circle:Nt,ClipPath:qt,A:Lt,Ellipse:It,Stop:Ft,Gradient:Zt,Image:ie,Line:se,Marker:ue,Mask:oe,Path:ye,Pattern:Jt,Polygon:we,Polyline:xe,Rect:be,Symbol:_e,Text:Oe,TextPath:Ae,Tspan:Ce,Use:Me,SVGNumber:vt,SVGArray:$t,PathArray:le,PointArray:re,Matrix:je,Point:he,Box:Te,Color:Ut,Morphable:Ie,Queue:bt,Runner:Ue,Timeline:Ve,Controller:ze,Ease:De,PID:Le,Spring:qe}),tn=Object.freeze({Bare:kt,ClipPath:qt,Defs:ot,Doc:wt,Gradient:Zt,G:xt,A:Lt,Marker:ue,Mask:oe,Pattern:Jt,Symbol:_e,Text:Oe,Tspan:Ce,TextPath:Ae}),en=Object.freeze({Bare:kt,Circle:Nt,ClipPath:qt,Defs:ot,Doc:wt,Ellipse:It,Gradient:Zt,G:xt,HtmlNode:ut,A:Lt,Image:ie,Line:se,Marker:ue,Mask:oe,Path:ye,Pattern:Jt,Polygon:we,Polyline:xe,Rect:be,Stop:Ft,Symbol:_e,Text:Oe,TextPath:Ae,Tspan:Ce,Use:Me});lt("Element",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),"function"==typeof e.isRoot&&e.isRoot()&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return 0<t&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),"function"==typeof t.isRoot&&t.isRoot()&&t.node.appendChild(t.defs().node),this},back:function(){return 0<this.position()&&this.parent().removeElement(this).add(this,0),this},before:function(t){t.remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){t.remove();var e=this.position();return this.parent().add(t,e+1),this}}),lt("Element",{css:function(t,e){var n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter(function(t){return!!t.length}).forEach(function(t){var e=t.split(/\s*:\s*/);n[e[0]]=e[1]}),n;if(arguments.length<2){if(Array.isArray(t)){var i=!0,r=!1,s=void 0;try{for(var u,o=t[Symbol.iterator]();!(i=(u=o.next()).done);i=!0){var a=E(u.value);n[a]=this.node.style(a)}}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}if("string"==typeof t)return this.node.style[E(t)];if("object"===l(t))for(name in t)this.node.style[E(name)]=null==t[name]||w.test(t[name])?"":t[name]}return 2===arguments.length&&(this.node.style[E(t)]=null==e||w.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),lt("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(t).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(_).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(z(e[1])):t[e[0]].apply(t,e[1])},new je)},toParent:function(t){if(this===t)return this;var e=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t).untransform().transform(n.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())},transform:function(t,e){if(null==t||"string"==typeof t){var n=new je(this).decompose();return n[t]||n}L(t)||(t=k({},t,{origin:I(t,this)}));var i=new je(!0===e?this:e||!1).transform(t);return this.attr("transform",i)}}),lt("Element",{remember:function(t,e){if("object"===l(t))for(var n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(var t=arguments.length-1;0<=t;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory}}),ft("Memory",function(t){this._memory={}});var nn={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach(function(e){var n,t={};t[e]=function(t){if(void 0===t)return this;if("string"==typeof t||Ut.isRgb(t)||t&&"function"==typeof t.fill)this.attr(e,t);else for(n=nn[e].length-1;0<=n;n--)null!=t[nn[e][n]]&&this.attr(nn.prefix(e,nn[e][n]),t[nn[e][n]]);return this},lt(["Element","Runner"],t)}),lt(["Element","Runner"],{matrix:function(t,e,n,i,r,s){return null==t?new Matrix(this):this.attr("transform",new Matrix(t,e,n,i,r,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t,e){var n="string"==typeof t?t:(isFinite(t),"both"),i="both"===t&&isFinite(e)?[e,e]:"x"===t?[e,0]:"y"===t?[0,e]:isFinite(t)?[t,t]:[0,0];this.transform({flip:n,origin:i},!0)},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new vt(t).plus(this instanceof Ue?0:this.x()),!0)},dy:function(t){return this.y(new vt(t).plus(this instanceof Ue?0:this.y()),!0)},dmove:function(t,e){return this.dx(t).dy(e)}}),lt("radius",{radius:function(t,e){var n=(this._target||this).type;return"radialGradient"===n||"radialGradient"===n?this.attr("r",new vt(t)):this.rx(t).ry(null==e?t:e)}}),lt("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new Point(this.node.getPointAtLength(t))}}),lt(["Parent","Runner"],{font:function(t,e){if("object"===l(t))for(e in t)this.font(e,t[e]);return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),lt("EventTarget",{on:function(t,e,n,i){return ee(this,t,e,n,i),this},off:function(t,e){return ne(this,t,e),this},dispatch:function(t,e){return n=t,i=e,r=te(this),n instanceof window.Event||(n=new window.CustomEvent(n,{detail:i,cancelable:!0})),r.dispatchEvent(n),n;var n,i,r},fire:function(t,e){return this.dispatch(t,e),this}}),ft("EventTarget",function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.events=t.events||{}}),lt("Container",{children:function(){return Pt(this.node.children,function(t){return K(t)})},add:function(t,e){return t=J(t),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t.instance||t},has:function(t){return 0<=this.index(t)},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return K(this.node.childNodes[t])},first:function(){return K(this.node.firstChild)},last:function(){return K(this.node.lastChild)},each:function(t,e){var n,i,r=this.children();for(n=0,i=r.length;n<i;n++)r[n]instanceof s&&t.apply(r[n],[n,r]),e&&r[n]instanceof s&&r[n].is("Parent")&&r[n].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},svg:function(t){var e,n;if(!t)return this.writeDataToDom(),this.node.outerHTML;for((e=document.createElementNS(ns,"svg")).innerHTML=t,n=e.children.length;n--;)this.node.appendChild(e.firstElementChild);return this},writeDataToDom:function(){return this.each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},flatten:function(t){return this.each(function(){return this.is("Parent")?this.flatten(t).ungroup(t):this.toParent(t)}),this.node.firstElementChild||this.remove(),this},ungroup:function(t){return t=t||this.parent(),this.each(function(){return this.toParent(t)}),this.remove(),this}});var rn=U;rn([wt,_e,ie,Jt,ue],ct("viewbox")),rn([se,xe,we,ye],ct("marker")),rn(Oe,ct("Text")),rn(ye,ct("Path")),rn(ot,ct("Defs")),rn([Oe,Ce],ct("Tspan")),rn([be,It,Nt,Zt],ct("radius"));var sn=ct("Container");for(var un in tn)rn(tn[un],sn);var on=ct("Element"),an=ct("EventTarget");for(var hn in en)rn(en[hn],on),rn(en[hn],an),rn(en[hn],dt("EventTarget")),rn(en[hn],dt("Element")),rn(en[hn],dt("Memory"));function ln(t){return J(t)}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];Ge.push.apply(Ge,O([].concat(t)))}([vt,Ut,Te,je,$t,re,le]),U(Ge,{to:function(t,e){return(new Ie).type(this.constructor).from(this.valueOf()).to(t,e)},fromArray:function(t){return this.init(t),this}}),Object.assign(ln,Ke),Object.assign(ln,$),Object.assign(ln,st),ln.utils=zt,ln.regex=e,(ln.get=ln).select=Rt,Object.assign(ln,H),ln.Element=ln.Parent=ln.Shape=ln.Container=s,ln}(); +var SVG=function(){"use strict";function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function k(r){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{},e=Object.keys(s);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(s).filter(function(t){return Object.getOwnPropertyDescriptor(s,t).enumerable}))),e.forEach(function(t){var e,n,i;e=r,i=s[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return r}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var u,o=t[Symbol.iterator]();!(i=(u=o.next()).done)&&(n.push(u.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s=function(){function l(t,e){var n=e.extensions,i=void 0===n?[]:n;c(this,l);var r=!0,s=!(this.tags=[]),u=void 0;try{for(var o,a=i[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var h=o.value;h.setup.call(this,t),this.tags.push(h.name)}}catch(t){s=!0,u=t}finally{try{r||null==a.return||a.return()}finally{if(s)throw u}}}return o(l,[{key:"is",value:function(t){return this.tags.includes(t)}}]),l}(),h=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,v=/rgb\((\d+),(\d+),(\d+)\)/,y=/(#[a-z0-9\-_]+)/i,t=/\)\s*,?\s*/,p=/\s/g,m=/^#[a-f0-9]{3,6}$/i,g=/^rgb\(/,w=/^(\s+)?$/,x=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,b=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,_=/[\s,]+/,A=/([^e])-/gi,C=/[MLHVCSQTAZ]/gi,M=/[MLHVCSQTAZ]/i,j=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,T=/\./g,e=Object.freeze({numberAndUnit:h,hex:d,rgb:v,reference:y,transforms:t,whitespace:p,isHex:m,isRgb:g,isCss:/[^:]+:[^;]+;?/,isBlank:w,isNumber:x,isPercent:/^-?[\d.]+%$/,isImage:b,delimiter:_,hyphen:A,pathLetters:C,isPathLetter:M,numbersWithDots:j,dots:T});function S(t,e,n,i){return n+i.replace(T," .")}function E(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function N(t){return t.charAt(0).toUpperCase()+t.slice(1)}function P(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function D(t,e,n){if(null==e||null==n){var i=t.bbox();null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)}return{width:e,height:n}}function z(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}var R="abcdef".split("");function q(t,e,n){return Math.abs(e-t)<(n||1e-6)}function L(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}function I(t,e){var n,i,r=t.origin;if("string"==typeof r||null==r){var s=(r||"center").toLowerCase().trim(),u=e.bbox(),o=u.height,a=u.width,h=u.x,l=u.y,c=s.includes("left")?h:s.includes("right")?h+a:h+a/2,f=s.includes("top")?l:s.includes("bottom")?l+o:l+o/2;n=null!=t.ox?t.ox:c,i=null!=t.oy?t.oy:f}else n=r[0],i=r[1];return[n,i]}var F="http://www.w3.org/2000/svg",X="http://www.w3.org/2000/xmlns/",Y="http://www.w3.org/1999/xlink",G="http://svgjs.com/svgjs",B=Object.freeze({ns:F,xmlns:X,xlink:Y,svgjs:G});function H(t,e){return e||V(t)}function V(t){return document.createElementNS(F,t)}function U(t,e){var n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;0<=i;i--)for(n in e.name&&(t[i].extensions=(t[i].extensions||[]).concat(e)),e)t[i].prototype[n]||"name"==n||"setup"==n||(t[i].prototype[n]=e[n])}function Q(t,e){var n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;0<=i;i--)for(n in e)t[i].prototype[n]=e[n]}var $=Object.freeze({nodeOrNew:H,makeNode:V,extend:U,extend2:Q,addFactory:function(t,e){U(t,e)},invent:function(e){var t="function"==typeof e.create?e.create:function(t){e.inherit.call(this,t||V(e.create))};return e.inherit&&(t.prototype=new e.inherit,t.prototype.constructor=t),e.extend&&U(t,e.extend),e.construct&&U(e.parent||Container,e.construct),t}}),J={},W=Symbol("root");function Z(t){if(t instanceof s)return t;if("object"===l(t))return K(t);if(null==t)return new J[W];if("string"==typeof t&&"<"!==t.charAt(0))return K(document.querySelector(t));var e=V("svg");return e.innerHTML=t,t=K(e.firstChild)}function K(t){return t?t.instance instanceof s?t.instance:t instanceof window.SVGElement?"svg"===t.nodeName?new J[W](t):"linearGradient"===t.nodeName||"radialGradient"===t.nodeName?new J.Gradient(t):J[N(t.nodeName)]?new(J[N(t.nodeName)])(t):new J.Bare(t):new J.HtmlNode(t):null}function tt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t.name,n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return J[e]=t,n&&(J[W]=t),t}function et(t){return J[t]}var nt=1e3;function it(t){return"Svgjs"+N(t)+nt++}function rt(t){for(var e=t.children.length-1;0<=e;e--)rt(t.children[e]);return t.id?K(t).id(it(t.nodeName)):K(t)}var st=Object.freeze({root:W,makeInstance:Z,adopt:K,register:tt,getClass:et,eid:it,assignNewId:rt}),ut=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,t,n))).node=t,e}return r(n,s),o(n,[{key:"add",value:function(t,e){return(t=Z(t)).node!==this.node.children[e]&&this.node.insertBefore(t.node,this.node.children[e]||null),this}},{key:"put",value:function(t,e){return this.add(t,e),t}},{key:"getEventTarget",value:function(){return this.node}}]),n}();tt(ut);var ot=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("defs",t),e))}return r(e,s),o(e,[{key:"flatten",value:function(){return this}},{key:"ungroup",value:function(){return this}}]),e}();tt(ot);var at={},ht={};function lt(t,e){if(Array.isArray(t)){var n=!0,i=!1,r=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){lt(s.value,e)}}catch(t){i=!0,r=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw r}}}else if("object"!=l(t))at[t]=Object.assign(at[t]||{},e);else for(var o=Object.entries(t),a=0;a<o.length;a++){var h=f(o[a],2);lt(h[0],h[1])}}function ct(t){return at[t]||{}}function ft(t,e){ht[t]=e}function dt(t){return ht[t]?{setup:ht[t],name:t}:{}}var vt=function(){function n(){c(this,n),this.init.apply(this,arguments)}return o(n,[{key:"init",value:function(t,e){e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(h))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof n&&(this.value=t.valueOf(),this.unit=t.unit)}},{key:"toString",value:function(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"toArray",value:function(){return[this.value,this.unit]}},{key:"valueOf",value:function(){return this.value}},{key:"plus",value:function(t){return new n(this+(t=new n(t)),this.unit||t.unit)}},{key:"minus",value:function(t){return new n(this-(t=new n(t)),this.unit||t.unit)}},{key:"times",value:function(t){return new n(this*(t=new n(t)),this.unit||t.unit)}},{key:"divide",value:function(t){return new n(this/(t=new n(t)),this.unit||t.unit)}}]),n}(),yt=et(W),pt=et("HtmlNode");function mt(){return this.parent()&&this.parent().removeElement(this),this}function gt(t){var e=this;if(!e.node.parentNode)return null;if(e=K(e.node.parentNode),!t)return e;for(;e&&e.node instanceof window.SVGElement;){if("string"==typeof t?e.matches(t):e instanceof t)return e;e=K(e.node.parentNode)}}function wt(){var t=this.parent(yt);return t&&t.doc()}lt("Element",{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var n=D(this,t,e);return this.width(new vt(n.width)).height(new vt(n.height))},clone:function(t){this.writeDataToDom();var e=rt(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:mt,replace:function(t){return this.after(t).remove(),t},addTo:function(t){return Z(t).put(this)},putIn:function(t){return Z(t).add(this)},id:function(t){return void 0!==t||this.node.id||(this.node.id=it(this.type)),this.attr("id",t)},inside:function(t,e){var n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},toString:function(){return this.id()},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(_)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!==e}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){var e=function(t){var e=(t||"").toString().match(y);if(e)return e[1]}(this.attr(t));return e?Z(e):null},doc:wt,defs:function(){return this.doc().defs()},parent:gt,parents:function(t){var e=[],n=this;do{if(!(n=n.parent(t))||n instanceof pt)break;e.push(n)}while(n.parent);return e},matches:function(t){return e=this.node,n=t,(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,n);var e,n},native:function(){return this.node},svg:function(){return this.writeDataToDom(),this.node.outerHTML},writeDataToDom:function(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},getEventTarget:function(){return this.node}}),ft("Element",function(t){this.dom={},this.node=t,this.type=t.nodeName,this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})});var xt=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,H("svg",t),n))).namespace(),e}return r(n,s),o(n,[{key:"isRoot",value:function(){return!(this.node.parentNode&&this.node.parentNode instanceof window.SVGElement&&"#document"!==this.node.parentNode.nodeName)}},{key:"doc",value:function(){return this.isRoot()?this:wt.call(this)}},{key:"namespace",value:function(){return this.isRoot()?this.attr({xmlns:F,version:"1.1"}).attr("xmlns:xlink",Y,X).attr("xmlns:svgjs",G,X):this.doc().namespace()}},{key:"defs",value:function(){return this.isRoot()?K(this.node.getElementsByTagName("defs")[0])||this.put(new ot):this.doc().defs()}},{key:"parent",value:function(t){return this.isRoot()?"#document"===this.node.parentNode.nodeName?null:K(this.node.parentNode):gt.call(this,t)}},{key:"remove",value:function(){return this.isRoot()?(this.parent()&&this.parent().removeChild(this.node),this):mt.call(this)}},{key:"clear",value:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}}]),n}();lt({Container:{nested:function(){return this.put(new xt)}}}),tt(xt,"Doc",!0);var bt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("g",t),e))}return r(e,s),e}();lt({Element:{group:function(){return this.put(new bt)}}}),tt(bt);var _t=function(){function t(){c(this,t),this._first=null,this._last=null}return o(t,[{key:"push",value:function(t){var e=t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}},{key:"shift",value:function(){var t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}},{key:"first",value:function(){return this._first&&this._first.value}},{key:"last",value:function(){return this._last&&this._last.value}},{key:"remove",value:function(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}}]),t}(),kt={nextDraw:null,frames:new _t,timeouts:new _t,timer:window.performance||window.Date,transforms:[],frame:function(t){var e=kt.frames.push({run:t});return null===kt.nextDraw&&(kt.nextDraw=window.requestAnimationFrame(kt._draw)),e},transform_frame:function(t,e){kt.transforms[e]=t},timeout:function(t,e){e=e||0;var n=kt.timer.now()+e,i=kt.timeouts.push({run:t,time:n});return null===kt.nextDraw&&(kt.nextDraw=window.requestAnimationFrame(kt._draw)),i},cancelFrame:function(t){kt.frames.remove(t)},clearTimeout:function(t){kt.timeouts.remove(t)},_draw:function(t){for(var e=null,n=kt.timeouts.last();(e=kt.timeouts.shift())&&(t>=e.time?e.run():kt.timeouts.push(e),e!==n););for(var i=null,r=kt.frames.last();i!==r&&(i=kt.frames.shift());)i.run();kt.transforms.forEach(function(t){t()}),kt.nextDraw=kt.timeouts.first()||kt.frames.first()?window.requestAnimationFrame(kt._draw):null}},Ot=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H(t,"string"==typeof t?null:t),e))}return r(e,s),o(e,[{key:"words",value:function(t){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(document.createTextNode(t)),this}}]),e}();function At(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ct(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Mt(t){return null==t?this.attr("cx"):this.attr("cx",t)}function jt(t){return null==t?this.attr("cy"):this.attr("cy",t)}function Tt(t){return null==t?2*this.rx():this.rx(new vt(t).divide(2))}function St(t){return null==t?2*this.ry():this.ry(new vt(t).divide(2))}function Et(t,e){var n=D(this,t,e);return this.rx(new vt(n.width).divide(2)).ry(new vt(n.height).divide(2))}tt(Ot),lt("Container",{element:function(t,e){return this.put(new Ot(t,e))}});var Nt=Object.freeze({rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)},x:At,y:Ct,cx:Mt,cy:jt,width:Tt,height:St,size:Et}),Pt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("circle",t),e))}return r(e,s),o(e,[{key:"radius",value:function(t){return this.attr("r",t)}},{key:"rx",value:function(t){return this.attr("r",t)}},{key:"ry",value:function(t){return this.rx(t)}}]),e}();function Dt(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function zt(t){return t%360*Math.PI/180}U(Pt,{x:At,y:Ct,cx:Mt,cy:jt,width:Tt,height:St,size:Et}),lt({Element:{circle:function(t){return this.put(new Pt).radius(new vt(t).divide(2)).move(0,0)}}}),tt(Pt);var Rt=Object.freeze({map:Dt,filter:function(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r},radians:zt,degrees:function(t){return 180*t/Math.PI%360},filterSVGElements:function(t){return this.filter(t,function(t){return t instanceof window.SVGElement})}});function qt(t,e){return Dt((e||document).querySelectorAll(t),function(t){return K(t)})}lt("Container",{find:function(t){return qt(t,this.node)}});var Lt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("clipPath",t),e))}return r(e,s),o(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unclip()}),mt.call(this)}},{key:"targets",value:function(){return qt('svg [clip-path*="'+this.id()+'"]')}}]),e}();lt({Container:{clip:function(){return this.defs().put(new Lt)}},Element:{clipWith:function(t){var e=t instanceof Lt?t:this.parent().clip().add(t);return this.attr("clip-path",'url("#'+e.id()+'")')},unclip:function(){return this.attr("clip-path",null)},clipper:function(){return this.reference("clip-path")}}}),tt(Lt);var It=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("a",t),e))}return r(e,s),o(e,[{key:"to",value:function(t){return this.attr("href",t,Y)}},{key:"target",value:function(t){return this.attr("target",t)}}]),e}();lt({Container:{link:function(t){return this.put(new It).to(t)}},Element:{linkTo:function(t){var e=new It;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}}),tt(It);var Ft=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("ellipse",t),e))}return r(e,s),e}();U(Ft,Nt),lt("Container",{ellipse:function(t,e){return this.put(new Ft).size(t,e).move(0,0)}}),tt(Ft);var Xt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("stop",t),e))}return r(e,s),o(e,[{key:"update",value:function(t){return("number"==typeof t||t instanceof vt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new vt(t.offset)),this}}]),e}();tt(Xt);var Yt=Object.freeze({from:function(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new vt(t),fy:new vt(e)}):this.attr({x1:new vt(t),y1:new vt(e)})},to:function(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new vt(t),cy:new vt(e)}):this.attr({x2:new vt(t),y2:new vt(e)})}});function Gt(){}var Bt=400,Ht=">",Vt=0,Ut={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"},Qt=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t,e,n){var i,r;(this.r=0,this.g=0,this.b=0,t)&&("string"==typeof t?g.test(t)?(i=v.exec(t.replace(p,"")),this.r=parseInt(i[1]),this.g=parseInt(i[2]),this.b=parseInt(i[3])):m.test(t)&&(i=d.exec(4===(r=t).length?["#",r.substring(1,2),r.substring(1,2),r.substring(2,3),r.substring(2,3),r.substring(3,4),r.substring(3,4)].join(""):r),this.r=parseInt(i[1],16),this.g=parseInt(i[2],16),this.b=parseInt(i[3],16)):Array.isArray(t)?(this.r=t[0],this.g=t[1],this.b=t[2]):"object"===l(t)?(this.r=t.r,this.g=t.g,this.b=t.b):3===arguments.length&&(this.r=t,this.g=e,this.b=n))}},{key:"toString",value:function(){return this.toHex()}},{key:"toArray",value:function(){return[this.r,this.g,this.b]}},{key:"toHex",value:function(){return"#"+P(Math.round(this.r))+P(Math.round(this.g))+P(Math.round(this.b))}},{key:"toRgb",value:function(){return"rgb("+[this.r,this.g,this.b].join()+")"}},{key:"brightness",value:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11}}],[{key:"test",value:function(t){return t+="",m.test(t)||g.test(t)}},{key:"isRgb",value:function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}},{key:"isColor",value:function(t){return this.isRgb(t)||this.test(t)}}]),t}(),$t=function(){try{return Function("name","baseClass","_constructor",["baseClass = baseClass || Array","return {","[name]: class extends baseClass {","constructor (...args) {","super(...args)","_constructor && _constructor.apply(this, args)","}","}","}[name]"].join("\n"))}catch(t){return function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Array,n=2<arguments.length?arguments[2]:void 0,i=function(){e.apply(this,arguments),n&&n.apply(this,arguments)};return(i.prototype=Object.create(e.prototype)).constructor=i}}}(),Jt=$t("SVGArray",Array,function(){this.init.apply(this,arguments)});function Wt(t,e,n){if(null==t){t={},e=this.node.attributes;var i=!0,r=!1,s=void 0;try{for(var u,o=e[Symbol.iterator]();!(i=(u=o.next()).done);i=!0){var a=u.value;t[a.nodeName]=x.test(a.nodeValue)?parseFloat(a.nodeValue):a.nodeValue}}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return t}if(Array.isArray(t));else if("object"===l(t))for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ut[t]:x.test(e)?parseFloat(e):e;for("fill"!==t&&"stroke"!==t||b.test(e)&&(e=this.doc().defs().image(e));"function"==typeof e.attrHook;)e=e.attrHook(this,t);"number"==typeof e?e=new vt(e):Qt.isColor(e)?e=new Qt(e):e.constructor===Array&&(e=new Jt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this}Q(Jt,{init:function(){this.length=0,this.push.apply(this,O(this.parse.apply(this,arguments)))},toArray:function(){var t=[];return t.push.apply(t,O(this)),t},toString:function(){return this.join(" ")},valueOf:function(){return this.toArray()},parse:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return t instanceof Array?t:t.trim().split(_).map(parseFloat)},clone:function(){return new this.constructor(this)},toSet:function(){return new Set(this)}}),lt("Element",{attr:Wt});var Zt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H(t+"Gradient","string"==typeof t?null:t),e))}return r(e,s),o(e,[{key:"stop",value:function(t,e,n){return this.put(new Xt).update(t,e,n)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="gradientTransform"),Wt.call(this,t,e,n)}},{key:"targets",value:function(){return find('svg [fill*="'+this.id()+'"]')}}]),e}();U(Zt,Yt),lt({Container:{gradient:function(t,e){return this.defs().gradient(t,e)}},Defs:{gradient:function(t,e){return this.put(new Zt(t)).update(e)}}}),tt(Zt);var Kt=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("pattern",t),e))}return r(e,s),o(e,[{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="patternTransform"),Wt.call(this,t,e,n)}},{key:"targets",value:function(){return find('svg [fill*="'+this.id()+'"]')}}]),e}();lt({Container:{pattern:function(t,e,n){return this.defs().pattern(t,e,n)}},Defs:{pattern:function(t,e,n){return this.put(new Kt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}}),tt(Kt),lt("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce(function(t,e){return t[e]=function(t){return null===t?ie(this,e):ne(this,e,t),this},t},{}));var te=0;function ee(t){return t instanceof s&&t.is("EventTarget")?t.getEventTarget():t}function ne(t,e,i,n,r){var s=i.bind(n||t),u=ee(t);e=Array.isArray(e)?e:e.split(_),u.instance=u.instance||{events:{}};var o=u.instance.events;i._svgjsListenerId||(i._svgjsListenerId=++te),e.forEach(function(t){var e=t.split(".")[0],n=t.split(".")[1]||"*";o[e]=o[e]||{},o[e][n]=o[e][n]||{},o[e][n][i._svgjsListenerId]=s,u.addEventListener(e,s,r||!1)})}function ie(t,e,s,u){var o=ee(t);if(o.instance&&("function"!=typeof s||(s=s._svgjsListenerId))){var a=o.instance.events;(e=Array.isArray(e)?e:(e||"").split(_)).forEach(function(t){var e,n,i=t&&t.split(".")[0],r=t&&t.split(".")[1];if(s)a[i]&&a[i][r||"*"]&&(o.removeEventListener(i,a[i][r||"*"][s],u||!1),delete a[i][r||"*"][s]);else if(i&&r){if(a[i]&&a[i][r]){for(n in a[i][r])ie(o,[i,r].join("."),n);delete a[i][r]}}else if(r)for(t in a)for(e in a[t])r===e&&ie(o,[t,r].join("."));else if(i){if(a[i]){for(e in a[i])ie(o,[i,e].join("."));delete a[i]}}else{for(t in a)ie(o,t);o.instance.events={}}})}}function re(t,e,n){var i=ee(t);return e instanceof window.Event||(e=new window.CustomEvent(e,{detail:n,cancelable:!0})),i.dispatchEvent(e),e}var se=Object.freeze({on:ne,off:ie,dispatch:re}),ue=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("image",t),e))}return r(e,s),o(e,[{key:"load",value:function(n,i){if(!n)return this;var r=new window.Image;return ne(r,"load",function(t){var e=this.parent(Kt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),e instanceof Kt&&0===e.width()&&0===e.height()&&e.size(this.width(),this.height()),"function"==typeof i&&i.call(this,{width:r.width,height:r.height,ratio:r.width/r.height,url:n})},this),ne(r,"load error",function(){ie(r)}),this.attr("href",r.src=n,Y)}},{key:"attrHook",value:function(t){var e=this;return t.doc().defs().pattern(0,0,function(t){t.add(e)})}}]),e}();lt({Container:{image:function(t,e){return this.put(new ue).size(0,0).load(t,e)}}}),tt(ue);var oe=$t("PointArray",Jt);Q(oe,{toString:function(){for(var t=0,e=this.length,n=[];t<e;t++)n.push(this[t].join(","));return n.join(" ")},toLine:function(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}},at:function(t){if(!this.destination)return this;for(var e=0,n=this.length,i=[];e<n;e++)i.push([this[e][0]+(this.destination[e][0]-this[e][0])*t,this[e][1]+(this.destination[e][1]-this[e][1])*t]);return new oe(i)},parse:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[[0,0]],e=[];if(t instanceof Array){if(t[0]instanceof Array)return t}else t=t.trim().split(_).map(parseFloat);t.length%2!=0&&t.pop();for(var n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i=this.length-1;0<=i;i--)this[i]=[this[i][0]+t,this[i][1]+e];return this},size:function(t,e){var n,i=this.bbox();for(n=this.length-1;0<=n;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this},bbox:function(){var e=-1/0,n=-1/0,i=1/0,r=1/0;return this.forEach(function(t){e=Math.max(t[0],e),n=Math.max(t[1],n),i=Math.min(t[0],i),r=Math.min(t[1],r)}),{x:i,y:r,width:e-i,height:n-r}}});var ae=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("line",t),e))}return r(e,s),o(e,[{key:"array",value:function(){return new oe([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}},{key:"plot",value:function(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new oe(t).toLine(),this.attr(t))}},{key:"move",value:function(t,e){return this.attr(this.array().move(t,e).toLine())}},{key:"size",value:function(t,e){var n=D(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}]),e}();lt({Container:{line:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ae.prototype.plot.apply(this.put(new ae),null!=e[0]?e:[0,0,0,0])}}}),tt(ae);var he=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("marker",t),e))}return r(e,s),o(e,[{key:"width",value:function(t){return this.attr("markerWidth",t)}},{key:"height",value:function(t){return this.attr("markerHeight",t)}},{key:"ref",value:function(t,e){return this.attr("refX",t).attr("refY",e)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return"url(#"+this.id()+")"}}]),e}();lt({Container:{marker:function(t,e,n){return this.defs().marker(t,e,n)}},Defs:{marker:function(t,e,n){return this.put(new he).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}},marker:{marker:function(t,e,n,i){var r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=e instanceof he?e:this.defs().marker(e,n,i),this.attr(r,t)}}}),tt(he);var le=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("mask",t),e))}return r(e,s),o(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unmask()}),mt.call(this)}},{key:"targets",value:function(){return qt('svg [mask*="'+this.id()+'"]')}}]),e}();function ce(){if(!ce.nodes){var t=(new xt).size(2,0).css({opacity:0,position:"absolute",left:"-100%",top:"-100%",overflow:"hidden"}),e=t.path().node;ce.nodes={svg:t,path:e}}if(!ce.nodes.svg.node.parentNode){var n=document.body||document.documentElement;ce.nodes.svg.addTo(n)}return ce.nodes}lt({Container:{mask:function(){return this.defs().put(new le)}},Element:{maskWith:function(t){var e=t instanceof le?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask:function(){return this.attr("mask",null)},masker:function(){return this.reference("mask")}}}),tt(le);var fe=function(){function r(t,e,n){var i;c(this,r),n=n||{x:0,y:0},i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"===l(t)?{x:t.x,y:t.y}:{x:t,y:e},this.x=null==i.x?n.x:i.x,this.y=null==i.y?n.y:i.y}return o(r,[{key:"clone",value:function(){return new r(this)}},{key:"native",value:function(){var t=ce().svg.node.createSVGPoint();return t.x=this.x,t.y=this.y,t}},{key:"transform",value:function(t){return new r(t.a*this.x+t.c*this.y+t.e,t.b*this.x+t.d*this.y+t.f)}}]),r}();lt({Element:{point:function(t,e){return new fe(t,e).transform(this.screenCTM().inverse())}}});for(var de=$t("PathArray",Jt),ve={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ye="mlhvqtcsaz".split(""),pe=0,me=ye.length;pe<me;++pe)ve[ye[pe]]=function(s){return function(t,e,n){if("H"===s)t[0]=t[0]+e.x;else if("V"===s)t[0]=t[0]+e.y;else if("A"===s)t[5]=t[5]+e.x,t[6]=t[6]+e.y;else for(var i=0,r=t.length;i<r;++i)t[i]=t[i]+(i%2?e.y:e.x);return ve[s](t,e,n)}}(ye[pe].toUpperCase());Q(de,{toString:function(){return function(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e][0],null!=t[e][1]&&(i+=t[e][1],null!=t[e][2]&&(i+=" ",i+=t[e][2],null!=t[e][3]&&(i+=" ",i+=t[e][3],i+=" ",i+=t[e][4],null!=t[e][5]&&(i+=" ",i+=t[e][5],i+=" ",i+=t[e][6],null!=t[e][7]&&(i+=" ",i+=t[e][7])))));return i+" "}(this)},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i,r=this.length-1;0<=r;r--)"M"===(i=this[r][0])||"L"===i||"T"===i?(this[r][1]+=t,this[r][2]+=e):"H"===i?this[r][1]+=t:"V"===i?this[r][1]+=e:"C"===i||"S"===i||"Q"===i?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===i&&(this[r][5]+=t,this[r][6]+=e)):"A"===i&&(this[r][6]+=t,this[r][7]+=e);return this},size:function(t,e){var n,i,r=this.bbox();for(n=this.length-1;0<=n;n--)"M"===(i=this[n][0])||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this},equalCommands:function(t){var e,n,i;for(t=new de(t),i=this.length===t.length,e=0,n=this.length;i&&e<n;e++)i=this[e][0]===t[e][0];return i},morph:function(t){return t=new de(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at:function(t){if(!this.destination)return this;var e,n,i,r,s=this,u=this.destination.value,o=[],a=new de;for(e=0,n=s.length;e<n;e++){for(o[e]=[s[e][0]],i=1,r=s[e].length;i<r;i++)o[e][i]=s[e][i]+(u[e][i]-s[e][i])*t;"A"===o[e][0]&&(o[e][4]=+(0!==o[e][4]),o[e][5]=+(0!==o[e][5]))}return a.value=o,a},parse:function(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[["M",0,0]];if(e instanceof de)return e;var n={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};e="string"==typeof e?e.replace(j,S).replace(C," $& ").replace(A,"$1 -").trim().split(_):e.reduce(function(t,e){return[].concat.call(t,e)},[]);for(var i=[],r=new fe,s=new fe,u=0,o=e.length;M.test(e[u])?(t=e[u],++u):"M"===t?t="L":"m"===t&&(t="l"),i.push(ve[t].call(null,e.slice(u,u+=n[t.toUpperCase()]).map(parseFloat),r,s)),u<o;);return i},bbox:function(){return ce().path.setAttribute("d",this.toString()),ce.nodes.path.getBBox()}});var ge=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("path",t),e))}return r(e,s),o(e,[{key:"array",value:function(){return this._array||(this._array=new de(this.attr("d")))}},{key:"plot",value:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new de(t))}},{key:"clear",value:function(){return delete this._array,this}},{key:"move",value:function(t,e){return this.attr("d",this.array().move(t,e))}},{key:"x",value:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}},{key:"y",value:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},{key:"size",value:function(t,e){var n=D(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}},{key:"width",value:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}},{key:"height",value:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},{key:"targets",value:function(){return qt('svg textpath [href*="'+this.id()+'"]')}}]),e}();ge.prototype.MorphArray=de,lt({Container:{path:function(t){return this.put(new ge).plot(t||new de)}}}),tt(ge);var we=oe;var xe=Object.freeze({MorphArray:we,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}});var be=Object.freeze({array:function(){return this._array||(this._array=new oe(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new oe(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var n=D(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}}),_e=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("polygon",t),e))}return r(e,s),e}();lt({Container:{polygon:function(t){return this.put(new _e).plot(t||new oe)}}}),U(_e,xe),U(_e,be),tt(_e);var ke=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("polyline",t),e))}return r(e,s),e}();lt({Container:{polyline:function(t){return this.put(new ke).plot(t||new oe)}}}),U(ke,xe),U(ke,be),tt(ke);var Oe=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("rect",t),e))}return r(e,s),e}();lt({Container:{rect:function(t,e){return this.put(new Oe).size(t,e)}}}),tt(Oe);var Ae=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("symbol",t),e))}return r(e,s),e}();lt({Container:{symbol:function(){return this.put(new Ae)}}}),tt(Ae);var Ce=Object.freeze({plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()}}),Me=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this,H("text",t),n))).dom.leading=new vt(1.3),e._rebuild=!0,e._build=!1,e.attr("font-family",Ut["font-family"]),e}return r(n,s),o(n,[{key:"x",value:function(t){return null==t?this.attr("x"):this.attr("x",t)}},{key:"y",value:function(t){var e=this.attr("y"),n="number"==typeof e?e-this.bbox().y:0;return null==t?"number"==typeof e?e-n:e:this.attr("y","number"==typeof t?t+n:t)}},{key:"cx",value:function(t){return null==t?this.bbox().cx:this.x(t-this.bbox().width/2)}},{key:"cy",value:function(t){return null==t?this.bbox().cy:this.y(t-this.bbox().height/2)}},{key:"text",value:function(t){if(void 0===t){var e=this.node.childNodes,n=0;t="";for(var i=0,r=e.length;i<r;++i)"textPath"!==e[i].nodeName?(i!==n&&3!==e[i].nodeType&&!0===K(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(var s=0,u=(t=t.split("\n")).length;s<u;s++)this.tspan(t[s]).newLine();return this.build(!1).rebuild()}},{key:"leading",value:function(t){return null==t?this.dom.leading:(this.dom.leading=new vt(t),this.rebuild())}},{key:"rebuild",value:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,n=0,i=this.dom.leading*new vt(this.attr("font-size"));this.each(function(){this.dom.newLined&&(this.attr("x",e.attr("x")),"\n"===this.text()?n+=i:(this.attr("dy",i+n),n=0))}),this.fire("rebuild")}return this}},{key:"build",value:function(t){return this._build=!!t,this}},{key:"setData",value:function(t){return this.dom=t,this.dom.leading=new vt(t.leading||1.3),this}}]),n}();U(Me,Ce),lt({Container:{text:function(t){return this.put(new Me).text(t)},plain:function(t){return this.put(new Me).plain(t)}}}),tt(Me);var je=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("textPath",t),e))}return r(e,Me),o(e,[{key:"array",value:function(){var t=this.track();return t?t.array():null}},{key:"plot",value:function(t){var e=this.track(),n=null;return e&&(n=e.plot(t)),null==t?n:this}},{key:"track",value:function(){return this.reference("href")}}]),e}();lt({Container:{textPath:function(t,e){return this.defs().path(e).text(t).addTo(this)}},Text:{path:function(t){var e=new je;return t instanceof ge||(t=this.doc().defs().path(t)),e.attr("href","#"+t,Y),this.put(e)},textPath:function(){return this.find("textPath")}},Path:{text:function(t){if(t instanceof Me){var e=t.text();return t.clear().path(this).text(e)}return this.parent().put(new Me).path(this).text(t)}}}),je.prototype.MorphArray=de,tt(je);var Te=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("tspan",t),e))}return r(e,s),o(e,[{key:"text",value:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)}},{key:"dx",value:function(t){return this.attr("dx",t)}},{key:"dy",value:function(t){return this.attr("dy",t)}},{key:"newLine",value:function(){var t=this.parent(Me);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}]),e}();U(Te,Ce),lt({Tspan:{tspan:function(t){var e=new Te;return this._build||this.clear(),this.node.appendChild(e.node),e.text(t)}}}),tt(Te);var Se=function(t){function e(t){return c(this,e),a(this,u(e).call(this,H("use",t),e))}return r(e,s),o(e,[{key:"element",value:function(t,e){return this.attr("href",(e||"")+"#"+t,Y)}}]),e}();lt({Container:{use:function(t,e){return this.put(new Se).element(t,e)}}}),tt(Se);var Ee=function(){function h(){c(this,h),this.init.apply(this,arguments)}return o(h,[{key:"init",value:function(t){var e=z([1,0,0,1,0,0]);t=t instanceof s&&t.is("Element")?t.matrixify():"string"==typeof t?z(t.split(_).map(parseFloat)):Array.isArray(t)?z(t):"object"===l(t)&&L(t)?t:"object"===l(t)?(new h).transform(t):6===arguments.length?z([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f}},{key:"clone",value:function(){return new h(this)}},{key:"transform",value:function(t){if(L(t))return new h(t).multiplyO(this);var e=h.formatTransforms(t),n=new fe(e.ox,e.oy).transform(this),i=n.x,r=n.y,s=(new h).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-i,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(i,r);if(isFinite(e.px)||isFinite(e.py)){var u=new fe(i,r).transform(s),o=e.px?e.px-u.x:0,a=e.py?e.py-u.y:0;s.translateO(o,a)}return s.translateO(e.tx,e.ty),s}},{key:"compose",value:function(t){t.origin&&(t.originX=t.origin[0],t.originY=t.origin[1]);var e=t.originX||0,n=t.originY||0,i=t.scaleX||1,r=t.scaleY||1,s=t.shear||0,u=t.rotate||0,o=t.translateX||0,a=t.translateY||0;return(new h).translateO(-e,-n).scaleO(i,r).shearO(s).rotateO(u).translateO(o,a).lmultiplyO(this).translateO(e,n)}},{key:"decompose",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=this.a,i=this.b,r=this.c,s=this.d,u=this.e,o=this.f,a=n*s-i*r,h=0<a?1:-1,l=h*Math.sqrt(n*n+i*i),c=Math.atan2(h*i,h*n),f=180/Math.PI*c,d=Math.cos(c),v=Math.sin(c),y=(n*r+i*s)/a,p=r*l/(y*n-i)||s*l/(y*i+n);return{scaleX:l,scaleY:p,shear:y,rotate:f,translateX:u-t+t*d*l+e*(y*d*l-v*p),translateY:o-e+t*v*l+e*(y*v*l+d*p),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}},{key:"multiply",value:function(t){return this.clone().multiplyO(t)}},{key:"multiplyO",value:function(t){var e=t instanceof h?t:new h(t);return h.matrixMultiply(this,e,this)}},{key:"lmultiply",value:function(t){return this.clone().lmultiplyO(t)}},{key:"lmultiplyO",value:function(t){var e=t instanceof h?t:new h(t);return h.matrixMultiply(e,this,this)}},{key:"inverseO",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,u=t*i-e*n;if(!u)throw new Error("Cannot invert "+this);var o=i/u,a=-e/u,h=-n/u,l=t/u,c=-(o*r+h*s),f=-(a*r+l*s);return this.a=o,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}},{key:"inverse",value:function(){return this.clone().inverseO()}},{key:"translate",value:function(t,e){return this.clone().translateO(t,e)}},{key:"translateO",value:function(t,e){return this.e+=t||0,this.f+=e||0,this}},{key:"scale",value:function(t,e,n,i){var r;return(r=this.clone()).scaleO.apply(r,arguments)}},{key:"scaleO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(i=n,n=e,e=t);var r=this.a,s=this.b,u=this.c,o=this.d,a=this.e,h=this.f;return this.a=r*t,this.b=s*e,this.c=u*t,this.d=o*e,this.e=a*t-n*t+n,this.f=h*e-i*e+i,this}},{key:"rotate",value:function(t,e,n){return this.clone().rotateO(t,e,n)}},{key:"rotateO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;t=zt(t);var i=Math.cos(t),r=Math.sin(t),s=this.a,u=this.b,o=this.c,a=this.d,h=this.e,l=this.f;return this.a=s*i-u*r,this.b=u*i+s*r,this.c=o*i-a*r,this.d=a*i+o*r,this.e=h*i-l*r+n*r-e*i+e,this.f=l*i+h*r-e*r-n*i+n,this}},{key:"flip",value:function(t,e){return this.clone().flipO(t,e)}},{key:"flipO",value:function(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}},{key:"shear",value:function(t,e,n){return this.clone().shearO(t,e,n)}},{key:"shearO",value:function(t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=this.a,i=this.b,r=this.c,s=this.d,u=this.e,o=this.f;return this.a=n+i*t,this.c=r+s*t,this.e=u+o*t-e*t,this}},{key:"skew",value:function(t,e,n,i){var r;return(r=this.clone()).skewO.apply(r,arguments)}},{key:"skewO",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;3===arguments.length&&(i=n,n=e,e=t),t=zt(t),e=zt(e);var r=Math.tan(t),s=Math.tan(e),u=this.a,o=this.b,a=this.c,h=this.d,l=this.e,c=this.f;return this.a=u+o*r,this.b=o+u*s,this.c=a+h*r,this.d=h+a*s,this.e=l+c*r-i*r,this.f=c+l*s-n*s,this}},{key:"skewX",value:function(t,e,n){return this.skew(t,0,e,n)}},{key:"skewXO",value:function(t,e,n){return this.skewO(t,0,e,n)}},{key:"skewY",value:function(t,e,n){return this.skew(0,t,e,n)}},{key:"skewYO",value:function(t,e,n){return this.skewO(0,t,e,n)}},{key:"aroundO",value:function(t,e,n){var i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}},{key:"around",value:function(t,e,n){return this.clone().aroundO(t,e,n)}},{key:"native",value:function(){for(var t=ce().svg.node.createSVGMatrix(),e=R.length-1;0<=e;e--)t[R[e]]=this[R[e]];return t}},{key:"equals",value:function(t){var e=new h(t);return q(this.a,e.a)&&q(this.b,e.b)&&q(this.c,e.c)&&q(this.d,e.d)&&q(this.e,e.e)&&q(this.f,e.f)}},{key:"toString",value:function(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}},{key:"toArray",value:function(){return[this.a,this.b,this.c,this.d,this.e,this.f]}},{key:"valueOf",value:function(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}],[{key:"formatTransforms",value:function(t){var e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,u=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,o=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,a=t.shear||0,h=t.rotate||t.theta||0,l=new fe(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new fe(t.position||t.px||t.positionX,t.py||t.positionY),v=d.x,y=d.y,p=new fe(t.translate||t.tx||t.translateX,t.ty||t.translateY),m=p.x,g=p.y,w=new fe(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:u,scaleY:o,skewX:r,skewY:s,shear:a,theta:h,rx:w.x,ry:w.y,tx:m,ty:g,ox:c,oy:f,px:v,py:y}}},{key:"matrixMultiply",value:function(t,e,n){var i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,u=t.b*e.c+t.d*e.d,o=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=s,n.d=u,n.e=o,n.f=a,n}}]),h}();lt({Element:{ctm:function(){return new Ee(this.node.getCTM())},screenCTM:function(){if("function"!=typeof this.isRoot||this.isRoot())return new Ee(this.node.getScreenCTM());var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Ee(e)}}});var Ne=function(){function u(){c(this,u),this.init.apply(this,arguments)}return o(u,[{key:"init",value:function(t){var e;t="string"==typeof t?t.split(_).map(parseFloat):Array.isArray(t)?t:"object"===l(t)?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3],null==(e=this).x&&(e.x=0,e.y=0,e.width=0,e.height=0),e.w=e.width,e.h=e.height,e.x2=e.x+e.width,e.y2=e.y+e.height,e.cx=e.x+e.width/2,e.cy=e.y+e.height/2}},{key:"merge",value:function(t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y);return new u(e,n,Math.max(this.x+this.width,t.x+t.width)-e,Math.max(this.y+this.height,t.y+t.height)-n)}},{key:"transform",value:function(e){var n=1/0,i=-1/0,r=1/0,s=-1/0;return[new fe(this.x,this.y),new fe(this.x2,this.y),new fe(this.x,this.y2),new fe(this.x2,this.y2)].forEach(function(t){t=t.transform(e),n=Math.min(n,t.x),i=Math.max(i,t.x),r=Math.min(r,t.y),s=Math.max(s,t.y)}),new u(n,r,i-n,s-r)}},{key:"addOffset",value:function(){return this.x+=window.pageXOffset,this.y+=window.pageYOffset,this}},{key:"toString",value:function(){return this.x+" "+this.y+" "+this.width+" "+this.height}},{key:"toArray",value:function(){return[this.x,this.y,this.width,this.height]}}]),u}();function Pe(e){var n,t,i;try{if(n=e(this.node),!((i=n).w||i.h||i.x||i.y||(t=this.node,(document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===document}).call(document.documentElement,t))))throw new Error("Element not in the dom")}catch(t){try{var r=this.clone(ce().svg).show();n=e(r.node),r.remove()}catch(t){throw t}}return n}function De(e,n){return function(t){return null==t?this[t]:(this[e]=t,n&&n.call(this),this)}}lt({Element:{bbox:function(){return new Ne(Pe.call(this,function(t){return t.getBBox()}))},rbox:function(t){var e=new Ne(Pe.call(this,function(t){return t.getBoundingClientRect()}));return t?e.transform(t.screenCTM().inverse()):e.addOffset()}},viewbox:{viewbox:function(t,e,n,i){return null==t?new Ne(this.attr("viewBox")):this.attr("viewBox",new Ne(t,e,n,i))}}});var ze={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(t){}}},Re=function(){function t(){c(this,t)}return o(t,[{key:"done",value:function(){return!1}}]),t}(),qe=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this))).ease=ze[t||Ht]||t,e}return r(n,Re),o(n,[{key:"step",value:function(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}]),n}(),Le=function(t){function n(t){var e;return c(this,n),(e=a(this,u(n).call(this))).stepper=t,e}return r(n,Re),o(n,[{key:"step",value:function(t,e,n,i){return this.stepper(t,e,n,i)}},{key:"done",value:function(t){return t.done}}]),n}();function Ie(){var t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}var Fe=function(t){function i(t,e){var n;return c(this,i),(n=a(this,u(i).call(this))).duration(t||500).overshoot(e||0),n}return r(i,Le),o(i,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;100<n&&(n=16),n/=1e3;var r=i.velocity||0,s=-this.d*r-this.k*(t-e),u=t+r*n+s*n*n/2;return i.velocity=r+s*n,i.done=Math.abs(e-u)+Math.abs(r)<.002,i.done?e:u}}]),i}();U(Fe,{duration:De("_duration",Ie),overshoot:De("_overshoot",Ie)});var Xe=function(t){function s(t,e,n,i){var r;return c(this,s),t=null==t?.1:t,e=null==e?.01:e,n=null==n?0:n,i=null==i?1e3:i,(r=a(this,u(s).call(this))).p(t).i(e).d(n).windup(i),r}return r(s,Le),o(s,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;var r=e-t,s=(i.integral||0)+r*n,u=(r-(i.error||0))/n,o=this.windup;return!1!==o&&(s=Math.max(-o,Math.min(s,o))),i.error=r,i.integral=s,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*s+this.D*u)}}]),s}();U(Xe,{windup:De("windup"),p:De("P"),i:De("I"),d:De("D")});var Ye=function(){function e(t){c(this,e),this._stepper=t||new qe("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}return o(e,[{key:"from",value:function(t){return null==t?this._from:(this._from=this._set(t),this)}},{key:"to",value:function(t){return null==t?this._to:(this._to=this._set(t),this)}},{key:"type",value:function(t){return null==t?this._type:(this._type=t,this)}},{key:"_set",value:function(t){if(!this._type){var e=l(t);"number"===e?this.type(vt):"string"===e?Qt.isColor(t)?this.type(Qt):regex.delimiter.test(t)?this.type(regex.pathLetters.test(t)?de:Jt):regex.numberAndUnit.test(t)?this.type(vt):this.type(Ge):-1<Ve.indexOf(t.constructor)?this.type(t.constructor):Array.isArray(t)?this.type(Jt):"object"===e?this.type(He):this.type(Ge)}var n=new this._type(t).toArray();return this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(n.length)).map(Object),n}},{key:"stepper",value:function(t){return null==t?this._stepper:(this._stepper=t,this)}},{key:"done",value:function(){return this._context.map(this._stepper.done).reduce(function(t,e){return t&&e},!0)}},{key:"at",value:function(n){var i=this;return this._morphObj.fromArray(this._from.map(function(t,e){return i._stepper.step(t,i._to[e],n,i._context[e],i._context)}))}}]),e}(),Ge=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t){t=Array.isArray(t)?t[0]:t,this.value=t}},{key:"valueOf",value:function(){return this.value}},{key:"toArray",value:function(){return[this.value]}}]),t}(),Be=function(){function e(){c(this,e),this.init.apply(this,arguments)}return o(e,[{key:"init",value:function(t){Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,e.defaults,t)}},{key:"toArray",value:function(){var t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}]),e}();Be.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};var He=function(){function t(){c(this,t),this.init.apply(this,arguments)}return o(t,[{key:"init",value:function(t){if(this.values=[],Array.isArray(t))this.values=t;else{var e=Object.entries(t||{}).sort(function(t,e){return t[0]-e[0]});this.values=e.reduce(function(t,e){return t.concat(e)},[])}}},{key:"valueOf",value:function(){for(var t={},e=this.values,n=0,i=e.length;n<i;n+=2)t[e[n]]=e[n+1];return t}},{key:"toArray",value:function(){return this.values}}]),t}(),Ve=[Ge,Be,He];var Ue=window.performance||Date,Qe=function(t){var e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},$e=function(){function t(){c(this,t),this._timeSource=function(){return Ue.now()},this._dispatcher=document.createElement("div"),this._startTime=0,this._speed=1,this._reverse=!1,this._persist=0,this._nextFrame=null,this._paused=!1,this._runners=[],this._order=[],this._time=0,this._lastSourceTime=0,this._lastStepTime=0}return o(t,[{key:"getEventTarget",value:function(){return this._dispatcher}},{key:"schedule",value:function(t,e,n){if(null==t)return this._runners.map(Qe).sort(function(t,e){return t.start-e.start||t.duration-e.duration});this.active()||(this._step(),null==n&&(n="now"));var i=0;if(e=e||0,null==n||"last"===n||"after"===n)i=this._startTime;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else{if("relative"!==n)throw new Error('Invalid value for the "when" parameter');var r=this._runners[t.id];r&&(i=r.start+e,e=0)}return t.unschedule(),t.timeline(this),t.time(-e),this._startTime=i+t.duration()+e,this._runners[t.id]={persist:this.persist(),runner:t,start:i},this._order.push(t.id),this._continue(),this}},{key:"unschedule",value:function(t){var e=this._order.indexOf(t.id);return e<0||(delete this._runners[t.id],this._order.splice(e,1),t.timeline(null)),this}},{key:"play",value:function(){return this._paused=!1,this._continue()}},{key:"pause",value:function(){return this._nextFrame=null,this._paused=!0,this}},{key:"stop",value:function(){return this.seek(-this._time),this.pause()}},{key:"finish",value:function(){return this.seek(1/0),this.pause()}},{key:"speed",value:function(t){return null==t?this._speed:(this._speed=t,this)}},{key:"reverse",value:function(t){var e=this.speed();if(null==t)return this.speed(-e);var n=Math.abs(e);return this.speed(t?n:-n)}},{key:"seek",value:function(t){return this._time+=t,this._continue()}},{key:"time",value:function(t){return null==t?this._time:(this._time=t,this)}},{key:"persist",value:function(t){return null==t?this._persist:(this._persist=t,this)}},{key:"source",value:function(t){return null==t?this._timeSource:(this._timeSource=t,this)}},{key:"_step",value:function(){if(!this._paused){var t=this._timeSource(),e=t-this._lastSourceTime,n=this._speed*e+(this._time-this._lastStepTime);this._lastSourceTime=t,this._time+=n,this._lastStepTime=this._time;for(var i=!1,r=0,s=this._order.length;r<s;r++){var u=this._runners[this._order[r]],o=u.runner,a=n,h=this._time-u.start;if(h<0)i=!0;else if(h<a&&(a=h),o.active())if(o.step(a).done){if(!0!==u.persist){o.duration()-o.time()+this._time+this._persist<this._time&&(delete this._runners[this._order[r]],this._order.splice(r--,1)&&--s,o.timeline(null))}}else i=!0}return this._nextFrame=i?kt.frame(this._step.bind(this)):null,this}}},{key:"_continue",value:function(){return this._paused||this._nextFrame||(this._nextFrame=kt.frame(this._step.bind(this))),this}},{key:"active",value:function(){return!!this._nextFrame}}]),t}();lt({Element:{timeline:function(){return this._timeline=this._timeline||new $e,this._timeline}}});var Je=function(){function s(t){c(this,s),this.id=s.id++,t="function"==typeof(t=null==t?Bt:t)?new Le(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Le,this._stepper=this._isDeclarative?t:new qe,this._history={},this.enabled=!0,this._time=0,this._last=0,this.transforms=new Ee,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1}return o(s,[{key:"element",value:function(t){return null==t?this._element:((this._element=t)._prepareRunner(),this)}},{key:"timeline",value:function(t){return void 0===t?this._timeline:(this._timeline=t,this)}},{key:"animate",value:function(t,e,n){var i=s.sanitise(t,e,n),r=new s(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(e,n)}},{key:"schedule",value:function(t,e,n){if(t instanceof $e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}},{key:"unschedule",value:function(){var t=this.timeline();return t&&t.unschedule(this),this}},{key:"loop",value:function(t,e,n){return"object"===l(t)&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,this}},{key:"delay",value:function(t){return this.animate(0,t)}},{key:"queue",value:function(t,e,n){return this._queue.push({initialiser:t||Gt,runner:e||Gt,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}},{key:"during",value:function(t){return this.queue(null,t)}},{key:"after",value:function(t){return this.on("finish",t)}},{key:"time",value:function(t){if(null==t)return this._time;var e=t-this._time;return this.step(e),this}},{key:"duration",value:function(){return this._times*(this._wait+this._duration)-this._wait}},{key:"loops",value:function(t){var e=this._duration+this._wait;if(null==t){var n=Math.floor(this._time/e),i=(this._time-n*e)/this._duration;return Math.min(n+i,this._times)}var r=t%1,s=e*Math.floor(t)+this._duration*r;return this.time(s)}},{key:"position",value:function(t){var e,n=this._time,r=this._duration,s=this._wait,i=this._times,u=this._swing,o=this._reverse;if(null==t){var a=function(t){var e=u*Math.floor(t%(2*(s+r))/(s+r)),n=e&&!o||!e&&o,i=Math.pow(-1,n)*(t%(s+r))/r+n;return Math.max(Math.min(i,1),0)},h=i*(s+r)-s;return e=n<=0?Math.round(a(1e-5)):n<h?a(n):Math.round(a(h-1e-5)),e}var l=Math.floor(this.loops()),c=u&&l%2==0;return e=l+(c&&!o||o&&c?t:1-t),this.loops(e)}},{key:"progress",value:function(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}},{key:"step",value:function(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;var e=this.position(),n=this._lastPosition!==e&&0<=this._time;this._lastPosition=e;var i=this.duration(),r=(this._lastTime<0&&this._time,this._lastTime<this._time&&this.time>i);this._lastTime=this._time;var s=this._isDeclarative;if(this.done=!s&&!r&&this._time>=i,n||s){this._initialise(n),this.transforms=new Ee;var u=this._run(s?t:e)}return this.done=this.done||u&&s,this}},{key:"finish",value:function(){return this.step(1/0)}},{key:"reverse",value:function(t){return this._reverse=null==t?!this._reverse:t,this}},{key:"ease",value:function(t){return this._stepper=new qe(t),this}},{key:"active",value:function(t){return null==t?this.enabled:(this.enabled=t,this)}},{key:"_rememberMorpher",value:function(t,e){this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]}}},{key:"_tryRetarget",value:function(t,e){if(this._history[t]){if(!this._history[t].caller.initialised){var n=this._queue.indexOf(this._history[t].caller);return this._queue.splice(n,1),!1}this._history[t].caller.isTransform?this._history[t].caller.isTransform(e):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var i=this.timeline();return i&&i._continue(),!0}return!1}},{key:"_initialise",value:function(t){if(t||this._isDeclarative)for(var e=0,n=this._queue.length;e<n;++e){var i=this._queue[e],r=this._isDeclarative||!i.initialised&&t;t=!i.finished,r&&t&&(i.initialiser.call(this),i.initialised=!0)}}},{key:"_run",value:function(t){for(var e=!0,n=0,i=this._queue.length;n<i;++n){var r=this._queue[n],s=r.runner.call(this,t);r.finished=r.finished||!0===s,e=e&&r.finished}return e}},{key:"addTransform",value:function(t,e){return this.transforms.lmultiplyO(t),this}},{key:"clearTransform",value:function(){return this.transforms=new Ee,this}}],[{key:"sanitise",value:function(t,e,n){var i=1,r=!1,s=0;return e=e||Vt,n=n||"last","object"!==l(t=t||Bt)||t instanceof Re||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,s=t.wait||s,t=t.duration||Bt),{duration:t,delay:e,swing:r,times:i,wait:s,when:n}}}]),s}();Je.id=0;var We=function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Ee,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];c(this,t),this.transforms=e,this.id=n,this.done=i};U([Je,We],{mergeWith:function(t){return new We(t.transforms.lmultiply(this.transforms),t.id)}});var Ze=function(t,e){return t.lmultiplyO(e)},Ke=function(t){return t.transforms};var tn=function(){function t(){c(this,t),this.runners=[],this.ids=[]}return o(t,[{key:"add",value:function(t){if(!this.runners.includes(t)){var n=t.id+1,e=this.ids.reduce(function(t,e){return t<e&&e<n?e:t},0),i=this.ids.indexOf(e)+1;return this.ids.splice(i,0,n),this.runners.splice(i,0,t),this}}},{key:"getByID",value:function(t){return this.runners[this.ids.indexOf(t+1)]}},{key:"remove",value:function(t){var e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}},{key:"merge",value:function(){var n=this,i=null;return this.runners.forEach(function(t,e){i&&t.done&&i.done&&(n.remove(t.id),n.edit(i.id,t.mergeWith(i))),i=t}),this}},{key:"edit",value:function(t,e){var n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t),this.runners.splice(n,1,e),this}},{key:"length",value:function(){return this.ids.length}},{key:"clearBefore",value:function(t){var e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new We),this}}]),t}(),en=0;lt({Element:{animate:function(t,e,n){var i=Je.sanitise(t,e,n),r=this.timeline();return new Je(i.duration).loop(i).element(this).timeline(r).schedule(e,n)},delay:function(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore:function(t){this._transformationRunners.clearBefore(t.id)},_currentTransform:function(e){return this._transformationRunners.runners.filter(function(t){return t.id<=e.id}).map(Ke).reduce(Ze,new Ee)},addRunner:function(t){this._transformationRunners.add(t),kt.transform_frame(function(){var t=this._transformationRunners.runners.map(Ke).reduce(Ze,new Ee);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}.bind(this),this._frameId)},_prepareRunner:function(){null==this._frameId&&(this._transformationRunners=(new tn).add(new We(new Ee(this))),this._frameId=en++)}}}),U(Je,{attr:function(t,e){return this.styleAttr("attr",t,e)},css:function(t,e){return this.styleAttr("css",t,e)},styleAttr:function(e,n,t){if("object"===l(n))for(var i in t)this.styleAttr(e,i,t[i]);var r=new Ye(this._stepper).to(t);return this.queue(function(){r=r.from(this.element()[e](n))},function(t){return this.element()[e](n,r.at(t)),r.done()}),this},zoom:function(t,e){var n=new Ye(this._stepper).to(new vt(t));return this.queue(function(){n=n.from(this.zoom())},function(t){return this.element().zoom(n.at(t),e),n.done()}),this},transform:function(d,v,y){if(v=d.relative||v,this._isDeclarative&&!v&&this._tryRetarget("transform",d))return this;var p=L(d);y=null!=d.affine?d.affine:null!=y?y:!p;var m,g,w,x,b,_=(new Ye).type(y?Be:Ee).stepper(this._stepper);return this.queue(function(){g=g||this.element(),m=m||I(d,g),b=new Ee(v?void 0:g),g.addRunner(this),v||g._clearTransformRunnersBefore(this)},function(t){v||this.clearTransform();var e=new fe(m).transform(g._currentTransform(this)),n=e.x,i=e.y,r=new Ee(k({},d,{origin:[n,i]})),s=this._isDeclarative&&w?w:b;if(y){r=r.decompose(n,i),s=s.decompose(n,i);var u=r.rotate,o=s.rotate,a=[u-360,u,u+360],h=a.map(function(t){return Math.abs(t-o)}),l=Math.min.apply(Math,O(h)),c=h.indexOf(l);r.rotate=a[c]}v&&(p||(r.rotate=d.rotate||0),this._isDeclarative&&x&&(s.rotate=x)),_.from(s),_.to(r);var f=_.at(t);return x=f.rotate,w=new Ee(f),this.addTransform(w),_.done()},function(t){(t.origin||"center").toString()!==(d.origin||"center").toString()&&(m=I(d,g)),d=k({},t,{origin:m})}),this._isDeclarative&&this._rememberMorpher("transform",_),this},x:function(t,e){return this._queueNumber("x",t)},y:function(t){return this._queueNumber("y",t)},dx:function(t){return this._queueNumberDelta("dx",t)},dy:function(t){return this._queueNumberDelta("dy",t)},_queueNumberDelta:function(e,n){if(n=new vt(n),this._tryRetargetDelta(e,n))return this;var i=new Ye(this._stepper).to(n);return this.queue(function(){var t=this.element()[e]();i.from(t),i.to(t+n)},function(t){return this.element()[e](i.at(t)),i.done()}),this._rememberMorpher(e,i),this},_queueObject:function(e,t){if(this._tryRetarget(e,t))return this;var n=new Ye(this._stepper).to(t);return this.queue(function(){n.from(this.element()[e]())},function(t){return this.element()[e](n.at(t)),n.done()}),this._rememberMorpher(e,n),this},_queueNumber:function(t,e){return this._queueObject(t,new vt(e))},cx:function(t){return this._queueNumber("cx",t)},cy:function(t){return this._queueNumber("cy",t)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},size:function(t,e){var n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width:function(t){return this._queueNumber("width",t)},height:function(t){return this._queueNumber("height",t)},plot:function(t,e,n,i){return 4===arguments.length?this.plot([t,e,n,i]):this._queueObject("plot",new this._element.MorphArray(t))},leading:function(t){return this._queueNumber("leading",t)},viewbox:function(t,e,n,i){return this._queueObject("viewbox",new Box(t,e,n,i))},update:function(t){return"object"!==l(t)?this.update({offset:t,color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}});var nn=Object.freeze({HtmlNode:ut,Doc:xt,Defs:ot,G:bt,Animator:kt,Bare:Ot,Circle:Pt,ClipPath:Lt,A:It,Ellipse:Ft,Stop:Xt,Gradient:Zt,Image:ue,Line:ae,Marker:he,Mask:le,Path:ge,Pattern:Kt,Polygon:_e,Polyline:ke,Rect:Oe,Symbol:Ae,Text:Me,TextPath:je,Tspan:Te,Use:Se,SVGNumber:vt,SVGArray:Jt,PathArray:de,PointArray:oe,Matrix:Ee,Point:fe,Box:Ne,Color:Qt,Morphable:Ye,Queue:_t,Runner:Je,Timeline:$e,Controller:Le,Ease:qe,PID:Xe,Spring:Fe}),rn=Object.freeze({Bare:Ot,ClipPath:Lt,Defs:ot,Doc:xt,Gradient:Zt,G:bt,A:It,Marker:he,Mask:le,Pattern:Kt,Symbol:Ae,Text:Me,Tspan:Te,TextPath:je}),sn=Object.freeze({Bare:Ot,Circle:Pt,ClipPath:Lt,Defs:ot,Doc:xt,Ellipse:Ft,Gradient:Zt,G:bt,HtmlNode:ut,A:It,Image:ue,Line:ae,Marker:he,Mask:le,Path:ge,Pattern:Kt,Polygon:_e,Polyline:ke,Rect:Oe,Stop:Xt,Symbol:Ae,Text:Me,TextPath:je,Tspan:Te,Use:Se});lt("Element",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),"function"==typeof e.isRoot&&e.isRoot()&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return 0<t&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),"function"==typeof t.isRoot&&t.isRoot()&&t.node.appendChild(t.defs().node),this},back:function(){return 0<this.position()&&this.parent().removeElement(this).add(this,0),this},before:function(t){t.remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){t.remove();var e=this.position();return this.parent().add(t,e+1),this}}),lt("Element",{data:function(e,t,n){if("object"===l(e))for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),lt("Element",{css:function(t,e){var n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter(function(t){return!!t.length}).forEach(function(t){var e=t.split(/\s*:\s*/);n[e[0]]=e[1]}),n;if(arguments.length<2){if(Array.isArray(t)){var i=!0,r=!1,s=void 0;try{for(var u,o=t[Symbol.iterator]();!(i=(u=o.next()).done);i=!0){var a=E(u.value);n[a]=this.node.style[a]}}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}if("string"==typeof t)return this.node.style[E(t)];if("object"===l(t))for(name in t)this.node.style[E(name)]=null==t[name]||w.test(t[name])?"":t[name]}return 2===arguments.length&&(this.node.style[E(t)]=null==e||w.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),lt("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(t).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(_).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(z(e[1])):t[e[0]].apply(t,e[1])},new Ee)},toParent:function(t){if(this===t)return this;var e=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t).untransform().transform(n.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())},transform:function(t,e){if(null==t||"string"==typeof t){var n=new Ee(this).decompose();return n[t]||n}L(t)||(t=k({},t,{origin:I(t,this)}));var i=new Ee(!0===e?this:e||!1).transform(t);return this.attr("transform",i)}}),lt("Element",{remember:function(t,e){if("object"===l(t))for(var n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(var t=arguments.length-1;0<=t;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory}}),ft("Memory",function(t){this._memory={}});var un={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach(function(e){var n,t={};t[e]=function(t){if(void 0===t)return this;if("string"==typeof t||Qt.isRgb(t)||t&&"function"==typeof t.fill)this.attr(e,t);else for(n=un[e].length-1;0<=n;n--)null!=t[un[e][n]]&&this.attr(un.prefix(e,un[e][n]),t[un[e][n]]);return this},lt(["Element","Runner"],t)}),lt(["Element","Runner"],{matrix:function(t,e,n,i,r,s){return null==t?new Ee(this):this.attr("transform",new Ee(t,e,n,i,r,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t,e){var n="string"==typeof t?t:(isFinite(t),"both"),i="both"===t&&isFinite(e)?[e,e]:"x"===t?[e,0]:"y"===t?[0,e]:isFinite(t)?[t,t]:[0,0];this.transform({flip:n,origin:i},!0)},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new vt(t).plus(this instanceof Je?0:this.x()),!0)},dy:function(t){return this.y(new vt(t).plus(this instanceof Je?0:this.y()),!0)},dmove:function(t,e){return this.dx(t).dy(e)}}),lt("radius",{radius:function(t,e){var n=(this._target||this).type;return"radialGradient"===n||"radialGradient"===n?this.attr("r",new vt(t)):this.rx(t).ry(null==e?t:e)}}),lt("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new fe(this.node.getPointAtLength(t))}}),lt(["Container","Runner"],{font:function(t,e){if("object"===l(t))for(e in t)this.font(e,t[e]);return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),lt("EventTarget",{on:function(t,e,n,i){return ne(this,t,e,n,i),this},off:function(t,e){return ie(this,t,e),this},dispatch:function(t,e){return re(this,t,e)},fire:function(t,e){return this.dispatch(t,e),this}}),ft("EventTarget",function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.events=t.events||{}}),lt("Container",{children:function(){return Dt(this.node.children,function(t){return K(t)})},add:function(t,e){return t=Z(t),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t.instance||t},has:function(t){return 0<=this.index(t)},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return K(this.node.childNodes[t])},first:function(){return K(this.node.firstChild)},last:function(){return K(this.node.lastChild)},each:function(t,e){var n,i,r=this.children();for(n=0,i=r.length;n<i;n++)r[n]instanceof s&&t.apply(r[n],[n,r]),e&&r[n]instanceof s&&r[n].is("Parent")&&r[n].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},svg:function(t){var e,n;if(!t)return this.writeDataToDom(),this.node.outerHTML;for((e=document.createElementNS(F,"svg")).innerHTML=t,n=e.children.length;n--;)this.node.appendChild(e.firstElementChild);return this},writeDataToDom:function(){return this.each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},flatten:function(t){return this.each(function(){return this.is("Parent")?this.flatten(t).ungroup(t):this.toParent(t)}),this.node.firstElementChild||this.remove(),this},ungroup:function(t){return t=t||this.parent(),this.each(function(){return this.toParent(t)}),this.remove(),this}});var on=U;on([xt,Ae,ue,Kt,he],ct("viewbox")),on([ae,ke,_e,ge],ct("marker")),on(Me,ct("Text")),on(ge,ct("Path")),on(ot,ct("Defs")),on([Me,Te],ct("Tspan")),on([Oe,Ft,Pt,Zt],ct("radius"));var an=ct("Container");for(var hn in rn)on(rn[hn],an);var ln=ct("Element"),cn=ct("EventTarget");for(var fn in sn)on(sn[fn],ln),on(sn[fn],cn),on(sn[fn],dt("EventTarget")),on(sn[fn],dt("Element")),on(sn[fn],dt("Memory"));function dn(t){return Z(t)}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];Ve.push.apply(Ve,O([].concat(t)))}([vt,Qt,Ne,Ee,Jt,oe,de]),U(Ve,{to:function(t,e){return(new Ye).type(this.constructor).from(this.valueOf()).to(t,e)},fromArray:function(t){return this.init(t),this}}),Object.assign(dn,nn),Object.assign(dn,$),Object.assign(dn,st),dn.utils=Rt,dn.regex=e,(dn.get=dn).find=qt,Object.assign(dn,B),dn.Element=dn.Parent=dn.Shape=dn.Container=s,dn.easing=ze,Object.assign(dn,se),dn.TransformBag=Be,dn.ObjectBag=He,dn.NonMorphable=Ge,dn.parser=ce,dn}(); |